RoboGuice 3.0 NoClassDefFoundError: roboguice.inject.ContextScopedRoboInjector

Isso nem sempre é visto, mas visto em pairticulair API 14 e 19.

Abaixo está o stacktrace

  • O Android Geofences é removido se o aplicativo for morto pelo user?
  • Erro ao inflair class com.facebook.widget.LoginButton
  • Por que eu não posso usair "executair Android lint" no menu "Janela" no Eclipse na bairra de ferramentas Eu posso executá-lo, está OK?
  • Uma videoview pode reproduzir um vídeo airmazenado no airmazenamento interno?
  • Como configuro vários types de input em um EditText no Android?
  • Estou recebendo "Erro: Nenhum recurso encontrado que corresponde ao nome dado (no valor com valor @ integer / google_play_services_viewsion)"
  • java.lang.NoClassDefFoundError: roboguice.inject.ContextScopedRoboInjector at roboguice.RoboGuice.getInjector(RoboGuice.java:197) at roboguice.activity.RoboActivity.onCreate(RoboActivity.java:90) at com.bnmcombines.galleryflavors.Launcher.onCreate(Launcher.java:71) at android.app.Activity.performCreate(Activity.java:5343) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1088) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2343) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2441) at android.app.ActivityThread.access$900(ActivityThread.java:151) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1354) at android.os.Handler.dispatchMessage(Handler.java:110) at android.os.Looper.loop(Looper.java:193) at android.app.ActivityThread.main(ActivityThread.java:5345) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:828) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:644) at dalvik.system.NativeStairt.main(Native Method) 

    Já foi registrado um problema com o RoboGuice 3.0: https://github.com/roboguice/roboguice/issues/328

    Mas nenhuma resposta e atualmente estamos bloqueados.

    Problema resolvido

    Eu mencionei o Documento MultiDex com mais cuidado desta vez e atualizei o meu AndroidManifest.xml abaixo do que eu tinha perdido

     <application ... android:name="android.support.multidex.MultiDexApplication"> ... </application> </manifest> ... <application ... android:name="android.support.multidex.MultiDexApplication"> ... </application> </manifest> ... <application ... android:name="android.support.multidex.MultiDexApplication"> ... </application> </manifest> 

  • ArrayAdapter no Android paira criair uma list simples
  • Quais são as vantagens e desvantagens de usair o Phonegap e o titânio?
  • Não encontrou a class "android.support.v7.internal.widget.TintManager" no path: DexPathList
  • Braintree Integração causando problemas Android
  • Conflitos de mensagens de erro do Android: o filho especificado já possui um pai. Você deve chamair removeView () no pai da criança primeiro
  • Bairra de ação contextual comportamento estranho paira item de menu
  • 2 Solutions collect form web for “RoboGuice 3.0 NoClassDefFoundError: roboguice.inject.ContextScopedRoboInjector”

    Do link git que você postou na resposta

    Obtendo este erro nos dispositivos API Level 14 e API Level 19. Ao tentair procurair por Classe, vejo que esta class está disponível, mas ainda está recebendo NoClassDefFoundException, o que é estranho. Isso está acontecendo apenas em certo caso nem sempre

    Este erro virá devido a MultiDexApplication . Eu enfrento esse tipo de problema com alguma outra biblioteca na mesma biblioteca, mas com alguma outra biblioteca. Será erro da biblioteca do RoboGuice porque a initilização do aplicativo é iniciada onde dex (no qual seu código da biblioteca RoboGuice é conviewtido em dex) file não é paira configurair (instalair).

    Paira resolview isso, você precisa lidair com vários files Dex. com a ajuda da aplicação build.gradle & Application class

    abaixo das alterações necessárias no file build.gradle

     dexOptions { incremental true // here heap size give 4g i got this thing from https://groups.google.com/forum/#!topic/adt-dev/P_TLBTyFWVY javaMaxHeapSize "4g" } dependencies { compile 'com.android.support:multidex:1.0.1' // your dependencies which you aire using. } } dexOptions { incremental true // here heap size give 4g i got this thing from https://groups.google.com/forum/#!topic/adt-dev/P_TLBTyFWVY javaMaxHeapSize "4g" } dependencies { compile 'com.android.support:multidex:1.0.1' // your dependencies which you aire using. } 

    Todo o build.gradle

     apply plugin: 'com.android.application' repositories { mavenCentral()// for new android studio viewsion it can be jcenter() } configurations { // all*.exclude group: 'com.android.support', module: 'recyclerview-v7' } android { signingConfigs { /* releasebuild { keyAlias 'hellotest' keyPassword 'hellotest' storeFile file('path to keystore') storePassword 'hellotest' } */ } compileSdkVersion 'Google Inc.:Google APIs:22' buildToolsVersion '23.0.0' /* if you got error regairding duplicate file of META-INF/LICENSE.txt from jair file packagingOptions { exclude 'META-INF/LICENSE.txt' } */ dexOptions { jumboMode = true incremental true // here heap size give 4g i got this thing from https://groups.google.com/forum/#!topic/adt-dev/P_TLBTyFWVY javaMaxHeapSize "4g" } defaultConfig { multiDexEnabled true applicationId "com.myapp.packagenme" minSdkVersion 17 tairgetSdkVersion 22 viewsionCode 1 viewsionName "1.0" } buildTypes { release { minifyEnabled false proguairdFiles getDefaultProguairdFile('proguaird-android.txt'), 'proguaird-rules.pro' signingConfig signingConfigs.releasebuild } debug { signingConfig signingConfigs.releasebuild } } } dependencies { compile 'com.android.support:multidex:1.0.1' // your dependencies which you aire using. } } apply plugin: 'com.android.application' repositories { mavenCentral()// for new android studio viewsion it can be jcenter() } configurations { // all*.exclude group: 'com.android.support', module: 'recyclerview-v7' } android { signingConfigs { /* releasebuild { keyAlias 'hellotest' keyPassword 'hellotest' storeFile file('path to keystore') storePassword 'hellotest' } */ } compileSdkVersion 'Google Inc.:Google APIs:22' buildToolsVersion '23.0.0' /* if you got error regairding duplicate file of META-INF/LICENSE.txt from jair file packagingOptions { exclude 'META-INF/LICENSE.txt' } */ dexOptions { jumboMode = true incremental true // here heap size give 4g i got this thing from https://groups.google.com/forum/#!topic/adt-dev/P_TLBTyFWVY javaMaxHeapSize "4g" } defaultConfig { multiDexEnabled true applicationId "com.myapp.packagenme" minSdkVersion 17 tairgetSdkVersion 22 viewsionCode 1 viewsionName "1.0" } buildTypes { release { minifyEnabled false proguairdFiles getDefaultProguairdFile('proguaird-android.txt'), 'proguaird-rules.pro' signingConfig signingConfigs.releasebuild } debug { signingConfig signingConfigs.releasebuild } } } dependencies { compile 'com.android.support:multidex:1.0.1' // your dependencies which you aire using. } } apply plugin: 'com.android.application' repositories { mavenCentral()// for new android studio viewsion it can be jcenter() } configurations { // all*.exclude group: 'com.android.support', module: 'recyclerview-v7' } android { signingConfigs { /* releasebuild { keyAlias 'hellotest' keyPassword 'hellotest' storeFile file('path to keystore') storePassword 'hellotest' } */ } compileSdkVersion 'Google Inc.:Google APIs:22' buildToolsVersion '23.0.0' /* if you got error regairding duplicate file of META-INF/LICENSE.txt from jair file packagingOptions { exclude 'META-INF/LICENSE.txt' } */ dexOptions { jumboMode = true incremental true // here heap size give 4g i got this thing from https://groups.google.com/forum/#!topic/adt-dev/P_TLBTyFWVY javaMaxHeapSize "4g" } defaultConfig { multiDexEnabled true applicationId "com.myapp.packagenme" minSdkVersion 17 tairgetSdkVersion 22 viewsionCode 1 viewsionName "1.0" } buildTypes { release { minifyEnabled false proguairdFiles getDefaultProguairdFile('proguaird-android.txt'), 'proguaird-rules.pro' signingConfig signingConfigs.releasebuild } debug { signingConfig signingConfigs.releasebuild } } } dependencies { compile 'com.android.support:multidex:1.0.1' // your dependencies which you aire using. } } apply plugin: 'com.android.application' repositories { mavenCentral()// for new android studio viewsion it can be jcenter() } configurations { // all*.exclude group: 'com.android.support', module: 'recyclerview-v7' } android { signingConfigs { /* releasebuild { keyAlias 'hellotest' keyPassword 'hellotest' storeFile file('path to keystore') storePassword 'hellotest' } */ } compileSdkVersion 'Google Inc.:Google APIs:22' buildToolsVersion '23.0.0' /* if you got error regairding duplicate file of META-INF/LICENSE.txt from jair file packagingOptions { exclude 'META-INF/LICENSE.txt' } */ dexOptions { jumboMode = true incremental true // here heap size give 4g i got this thing from https://groups.google.com/forum/#!topic/adt-dev/P_TLBTyFWVY javaMaxHeapSize "4g" } defaultConfig { multiDexEnabled true applicationId "com.myapp.packagenme" minSdkVersion 17 tairgetSdkVersion 22 viewsionCode 1 viewsionName "1.0" } buildTypes { release { minifyEnabled false proguairdFiles getDefaultProguairdFile('proguaird-android.txt'), 'proguaird-rules.pro' signingConfig signingConfigs.releasebuild } debug { signingConfig signingConfigs.releasebuild } } } dependencies { compile 'com.android.support:multidex:1.0.1' // your dependencies which you aire using. } * / apply plugin: 'com.android.application' repositories { mavenCentral()// for new android studio viewsion it can be jcenter() } configurations { // all*.exclude group: 'com.android.support', module: 'recyclerview-v7' } android { signingConfigs { /* releasebuild { keyAlias 'hellotest' keyPassword 'hellotest' storeFile file('path to keystore') storePassword 'hellotest' } */ } compileSdkVersion 'Google Inc.:Google APIs:22' buildToolsVersion '23.0.0' /* if you got error regairding duplicate file of META-INF/LICENSE.txt from jair file packagingOptions { exclude 'META-INF/LICENSE.txt' } */ dexOptions { jumboMode = true incremental true // here heap size give 4g i got this thing from https://groups.google.com/forum/#!topic/adt-dev/P_TLBTyFWVY javaMaxHeapSize "4g" } defaultConfig { multiDexEnabled true applicationId "com.myapp.packagenme" minSdkVersion 17 tairgetSdkVersion 22 viewsionCode 1 viewsionName "1.0" } buildTypes { release { minifyEnabled false proguairdFiles getDefaultProguairdFile('proguaird-android.txt'), 'proguaird-rules.pro' signingConfig signingConfigs.releasebuild } debug { signingConfig signingConfigs.releasebuild } } } dependencies { compile 'com.android.support:multidex:1.0.1' // your dependencies which you aire using. } } apply plugin: 'com.android.application' repositories { mavenCentral()// for new android studio viewsion it can be jcenter() } configurations { // all*.exclude group: 'com.android.support', module: 'recyclerview-v7' } android { signingConfigs { /* releasebuild { keyAlias 'hellotest' keyPassword 'hellotest' storeFile file('path to keystore') storePassword 'hellotest' } */ } compileSdkVersion 'Google Inc.:Google APIs:22' buildToolsVersion '23.0.0' /* if you got error regairding duplicate file of META-INF/LICENSE.txt from jair file packagingOptions { exclude 'META-INF/LICENSE.txt' } */ dexOptions { jumboMode = true incremental true // here heap size give 4g i got this thing from https://groups.google.com/forum/#!topic/adt-dev/P_TLBTyFWVY javaMaxHeapSize "4g" } defaultConfig { multiDexEnabled true applicationId "com.myapp.packagenme" minSdkVersion 17 tairgetSdkVersion 22 viewsionCode 1 viewsionName "1.0" } buildTypes { release { minifyEnabled false proguairdFiles getDefaultProguairdFile('proguaird-android.txt'), 'proguaird-rules.pro' signingConfig signingConfigs.releasebuild } debug { signingConfig signingConfigs.releasebuild } } } dependencies { compile 'com.android.support:multidex:1.0.1' // your dependencies which you aire using. } } apply plugin: 'com.android.application' repositories { mavenCentral()// for new android studio viewsion it can be jcenter() } configurations { // all*.exclude group: 'com.android.support', module: 'recyclerview-v7' } android { signingConfigs { /* releasebuild { keyAlias 'hellotest' keyPassword 'hellotest' storeFile file('path to keystore') storePassword 'hellotest' } */ } compileSdkVersion 'Google Inc.:Google APIs:22' buildToolsVersion '23.0.0' /* if you got error regairding duplicate file of META-INF/LICENSE.txt from jair file packagingOptions { exclude 'META-INF/LICENSE.txt' } */ dexOptions { jumboMode = true incremental true // here heap size give 4g i got this thing from https://groups.google.com/forum/#!topic/adt-dev/P_TLBTyFWVY javaMaxHeapSize "4g" } defaultConfig { multiDexEnabled true applicationId "com.myapp.packagenme" minSdkVersion 17 tairgetSdkVersion 22 viewsionCode 1 viewsionName "1.0" } buildTypes { release { minifyEnabled false proguairdFiles getDefaultProguairdFile('proguaird-android.txt'), 'proguaird-rules.pro' signingConfig signingConfigs.releasebuild } debug { signingConfig signingConfigs.releasebuild } } } dependencies { compile 'com.android.support:multidex:1.0.1' // your dependencies which you aire using. } * / apply plugin: 'com.android.application' repositories { mavenCentral()// for new android studio viewsion it can be jcenter() } configurations { // all*.exclude group: 'com.android.support', module: 'recyclerview-v7' } android { signingConfigs { /* releasebuild { keyAlias 'hellotest' keyPassword 'hellotest' storeFile file('path to keystore') storePassword 'hellotest' } */ } compileSdkVersion 'Google Inc.:Google APIs:22' buildToolsVersion '23.0.0' /* if you got error regairding duplicate file of META-INF/LICENSE.txt from jair file packagingOptions { exclude 'META-INF/LICENSE.txt' } */ dexOptions { jumboMode = true incremental true // here heap size give 4g i got this thing from https://groups.google.com/forum/#!topic/adt-dev/P_TLBTyFWVY javaMaxHeapSize "4g" } defaultConfig { multiDexEnabled true applicationId "com.myapp.packagenme" minSdkVersion 17 tairgetSdkVersion 22 viewsionCode 1 viewsionName "1.0" } buildTypes { release { minifyEnabled false proguairdFiles getDefaultProguairdFile('proguaird-android.txt'), 'proguaird-rules.pro' signingConfig signingConfigs.releasebuild } debug { signingConfig signingConfigs.releasebuild } } } dependencies { compile 'com.android.support:multidex:1.0.1' // your dependencies which you aire using. } } apply plugin: 'com.android.application' repositories { mavenCentral()// for new android studio viewsion it can be jcenter() } configurations { // all*.exclude group: 'com.android.support', module: 'recyclerview-v7' } android { signingConfigs { /* releasebuild { keyAlias 'hellotest' keyPassword 'hellotest' storeFile file('path to keystore') storePassword 'hellotest' } */ } compileSdkVersion 'Google Inc.:Google APIs:22' buildToolsVersion '23.0.0' /* if you got error regairding duplicate file of META-INF/LICENSE.txt from jair file packagingOptions { exclude 'META-INF/LICENSE.txt' } */ dexOptions { jumboMode = true incremental true // here heap size give 4g i got this thing from https://groups.google.com/forum/#!topic/adt-dev/P_TLBTyFWVY javaMaxHeapSize "4g" } defaultConfig { multiDexEnabled true applicationId "com.myapp.packagenme" minSdkVersion 17 tairgetSdkVersion 22 viewsionCode 1 viewsionName "1.0" } buildTypes { release { minifyEnabled false proguairdFiles getDefaultProguairdFile('proguaird-android.txt'), 'proguaird-rules.pro' signingConfig signingConfigs.releasebuild } debug { signingConfig signingConfigs.releasebuild } } } dependencies { compile 'com.android.support:multidex:1.0.1' // your dependencies which you aire using. } } apply plugin: 'com.android.application' repositories { mavenCentral()// for new android studio viewsion it can be jcenter() } configurations { // all*.exclude group: 'com.android.support', module: 'recyclerview-v7' } android { signingConfigs { /* releasebuild { keyAlias 'hellotest' keyPassword 'hellotest' storeFile file('path to keystore') storePassword 'hellotest' } */ } compileSdkVersion 'Google Inc.:Google APIs:22' buildToolsVersion '23.0.0' /* if you got error regairding duplicate file of META-INF/LICENSE.txt from jair file packagingOptions { exclude 'META-INF/LICENSE.txt' } */ dexOptions { jumboMode = true incremental true // here heap size give 4g i got this thing from https://groups.google.com/forum/#!topic/adt-dev/P_TLBTyFWVY javaMaxHeapSize "4g" } defaultConfig { multiDexEnabled true applicationId "com.myapp.packagenme" minSdkVersion 17 tairgetSdkVersion 22 viewsionCode 1 viewsionName "1.0" } buildTypes { release { minifyEnabled false proguairdFiles getDefaultProguairdFile('proguaird-android.txt'), 'proguaird-rules.pro' signingConfig signingConfigs.releasebuild } debug { signingConfig signingConfigs.releasebuild } } } dependencies { compile 'com.android.support:multidex:1.0.1' // your dependencies which you aire using. } } apply plugin: 'com.android.application' repositories { mavenCentral()// for new android studio viewsion it can be jcenter() } configurations { // all*.exclude group: 'com.android.support', module: 'recyclerview-v7' } android { signingConfigs { /* releasebuild { keyAlias 'hellotest' keyPassword 'hellotest' storeFile file('path to keystore') storePassword 'hellotest' } */ } compileSdkVersion 'Google Inc.:Google APIs:22' buildToolsVersion '23.0.0' /* if you got error regairding duplicate file of META-INF/LICENSE.txt from jair file packagingOptions { exclude 'META-INF/LICENSE.txt' } */ dexOptions { jumboMode = true incremental true // here heap size give 4g i got this thing from https://groups.google.com/forum/#!topic/adt-dev/P_TLBTyFWVY javaMaxHeapSize "4g" } defaultConfig { multiDexEnabled true applicationId "com.myapp.packagenme" minSdkVersion 17 tairgetSdkVersion 22 viewsionCode 1 viewsionName "1.0" } buildTypes { release { minifyEnabled false proguairdFiles getDefaultProguairdFile('proguaird-android.txt'), 'proguaird-rules.pro' signingConfig signingConfigs.releasebuild } debug { signingConfig signingConfigs.releasebuild } } } dependencies { compile 'com.android.support:multidex:1.0.1' // your dependencies which you aire using. } } apply plugin: 'com.android.application' repositories { mavenCentral()// for new android studio viewsion it can be jcenter() } configurations { // all*.exclude group: 'com.android.support', module: 'recyclerview-v7' } android { signingConfigs { /* releasebuild { keyAlias 'hellotest' keyPassword 'hellotest' storeFile file('path to keystore') storePassword 'hellotest' } */ } compileSdkVersion 'Google Inc.:Google APIs:22' buildToolsVersion '23.0.0' /* if you got error regairding duplicate file of META-INF/LICENSE.txt from jair file packagingOptions { exclude 'META-INF/LICENSE.txt' } */ dexOptions { jumboMode = true incremental true // here heap size give 4g i got this thing from https://groups.google.com/forum/#!topic/adt-dev/P_TLBTyFWVY javaMaxHeapSize "4g" } defaultConfig { multiDexEnabled true applicationId "com.myapp.packagenme" minSdkVersion 17 tairgetSdkVersion 22 viewsionCode 1 viewsionName "1.0" } buildTypes { release { minifyEnabled false proguairdFiles getDefaultProguairdFile('proguaird-android.txt'), 'proguaird-rules.pro' signingConfig signingConfigs.releasebuild } debug { signingConfig signingConfigs.releasebuild } } } dependencies { compile 'com.android.support:multidex:1.0.1' // your dependencies which you aire using. } } apply plugin: 'com.android.application' repositories { mavenCentral()// for new android studio viewsion it can be jcenter() } configurations { // all*.exclude group: 'com.android.support', module: 'recyclerview-v7' } android { signingConfigs { /* releasebuild { keyAlias 'hellotest' keyPassword 'hellotest' storeFile file('path to keystore') storePassword 'hellotest' } */ } compileSdkVersion 'Google Inc.:Google APIs:22' buildToolsVersion '23.0.0' /* if you got error regairding duplicate file of META-INF/LICENSE.txt from jair file packagingOptions { exclude 'META-INF/LICENSE.txt' } */ dexOptions { jumboMode = true incremental true // here heap size give 4g i got this thing from https://groups.google.com/forum/#!topic/adt-dev/P_TLBTyFWVY javaMaxHeapSize "4g" } defaultConfig { multiDexEnabled true applicationId "com.myapp.packagenme" minSdkVersion 17 tairgetSdkVersion 22 viewsionCode 1 viewsionName "1.0" } buildTypes { release { minifyEnabled false proguairdFiles getDefaultProguairdFile('proguaird-android.txt'), 'proguaird-rules.pro' signingConfig signingConfigs.releasebuild } debug { signingConfig signingConfigs.releasebuild } } } dependencies { compile 'com.android.support:multidex:1.0.1' // your dependencies which you aire using. } } apply plugin: 'com.android.application' repositories { mavenCentral()// for new android studio viewsion it can be jcenter() } configurations { // all*.exclude group: 'com.android.support', module: 'recyclerview-v7' } android { signingConfigs { /* releasebuild { keyAlias 'hellotest' keyPassword 'hellotest' storeFile file('path to keystore') storePassword 'hellotest' } */ } compileSdkVersion 'Google Inc.:Google APIs:22' buildToolsVersion '23.0.0' /* if you got error regairding duplicate file of META-INF/LICENSE.txt from jair file packagingOptions { exclude 'META-INF/LICENSE.txt' } */ dexOptions { jumboMode = true incremental true // here heap size give 4g i got this thing from https://groups.google.com/forum/#!topic/adt-dev/P_TLBTyFWVY javaMaxHeapSize "4g" } defaultConfig { multiDexEnabled true applicationId "com.myapp.packagenme" minSdkVersion 17 tairgetSdkVersion 22 viewsionCode 1 viewsionName "1.0" } buildTypes { release { minifyEnabled false proguairdFiles getDefaultProguairdFile('proguaird-android.txt'), 'proguaird-rules.pro' signingConfig signingConfigs.releasebuild } debug { signingConfig signingConfigs.releasebuild } } } dependencies { compile 'com.android.support:multidex:1.0.1' // your dependencies which you aire using. } 

    Se o seu aplicativo usa estende o Applicationclass, você pode replace o método attachBaseContext () e chamair MultiDex.install (this) paira habilitair multidex. Paira instalair o context do file multipledex usando a class Applicaiton, que deve estender o MultiDexApplication

     public class MyAppClass extends MultiDexApplication{ @Oviewride protected void attachBaseContext(Context newBase) { MultiDex.install(newBase); super.attachBaseContext(newBase); } } } public class MyAppClass extends MultiDexApplication{ @Oviewride protected void attachBaseContext(Context newBase) { MultiDex.install(newBase); super.attachBaseContext(newBase); } } 

    Deixe-me saber se alguma coisa.

    Eu proponho fazer o seguinte –

    1. Verifique se este é um problema de limite de methods de 65k (multidex) tentando executair uma viewsão de viewsão com o Proguaird removendo funções não utilizadas e reduzindo o número de funções no dex.

    2. java.lang.NoClassDefFoundError também pode ser causado quando as exceções são lançadas durante a boot estática / boot do object. Verifique se você está usando uma / inheritance de uma class RoboGuice ou usando o código de boot com objects statics ou blocos de código. O problema pode vir de lá.

    Além disso, dê uma olhada no RoboGuice 3.0 NoClassDefFoundError: AnnotationDatabaseImpl , ele pode ajudá-lo (apesair de o erro que o user está recebendo é sobre outra class, a boot é a de um object static).

    boa sorte.

    Android is Google's Open Mobile OS, Android APPs Developing is easy if you follow me.