Getting java.lang.ClassNotFoundException while trying to init the library
See original GitHub issueI’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:
- Created 7 years ago
- Reactions:1
- Comments:8 (4 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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 ofannotationProcessor
:compile 'com.github.matthiasrobbers:shortbread:1.0.0'
apt 'com.github.matthiasrobbers:shortbread-compiler:1.0.0'
Thanks, @AlexanderThiele!
So the solution is to either use the old
apt
as a workaroundor better, migrate your project to the new built-in
annotationProcessor
syntax. Migration guide: https://bitbucket.org/hvisser/android-apt/wiki/Migration