akash-queuebuster opened a new issue, #1311:
URL: https://github.com/apache/logging-log4j2/issues/1311
## Description
When I implemented the StrLookup in my Lookup then in runtime classpath
couldn't find StrLookup inteface. My guess is that it's due to reflection, the
interface is available at compile time but couldn't include in build so it's
unavailable at runtime.
## Configuration
**Version:** 2.3 | 2.17.2 | 2.19.0
**Operating system:** Android 11
**JDK:** Embedded JDK Version 11.0.15
## Logs
```
java.lang.NoClassDefFoundError: Failed resolution of:
Lorg/apache/logging/log4j/core/lookup/StrLookup;
at
com.example.application.local_log.AndroidLog4jHelper.initialise(AndroidLog4jHelper.java:36)
at
com.example.application.my_app.app.MainApplication.setupLog4J(MainApplication.java:329)
at
com.example.application.my_app.app.MainApplication.onCreate(MainApplication.java:323)
at
android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1192)
at
android.app.ActivityThread.handleBindApplication(ActivityThread.java:7593)
at android.app.ActivityThread.access$1500(ActivityThread.java:301)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2177)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:246)
at android.app.ActivityThread.main(ActivityThread.java:8653)
at java.lang.reflect.Method.invoke(Native Method)
at
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)
Caused by: java.lang.ClassNotFoundException: Didn't find class
"org.apache.logging.log4j.core.lookup.StrLookup" on path: DexPathList[[zip file
"/data/app/~~xPUZykkWQAbNPadqT4Iamw==/com.dpdtech.application.mpos-q2_T3J_MHK2KX_sdSlYhjw==/base.apk"],nativeLibraryDirectories=[/data/app/~~xPUZykkWQAbNPadqT4Iamw==/com.dpdtech.application.mpos-q2_T3J_MHK2KX_sdSlYhjw==/lib/arm64,
/data/app/~~xPUZykkWQAbNPadqT4Iamw==/com.dpdtech.application.mpos-q2_T3J_MHK2KX_sdSlYhjw==/base.apk!/lib/arm64-v8a,
/system/lib64]]
at
dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:207)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at
com.dpdtech.application.local_log.AndroidLog4jHelper.initialise(AndroidLog4jHelper.java:36)
at
com.example.application.my_app.app.MainApplication.setupLog4J(MainApplication.java:329)
at
com.example.application.my_app.app.MainApplication.onCreate(MainApplication.java:323)
at
android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1192)
at
android.app.ActivityThread.handleBindApplication(ActivityThread.java:7593)
at android.app.ActivityThread.access$1500(ActivityThread.java:301)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2177)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:246)
at android.app.ActivityThread.main(ActivityThread.java:8653)
at java.lang.reflect.Method.invoke(Native Method)
at
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)
```
## Reproduction
you can reproduce it just pull this code and run it
(https://github.com/roman-mityukov/log4j2-android)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]