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
NoClassDefFoundError on Android 4.1.2 #1628
Comments
today i got same error after update to version:
previously i was using version :
and everything running well. error :
code :
|
I got same error using the beta4 version : And my ServiceGenerator :
} and i got this error :
|
Do you guys use |
yup, i'm using multiDexEnabled true, |
Yes, I used multiDexEnabled true too :-) |
Yes, I used multiDexEnabled true too, but i don't think that this is the cause of the problem, i got always : |
Use either Here is documentation http://developer.android.com/tools/building/multidex.html |
today, i have created new simple app using retrofit2 beta4 and used multiDexEnabled true. But the error not appear. my app running well. |
Hi Guys, I solved my problem by changing one library in gradle, retrofit solved the conflict problem by renaming package to retrofit2. @PaijoRX can u paste here all your dependancies that you use in Gradle please ? |
|
finally i solved my error. |
Closing since this was determined to be a build system problem and not a Retrofit bug. |
Ya, Exactly multiDexEnabled true is the problem here. Instead of remove it, you can add make your application extends android.support.multidex.MultiDexApplication, dependence is |
at-longcb commented on 16 Mar 2016 I tried removing " multiDexEnabled true" , # But Finally I fixed this issue by extending my base Application class Updated retrofit lib from 1.9.0 -to - :2.2.0' dependencies { defaultConfig { Please Check this link to know more about multidex enable Hope This would help to someone else facing the same issue |
Hi, everybody.
I write because I have encountered a problem while using the retrofit2 library on Samsung Galaxy S2 (Android 4.1.2).
While performing any network request, the application dies with the following stack trace:
java.lang.ExceptionInInitializerError at com.vwgroup.audiservice.bolts.TaskManager.registrationTask(TaskManager.java:41) at com.vwgroup.audiservice.ui.activity.ImbServiceTest.performNetworkrequest(ImbServiceTest.java:49) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:511) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at android.support.test.internal.statement.UiThreadStatement.evaluate(UiThreadStatement.java:55) at android.support.test.rule.ActivityTestRule$ActivityStatement.evaluate(ActivityTestRule.java:257) at org.junit.rules.RunRules.evaluate(RunRules.java:20) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.junit.runners.Suite.runChild(Suite.java:128) at org.junit.runners.Suite.runChild(Suite.java:27) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.junit.runner.JUnitCore.run(JUnitCore.java:137) at org.junit.runner.JUnitCore.run(JUnitCore.java:115) at android.support.test.internal.runner.TestExecutor.execute(TestExecutor.java:54) at android.support.test.runner.AndroidJUnitRunner.onStart(AndroidJUnitRunner.java:240) at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1619) Caused by: java.lang.NoClassDefFoundError: retrofit2.Retrofit$Builder at com.vwgroup.audiservice.network.ServiceGenerator.(ServiceGenerator.java:24) ... 33 more
The same code run without any issue on Android 5.0, 5.1, 6
My Gradle dependencies are as follows:
compile ('com.squareup.retrofit2:retrofit:2.0.0-beta4'){ exclude group: 'com.android.support' } compile ('com.squareup.retrofit2:converter-gson:2.0.0-beta4'){ exclude group: 'com.android.support' } compile ('com.squareup.retrofit2:converter-simplexml:2.0.0-beta4'){ exclude module: 'xpp3' exclude module: 'stax' exclude module: 'stax-api' exclude group: 'com.android.support' } compile 'com.squareup.okhttp:okhttp:2.7.4'
Any help will be appreciated.
thanks
The text was updated successfully, but these errors were encountered: