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.

Getting java.lang.ClassNotFoundException while trying to init the library

See original GitHub issue

I’m getting this exception when I call Shortbread.create(this); in my Application class. Am I missing something?

OS: 7.1 Device: Google Pixel

java.lang.ClassNotFoundException: shortbread.ShortbreadGenerated
W/System.err:     at java.lang.Class.classForName(Native Method)
W/System.err:     at java.lang.Class.forName(Class.java:400)
W/System.err:     at java.lang.Class.forName(Class.java:326)
W/System.err:     at shortbread.Shortbread.create(Shortbread.java:37)
Caused by: java.lang.ClassNotFoundException: Didn't find class "shortbread.ShortbreadGenerated"

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
AlexanderThielecommented, Feb 27, 2017

I had the same problem.

In my project we’re using a different annotation processor plugin: apply plugin: 'com.neenbedankt.android-apt'

And i fixed this crash by using apt instead of annotationProcessor:

compile 'com.github.matthiasrobbers:shortbread:1.0.0' apt 'com.github.matthiasrobbers:shortbread-compiler:1.0.0'

0reactions
MatthiasRobberscommented, Feb 27, 2017

Thanks, @AlexanderThiele!

So the solution is to either use the old apt as a workaround

compile 'com.github.matthiasrobbers:shortbread:1.0.0'
apt 'com.github.matthiasrobbers:shortbread-compiler:1.0.0'

or better, migrate your project to the new built-in annotationProcessor syntax. Migration guide: https://bitbucket.org/hvisser/android-apt/wiki/Migration

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Fix ClassNotFoundException in Java - Rollbar
The Java ClassNotFoundException occurs when the JVM tries to load a class but does not find it in the classpath. Learn the three...
Read more >
3 ways to solve java.lang.NoClassDefFoundError in Java J2EE
ClassNotFoundException comes when JVM tries to load a class at runtime dynamically means you give the name of the class at runtime and...
Read more >
How to Solve java.lang.ClassNotFoundException in Java?
ClassNotFoundException is a checked exception and occurs when the Java Virtual Machine (JVM) tries to load a particular class and the specified ...
Read more >
How can I solve "java.lang.NoClassDefFoundError"?
These binary files are the bytecode that Java interprets to execute your program. The NoClassDefFoundError indicates that the classloader (in this case java.net ......
Read more >
How to Fix java.lang.ClassNotFoundException: com.mysql ...
When Class.forName() method will execute at run-time, it will try to find the driver class provided as String argument and throw this error...
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