-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Generator fails to run NoClassDefFoundError: org/greenrobot/greendao/generator/Schema #619
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Do you have a stacktrace or an example project? Otherwise it is a little hard to guess what this issue is caused by. Typically this might be caused by missing configuration for ProGuard or multidex. |
|
//just calling the Schema class throws not found error. |
Now I see: looks like greenDAO generator is missing from your classpath. Make sure that you have a dependency on the generator (like |
//I think not I have all along in the gradle build dependencies. |
nothing is change in the code, |
Hello! I also metting this trouble. Find a long time,lastly I try add ' MultiDex.install(this); ' at myapplication! After that my app is well running! Hope to help you ! Ignore my terrible English |
hi, |
hi ! in your application.java ‘s oncreate() ! I sended an email to you for example picture |
Hi did not receive any email. |
Oh, I just see that this might be a known issue: try to run code generation using Gradle. Add the class with the
Then in Android Studio execute the Gradle Update: I added this to the documentation. |
Hi, I did not make my own application class for my dao generator. |
@baylonedward As said, you need to apply the application plugin and configure your generator class. See my comment above. -ut |
Oh i see. |
hi, I have three of them, the root build.gradle , the app build.gradle and the greendao build.gradle. In my app build.gradle file i apply the plugin: 'com.android.application' , so adding apply plugin: 'application' is not compatible. I want to use the old greendao generation file i created with Version 2.0.0. Now i upgraded greendao to version 3.2.0. ( i changed all imports in the generation file). Normaly this should work or not? Please give me some hints to get it work. Best regards. |
@Diatore You should add it to the build.gradle file where you use the generator. To learn how to update to greenDAO 3 have a look at the docs. @baylonedward This is an Android Studio/IntelliJ IDEA issue. I am not sure there is anything we can do about it from our side. |
(greendao 3.2.2) I am using android studio 3.0 preview beta, using the tasks/application/run gradle way to build, but I am getting Error:Execution failed for task ':lib:run'.
|
I'm using Android Studio 2.3.2 and greendao 1.3.0, here is my build.gradle:
when I click run in application, I encounter this error:
|
@jeffreyliu8 @mrrobot97 Using Android Studio 3 RC1 and JDK Build 1.8.0_141-b15 the @mrrobot97 I have not tested with |
Thanks to the above answers, I experienced the same issues moving to AS 3 preview. What solved it for me was moving the execution of the generator to a gradle task, and adding the application plugin to my generator module’s build.gradle. As explained by the greendao users. Thanks. I would really like to know why this works tho. Additionally before I got it to work, I experienced the issue “blablabla finished with non-zero exit value 1”, but this was because of a typo in my package and generator class string value for mainClassName value. Additionally I am using GreenDao version 2.1. (de.greenrobot:greendao-generator:2.1.0) |
@greenrobot-team Finally I figured out why would I get this error: I'm using greendaogenerator in a seperate module and the out-dir is in another module named "data". I used to used |
After upgrading to Android Studio 3 and also upgrading to greendao 3.2.2 from 2, I am facing this issue. I am on gradle version 4.3.1. I have put mainClassName in my generator's build.gradle file like below,
Still facing the same issue. My application's root build.gradle contains
I have added dependency Please help me out. |
I'm facing the same issue. can anyone help me resolve this?? This is after migrating android studio from android version 2.3.2 to 3.0 Exception in thread "main" java.lang.NoClassDefFoundError: org/greenrobot/greendao/generator/Schema |
in build.gradle file.
and then sync the gradle and also need to update the generate output directory, like: |
@VinsonCai thanks for the quick response. I tried as per your suggestion but I'm getting some other issue. any idea on this?
|
Hello. I tried suggested workaround, but it didn't work for me. I figured out the issue happens because of new gradle 3.0 version, if you download gradle version 2.3 it works fine (so you can still use new Android Studio). I'm using SQLCipher (3.5.7) and GreenDAO encryption generator (org.greenrobot:greendao-generator-encryption:2.2.0) on MacOS. Cheers |
@ashwithraja |
I managed to fix the issue by updating the greenDao SDK to 3.2.2 |
Even I am getting the same error
|
In case this helps someone: I managed to fix the issue by executing the Gradle 'run' command directly from the command-line as described in this SO answer: |
@xTheITx tks,its work for me ;;) |
I'm stuck with this issue. Can't get it working. "/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java" "-javaagent:/Applications/Android Studio.app/Contents/lib/idea_rt.jar=51303:/Applications/Android Studio.app/Contents/bin" -Dfile.encoding=UTF-8 -classpath "/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/jre/lib/charsets.jar:/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/jre/lib/ext/cldrdata.jar:/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/jre/lib/ext/dnsns.jar:/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/jre/lib/ext/jaccess.jar:/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/jre/lib/ext/localedata.jar:/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/jre/lib/ext/nashorn.jar:/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/jre/lib/ext/sunec.jar:/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/jre/lib/ext/sunjce_provider.jar:/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/jre/lib/ext/sunpkcs11.jar:/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/jre/lib/ext/zipfs.jar:/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/jre/lib/jce.jar:/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/jre/lib/jsse.jar:/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/jre/lib/management-agent.jar:/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/jre/lib/resources.jar:/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/jre/lib/rt.jar:/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/lib/dt.jar:/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/lib/jconsole.jar:/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/lib/sa-jdi.jar:/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/lib/tools.jar:/Users/user/Desktop/**/Greendao-Generator/build/classes/java/main" ..com.greendao_generator.MainGenerator |
HI "C:\Program Files\Android\Android Studio\jre\bin\java" "-javaagent:C:\Program Files\Android\Android Studio\lib\idea_rt.jar=44708:C:\Program Files\Android\Android Studio\bin" -Dfile.encoding=UTF-8 -classpath "C:\Program Files\Android\Android Studio\jre\jre\lib\charsets.jar;C:\Program Files\Android\Android Studio\jre\jre\lib\ext\access-bridge-64.jar;C:\Program Files\Android\Android Studio\jre\jre\lib\ext\cldrdata.jar;C:\Program Files\Android\Android Studio\jre\jre\lib\ext\dnsns.jar;C:\Program Files\Android\Android Studio\jre\jre\lib\ext\jaccess.jar;C:\Program Files\Android\Android Studio\jre\jre\lib\ext\localedata.jar;C:\Program Files\Android\Android Studio\jre\jre\lib\ext\nashorn.jar;C:\Program Files\Android\Android Studio\jre\jre\lib\ext\sunec.jar;C:\Program Files\Android\Android Studio\jre\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Android\Android Studio\jre\jre\lib\ext\sunmscapi.jar;C:\Program Files\Android\Android Studio\jre\jre\lib\ext\sunpkcs11.jar;C:\Program Files\Android\Android Studio\jre\jre\lib\ext\zipfs.jar;C:\Program Files\Android\Android Studio\jre\jre\lib\jce.jar;C:\Program Files\Android\Android Studio\jre\jre\lib\jsse.jar;C:\Program Files\Android\Android Studio\jre\jre\lib\management-agent.jar;C:\Program Files\Android\Android Studio\jre\jre\lib\resources.jar;C:\Program Files\Android\Android Studio\jre\jre\lib\rt.jar;D:\IMNCI\MBCT\mbct.orm\build\classes\java\main" taditsolution.orm.MbctORM Process finished with exit code 1 |
Got it working! |
@blueboxsolution tnx alot it worked ...... |
@xTheITx X thx, it spent me a lot time until find your answer. |
@greenrobot-team has the perfect answer and its there in documentation,
In Java code replace Once this is done, follow steps below:
|
For me I have to delete apply 'java' from my daogenerator module and put these lines instead : apply plugin: 'application' dependencies { |
Android studio3.0.1, GreenDao3.2.3 or 2.3.3; all above answers are unused. It had spent me one afternoon..... |
This error just suddenly occur when I am about to update my database using green dao.
It seems it can find Schema class from greendao lib. I am using Android Studio 2.3.
The text was updated successfully, but these errors were encountered: