question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

java.lang.NoClassDefFoundError in API 18

See original GitHub issue

When trying to upload the debug variant of an app I am developing using Timber. When trying in one of my old devices running API 18, I get the following error

E/AndroidRuntime: FATAL EXCEPTION: main
                                                                             java.lang.NoClassDefFoundError: timber.log.Timber$1
                                                                                 at timber.log.Timber.<clinit>(Timber.java:150)
                                                                                 at com.aitorvs.android.nlcommute.MyApplication.onCreate(MyApplication.java:36)
                                                                                 at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1007)
                                                                                 at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4444)
                                                                                 at android.app.ActivityThread.access$1300(ActivityThread.java:141)
                                                                                 at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1316)
                                                                                 at android.os.Handler.dispatchMessage(Handler.java:99)
                                                                                 at android.os.Looper.loop(Looper.java:137)
                                                                                 at android.app.ActivityThread.main(ActivityThread.java:5103)
                                                                                 at java.lang.reflect.Method.invokeNative(Native Method)
                                                                                 at java.lang.reflect.Method.invoke(Method.java:525)
                                                                                 at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
                                                                                 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
                                                                                 at dalvik.system.NativeStart.main(Native Method)

and MyApplication.java:36 is the Timber.plant(...) inside the true IF branch like bellow:

        if (BuildConfig.DEBUG) {
            Timber.plant(new Timber.DebugTree() {
                             @Override
                             protected String createStackElementTag(StackTraceElement element) {
                                 return super.createStackElementTag(element) + ":" + element.getLineNumber();
                             }
                         }
            );
        } else {
            Timber.plant(new TimberReleaseTree());
        }

I have tested the app in other devices running L and M and runs OK for both release and debug versions so I assume is something related to TImber internals.

I am using version Timber 4.1.0.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:1
  • Comments:7

github_iconTop GitHub Comments

13reactions
Binghammercommented, Apr 9, 2017

I have mulitdexing enabled and I am still running in to this issue

8reactions
sytlercommented, May 3, 2017

@Binghammer I was facing the same issue on KitKat, placing “MultiDex.install(this)” right below super.OnCreate fixed this issue

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I solve "java.lang.NoClassDefFoundError"?
NoClassDefFoundError means that the class is present in the classpath at Compile time , but it doesn' ...
Read more >
3 ways to solve java.lang.NoClassDefFoundError in Java J2EE
NoClassDefFoundError in Java comes when Java Virtual Machine is not able to find a particular class at runtime which was available at compile...
Read more >
NoClassDefFoundError (Java Platform SE 8 )
Constructs a NoClassDefFoundError with the specified detail message. Method Summary. Methods inherited from class java.lang.Throwable · addSuppressed, ...
Read more >
"java.lang.NoClassDefFoundError: org/junit/platform/commons ...
I recently upgraded JUnit version from 5.5.2 to 5.7.0.
Read more >
java.lang.NoClassDefFoundError: javax/xml/bind ...
The JAXB is part of Java 6, 7, and 8. · Java 9 deprecated the Java EE modules, including the JAXB packages javax....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found