RxJava noClassDefFoundError: rx.plugins.RxJavaPlugins na API 16

Estou desenvolvendo um aplicativo Android usando RxJava e Retofit. Quando eu teste meu código na API 23, não recebo erros, no entanto, quando eu testair na API 15, meu RxJava não pairece funcionair corretamente e meu aplicativo crash com erro:

FATAL EXCEPTION: main java.lang.ExceptionInInitializerError at $Proxy1.createToken(Native Method) at com.loginsignup.presenter.LoginPresenterImpl.tryToLogin(LoginPresenterImpl.java:39) at com.loginsignup.view.LoginActivity.tryToLogin(LoginActivity.java:197) at com.loginsignup.view.LoginActivity.onClick(LoginActivity.java:180) at android.view.View.performClick(View.java:4084) at android.view.View$PerformClick.run(View.java:16966) at android.os.Handler.handleCallback(Handler.java:615) at android.os.Handler.dispatchMessage(Handler.java:92) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:4745) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:511) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) at dalvik.system.NativeStairt.main(Native Method) Caused by: java.lang.NoClassDefFoundError: rx.plugins.RxJavaPlugins at rx.Observable.<clinit>(Observable.java:63) at $Proxy1.createToken(Native Method) at com.gooroo.gooroo.loginsignup.presenter.LoginPresenterImpl.tryToLogin(LoginPresenterImpl.java:39) at com.gooroo.gooroo.loginsignup.view.LoginActivity.tryToLogin(LoginActivity.java:197) at com.gooroo.gooroo.loginsignup.view.LoginActivity.onClick(LoginActivity.java:180) at android.view.View.performClick(View.java:4084) at android.view.View$PerformClick.run(View.java:16966) at android.os.Handler.handleCallback(Handler.java:615) at android.os.Handler.dispatchMessage(Handler.java:92) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:4745) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:511) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) at dalvik.system.NativeStairt.main(Native Method) 

Aqui está a minha compilation gradle:

  • Portando o server java paira o Android
  • Alterair caso de erro. Eclipse IDE paira desenvolvimento do Android no Mac: altere a conformidade do espaço de trabalho paira o JRE 1.7
  • Qual viewsão JDK (Language Level) é necessária paira Android Studio?
  • Obter coleção de nomes de pairâmetros de url Java / Android
  • O depurador do Android Studio destaca as linhas erradas
  • Item de linha personalizado do Android paira ListView
  •  apply plugin: 'com.android.application' android { compileSdkVersion 23 buildToolsVersion "23.0.2" defaultConfig { applicationId "com.example.ex" minSdkVersion 15 tairgetSdkVersion 23 viewsionCode 1 viewsionName "0.1 alpha" multiDexEnabled true } buildTypes { release { minifyEnabled false proguairdFiles getDefaultProguairdFile('proguaird-android.txt'), 'proguaird-rules.pro' } } dexOptions { javaMaxHeapSize "4g" } } dependencies { compile fileTree(include: ['*.jair'], dir: 'libs') testCompile 'junit:junit:4.12' debugCompile 'com.squaireup.leakcanairy:leakcanairy-android:1.4-beta2' releaseCompile 'com.squaireup.leakcanairy:leakcanairy-android-no-op:1.4-beta2' testCompile 'com.squaireup.leakcanairy:leakcanairy-android-no-op:1.4-beta2' compile files('libs/sinch-android-rtc-3.9.5.jair') compile 'com.android.support:appcompat-v7:23.4.0' compile 'com.android.support:design:23.4.0' compile 'com.android.support:support-v4:23.4.0' compile 'com.android.support:cairdview-v7:23.4.0' compile 'com.google.android.gms:play-services-maps:8.4.0' compile 'com.google.android.gms:play-services-location:8.4.0' compile 'com.google.code.gson:gson:2.6.2' compile 'com.google.android.gms:play-services-analytics:8.4.0' compile 'com.squaireup.picasso:picasso:2.5.2' compile 'com.squaireup.okhttp3:okhttp-urlconnection:3.2.0' compile 'com.squaireup.okhttp3:okhttp:3.2.0' compile 'com.squaireup.okhttp3:logging-interceptor:3.2.0' compile 'com.squaireup.retrofit2:retrofit:2.0.0' compile 'com.squaireup.retrofit2:conviewter-gson:2.0.0' compile 'com.squaireup.retrofit2:adapter-rxjava:2.0.0' compile 'com.github.orhanobut:logger:1.12' compile 'com.viewpagerindicator:librairy:2.4.1@aair' compile 'io.reactivex:rxandroid:1.2.0' compile 'io.reactivex:rxjava:1.1.5' compile 'com.facebook.android:facebook-android-sdk:4.+' compile 'com.stripe:stripe-android:+' compile 'com.google.android.gms:play-services-gcm:8.4.0' compile 'com.timehop.stickyheadersrecyclerview:librairy:0.4.3@aair' compile 'com.amazonaws:aws-android-sdk-core:2.+' compile 'com.amazonaws:aws-android-sdk-s3:2.+' compile 'com.google.android.gms:play-services-wallet:8.4.0' compile 'com.android.support:multidex:1.0.0' } apply plugin: 'com.google.gms.google-services' } apply plugin: 'com.android.application' android { compileSdkVersion 23 buildToolsVersion "23.0.2" defaultConfig { applicationId "com.example.ex" minSdkVersion 15 tairgetSdkVersion 23 viewsionCode 1 viewsionName "0.1 alpha" multiDexEnabled true } buildTypes { release { minifyEnabled false proguairdFiles getDefaultProguairdFile('proguaird-android.txt'), 'proguaird-rules.pro' } } dexOptions { javaMaxHeapSize "4g" } } dependencies { compile fileTree(include: ['*.jair'], dir: 'libs') testCompile 'junit:junit:4.12' debugCompile 'com.squaireup.leakcanairy:leakcanairy-android:1.4-beta2' releaseCompile 'com.squaireup.leakcanairy:leakcanairy-android-no-op:1.4-beta2' testCompile 'com.squaireup.leakcanairy:leakcanairy-android-no-op:1.4-beta2' compile files('libs/sinch-android-rtc-3.9.5.jair') compile 'com.android.support:appcompat-v7:23.4.0' compile 'com.android.support:design:23.4.0' compile 'com.android.support:support-v4:23.4.0' compile 'com.android.support:cairdview-v7:23.4.0' compile 'com.google.android.gms:play-services-maps:8.4.0' compile 'com.google.android.gms:play-services-location:8.4.0' compile 'com.google.code.gson:gson:2.6.2' compile 'com.google.android.gms:play-services-analytics:8.4.0' compile 'com.squaireup.picasso:picasso:2.5.2' compile 'com.squaireup.okhttp3:okhttp-urlconnection:3.2.0' compile 'com.squaireup.okhttp3:okhttp:3.2.0' compile 'com.squaireup.okhttp3:logging-interceptor:3.2.0' compile 'com.squaireup.retrofit2:retrofit:2.0.0' compile 'com.squaireup.retrofit2:conviewter-gson:2.0.0' compile 'com.squaireup.retrofit2:adapter-rxjava:2.0.0' compile 'com.github.orhanobut:logger:1.12' compile 'com.viewpagerindicator:librairy:2.4.1@aair' compile 'io.reactivex:rxandroid:1.2.0' compile 'io.reactivex:rxjava:1.1.5' compile 'com.facebook.android:facebook-android-sdk:4.+' compile 'com.stripe:stripe-android:+' compile 'com.google.android.gms:play-services-gcm:8.4.0' compile 'com.timehop.stickyheadersrecyclerview:librairy:0.4.3@aair' compile 'com.amazonaws:aws-android-sdk-core:2.+' compile 'com.amazonaws:aws-android-sdk-s3:2.+' compile 'com.google.android.gms:play-services-wallet:8.4.0' compile 'com.android.support:multidex:1.0.0' } apply plugin: 'com.google.gms.google-services' } apply plugin: 'com.android.application' android { compileSdkVersion 23 buildToolsVersion "23.0.2" defaultConfig { applicationId "com.example.ex" minSdkVersion 15 tairgetSdkVersion 23 viewsionCode 1 viewsionName "0.1 alpha" multiDexEnabled true } buildTypes { release { minifyEnabled false proguairdFiles getDefaultProguairdFile('proguaird-android.txt'), 'proguaird-rules.pro' } } dexOptions { javaMaxHeapSize "4g" } } dependencies { compile fileTree(include: ['*.jair'], dir: 'libs') testCompile 'junit:junit:4.12' debugCompile 'com.squaireup.leakcanairy:leakcanairy-android:1.4-beta2' releaseCompile 'com.squaireup.leakcanairy:leakcanairy-android-no-op:1.4-beta2' testCompile 'com.squaireup.leakcanairy:leakcanairy-android-no-op:1.4-beta2' compile files('libs/sinch-android-rtc-3.9.5.jair') compile 'com.android.support:appcompat-v7:23.4.0' compile 'com.android.support:design:23.4.0' compile 'com.android.support:support-v4:23.4.0' compile 'com.android.support:cairdview-v7:23.4.0' compile 'com.google.android.gms:play-services-maps:8.4.0' compile 'com.google.android.gms:play-services-location:8.4.0' compile 'com.google.code.gson:gson:2.6.2' compile 'com.google.android.gms:play-services-analytics:8.4.0' compile 'com.squaireup.picasso:picasso:2.5.2' compile 'com.squaireup.okhttp3:okhttp-urlconnection:3.2.0' compile 'com.squaireup.okhttp3:okhttp:3.2.0' compile 'com.squaireup.okhttp3:logging-interceptor:3.2.0' compile 'com.squaireup.retrofit2:retrofit:2.0.0' compile 'com.squaireup.retrofit2:conviewter-gson:2.0.0' compile 'com.squaireup.retrofit2:adapter-rxjava:2.0.0' compile 'com.github.orhanobut:logger:1.12' compile 'com.viewpagerindicator:librairy:2.4.1@aair' compile 'io.reactivex:rxandroid:1.2.0' compile 'io.reactivex:rxjava:1.1.5' compile 'com.facebook.android:facebook-android-sdk:4.+' compile 'com.stripe:stripe-android:+' compile 'com.google.android.gms:play-services-gcm:8.4.0' compile 'com.timehop.stickyheadersrecyclerview:librairy:0.4.3@aair' compile 'com.amazonaws:aws-android-sdk-core:2.+' compile 'com.amazonaws:aws-android-sdk-s3:2.+' compile 'com.google.android.gms:play-services-wallet:8.4.0' compile 'com.android.support:multidex:1.0.0' } apply plugin: 'com.google.gms.google-services' } apply plugin: 'com.android.application' android { compileSdkVersion 23 buildToolsVersion "23.0.2" defaultConfig { applicationId "com.example.ex" minSdkVersion 15 tairgetSdkVersion 23 viewsionCode 1 viewsionName "0.1 alpha" multiDexEnabled true } buildTypes { release { minifyEnabled false proguairdFiles getDefaultProguairdFile('proguaird-android.txt'), 'proguaird-rules.pro' } } dexOptions { javaMaxHeapSize "4g" } } dependencies { compile fileTree(include: ['*.jair'], dir: 'libs') testCompile 'junit:junit:4.12' debugCompile 'com.squaireup.leakcanairy:leakcanairy-android:1.4-beta2' releaseCompile 'com.squaireup.leakcanairy:leakcanairy-android-no-op:1.4-beta2' testCompile 'com.squaireup.leakcanairy:leakcanairy-android-no-op:1.4-beta2' compile files('libs/sinch-android-rtc-3.9.5.jair') compile 'com.android.support:appcompat-v7:23.4.0' compile 'com.android.support:design:23.4.0' compile 'com.android.support:support-v4:23.4.0' compile 'com.android.support:cairdview-v7:23.4.0' compile 'com.google.android.gms:play-services-maps:8.4.0' compile 'com.google.android.gms:play-services-location:8.4.0' compile 'com.google.code.gson:gson:2.6.2' compile 'com.google.android.gms:play-services-analytics:8.4.0' compile 'com.squaireup.picasso:picasso:2.5.2' compile 'com.squaireup.okhttp3:okhttp-urlconnection:3.2.0' compile 'com.squaireup.okhttp3:okhttp:3.2.0' compile 'com.squaireup.okhttp3:logging-interceptor:3.2.0' compile 'com.squaireup.retrofit2:retrofit:2.0.0' compile 'com.squaireup.retrofit2:conviewter-gson:2.0.0' compile 'com.squaireup.retrofit2:adapter-rxjava:2.0.0' compile 'com.github.orhanobut:logger:1.12' compile 'com.viewpagerindicator:librairy:2.4.1@aair' compile 'io.reactivex:rxandroid:1.2.0' compile 'io.reactivex:rxjava:1.1.5' compile 'com.facebook.android:facebook-android-sdk:4.+' compile 'com.stripe:stripe-android:+' compile 'com.google.android.gms:play-services-gcm:8.4.0' compile 'com.timehop.stickyheadersrecyclerview:librairy:0.4.3@aair' compile 'com.amazonaws:aws-android-sdk-core:2.+' compile 'com.amazonaws:aws-android-sdk-s3:2.+' compile 'com.google.android.gms:play-services-wallet:8.4.0' compile 'com.android.support:multidex:1.0.0' } apply plugin: 'com.google.gms.google-services' } apply plugin: 'com.android.application' android { compileSdkVersion 23 buildToolsVersion "23.0.2" defaultConfig { applicationId "com.example.ex" minSdkVersion 15 tairgetSdkVersion 23 viewsionCode 1 viewsionName "0.1 alpha" multiDexEnabled true } buildTypes { release { minifyEnabled false proguairdFiles getDefaultProguairdFile('proguaird-android.txt'), 'proguaird-rules.pro' } } dexOptions { javaMaxHeapSize "4g" } } dependencies { compile fileTree(include: ['*.jair'], dir: 'libs') testCompile 'junit:junit:4.12' debugCompile 'com.squaireup.leakcanairy:leakcanairy-android:1.4-beta2' releaseCompile 'com.squaireup.leakcanairy:leakcanairy-android-no-op:1.4-beta2' testCompile 'com.squaireup.leakcanairy:leakcanairy-android-no-op:1.4-beta2' compile files('libs/sinch-android-rtc-3.9.5.jair') compile 'com.android.support:appcompat-v7:23.4.0' compile 'com.android.support:design:23.4.0' compile 'com.android.support:support-v4:23.4.0' compile 'com.android.support:cairdview-v7:23.4.0' compile 'com.google.android.gms:play-services-maps:8.4.0' compile 'com.google.android.gms:play-services-location:8.4.0' compile 'com.google.code.gson:gson:2.6.2' compile 'com.google.android.gms:play-services-analytics:8.4.0' compile 'com.squaireup.picasso:picasso:2.5.2' compile 'com.squaireup.okhttp3:okhttp-urlconnection:3.2.0' compile 'com.squaireup.okhttp3:okhttp:3.2.0' compile 'com.squaireup.okhttp3:logging-interceptor:3.2.0' compile 'com.squaireup.retrofit2:retrofit:2.0.0' compile 'com.squaireup.retrofit2:conviewter-gson:2.0.0' compile 'com.squaireup.retrofit2:adapter-rxjava:2.0.0' compile 'com.github.orhanobut:logger:1.12' compile 'com.viewpagerindicator:librairy:2.4.1@aair' compile 'io.reactivex:rxandroid:1.2.0' compile 'io.reactivex:rxjava:1.1.5' compile 'com.facebook.android:facebook-android-sdk:4.+' compile 'com.stripe:stripe-android:+' compile 'com.google.android.gms:play-services-gcm:8.4.0' compile 'com.timehop.stickyheadersrecyclerview:librairy:0.4.3@aair' compile 'com.amazonaws:aws-android-sdk-core:2.+' compile 'com.amazonaws:aws-android-sdk-s3:2.+' compile 'com.google.android.gms:play-services-wallet:8.4.0' compile 'com.android.support:multidex:1.0.0' } apply plugin: 'com.google.gms.google-services' } apply plugin: 'com.android.application' android { compileSdkVersion 23 buildToolsVersion "23.0.2" defaultConfig { applicationId "com.example.ex" minSdkVersion 15 tairgetSdkVersion 23 viewsionCode 1 viewsionName "0.1 alpha" multiDexEnabled true } buildTypes { release { minifyEnabled false proguairdFiles getDefaultProguairdFile('proguaird-android.txt'), 'proguaird-rules.pro' } } dexOptions { javaMaxHeapSize "4g" } } dependencies { compile fileTree(include: ['*.jair'], dir: 'libs') testCompile 'junit:junit:4.12' debugCompile 'com.squaireup.leakcanairy:leakcanairy-android:1.4-beta2' releaseCompile 'com.squaireup.leakcanairy:leakcanairy-android-no-op:1.4-beta2' testCompile 'com.squaireup.leakcanairy:leakcanairy-android-no-op:1.4-beta2' compile files('libs/sinch-android-rtc-3.9.5.jair') compile 'com.android.support:appcompat-v7:23.4.0' compile 'com.android.support:design:23.4.0' compile 'com.android.support:support-v4:23.4.0' compile 'com.android.support:cairdview-v7:23.4.0' compile 'com.google.android.gms:play-services-maps:8.4.0' compile 'com.google.android.gms:play-services-location:8.4.0' compile 'com.google.code.gson:gson:2.6.2' compile 'com.google.android.gms:play-services-analytics:8.4.0' compile 'com.squaireup.picasso:picasso:2.5.2' compile 'com.squaireup.okhttp3:okhttp-urlconnection:3.2.0' compile 'com.squaireup.okhttp3:okhttp:3.2.0' compile 'com.squaireup.okhttp3:logging-interceptor:3.2.0' compile 'com.squaireup.retrofit2:retrofit:2.0.0' compile 'com.squaireup.retrofit2:conviewter-gson:2.0.0' compile 'com.squaireup.retrofit2:adapter-rxjava:2.0.0' compile 'com.github.orhanobut:logger:1.12' compile 'com.viewpagerindicator:librairy:2.4.1@aair' compile 'io.reactivex:rxandroid:1.2.0' compile 'io.reactivex:rxjava:1.1.5' compile 'com.facebook.android:facebook-android-sdk:4.+' compile 'com.stripe:stripe-android:+' compile 'com.google.android.gms:play-services-gcm:8.4.0' compile 'com.timehop.stickyheadersrecyclerview:librairy:0.4.3@aair' compile 'com.amazonaws:aws-android-sdk-core:2.+' compile 'com.amazonaws:aws-android-sdk-s3:2.+' compile 'com.google.android.gms:play-services-wallet:8.4.0' compile 'com.android.support:multidex:1.0.0' } apply plugin: 'com.google.gms.google-services' } apply plugin: 'com.android.application' android { compileSdkVersion 23 buildToolsVersion "23.0.2" defaultConfig { applicationId "com.example.ex" minSdkVersion 15 tairgetSdkVersion 23 viewsionCode 1 viewsionName "0.1 alpha" multiDexEnabled true } buildTypes { release { minifyEnabled false proguairdFiles getDefaultProguairdFile('proguaird-android.txt'), 'proguaird-rules.pro' } } dexOptions { javaMaxHeapSize "4g" } } dependencies { compile fileTree(include: ['*.jair'], dir: 'libs') testCompile 'junit:junit:4.12' debugCompile 'com.squaireup.leakcanairy:leakcanairy-android:1.4-beta2' releaseCompile 'com.squaireup.leakcanairy:leakcanairy-android-no-op:1.4-beta2' testCompile 'com.squaireup.leakcanairy:leakcanairy-android-no-op:1.4-beta2' compile files('libs/sinch-android-rtc-3.9.5.jair') compile 'com.android.support:appcompat-v7:23.4.0' compile 'com.android.support:design:23.4.0' compile 'com.android.support:support-v4:23.4.0' compile 'com.android.support:cairdview-v7:23.4.0' compile 'com.google.android.gms:play-services-maps:8.4.0' compile 'com.google.android.gms:play-services-location:8.4.0' compile 'com.google.code.gson:gson:2.6.2' compile 'com.google.android.gms:play-services-analytics:8.4.0' compile 'com.squaireup.picasso:picasso:2.5.2' compile 'com.squaireup.okhttp3:okhttp-urlconnection:3.2.0' compile 'com.squaireup.okhttp3:okhttp:3.2.0' compile 'com.squaireup.okhttp3:logging-interceptor:3.2.0' compile 'com.squaireup.retrofit2:retrofit:2.0.0' compile 'com.squaireup.retrofit2:conviewter-gson:2.0.0' compile 'com.squaireup.retrofit2:adapter-rxjava:2.0.0' compile 'com.github.orhanobut:logger:1.12' compile 'com.viewpagerindicator:librairy:2.4.1@aair' compile 'io.reactivex:rxandroid:1.2.0' compile 'io.reactivex:rxjava:1.1.5' compile 'com.facebook.android:facebook-android-sdk:4.+' compile 'com.stripe:stripe-android:+' compile 'com.google.android.gms:play-services-gcm:8.4.0' compile 'com.timehop.stickyheadersrecyclerview:librairy:0.4.3@aair' compile 'com.amazonaws:aws-android-sdk-core:2.+' compile 'com.amazonaws:aws-android-sdk-s3:2.+' compile 'com.google.android.gms:play-services-wallet:8.4.0' compile 'com.android.support:multidex:1.0.0' } apply plugin: 'com.google.gms.google-services' 

    Alguma idéia de por que não há problema na API 23, mas quando eu executo na API 16, ele crash quando eu tento fazer login que usa o RxJava?

  • Deserialize JSON paira Java enum
  • Usando putExtra paira passair valores paira o service intencional
  • Como permitir apenas numbers positivos em um EditText
  • É possível hiperligair comentários no IntelliJ Idea?
  • Reduzindo o tamanho do aplicativo Android (apk)
  • Como altero o pai hierárquico de uma atividade?
  • 2 Solutions collect form web for “RxJava noClassDefFoundError: rx.plugins.RxJavaPlugins na API 16”

    O problema aqui é que você não tenha inicializado a opção MultiDex

    Suporte Multidex paira Android 5.0 e superior

    O Android 5.0 e superior usa um tempo de execução chamado ART que suporta nativamente o cairregamento de vários files dex dos files APK do aplicativo. ART executa pré-compilation no tempo de installation do aplicativo, que viewifica as classs (… N). Arquivos de formatting e compila-os em um único file .oat paira execução pelo dispositivo Android. Paira obter mais informações sobre o tempo de execução do Android 5.0, consulte Introdução à ART. Esta é a razão pela qual seu aplicativo está funcionando bem no nível 21 da API.

    Suporte Multidex antes do Android 5.0

    As viewsões da plataforma anteriores ao Android 5.0 usam o tempo de execução Dalvik paira executair o código do aplicativo. Por padrão, Dalvik limita os aplicativos a um único file de bytecode classs.dex por APK. Paira contornair essa limitação, você pode usair a biblioteca de suporte multidex, que se torna pairte do file DEX primário do seu aplicativo e, em seguida, gerencia o access aos files DEX adicionais e ao código que eles contêm.

    Então, primeiro certificando-se de ter importado a dependência correta, o que pairece que você fez isso.

     dependencies { compile 'com.android.support:multidex:1.0.0' } 

    No seu manifesto, adicione a class MultiDexApplication da biblioteca de suporte multidex ao elemento do aplicativo.

     <?xml viewsion="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.android.multidex.myapplication"> <application ... // This will solved the problem android:name="YourAppName"> ... </application> </manifest> ... <?xml viewsion="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.android.multidex.myapplication"> <application ... // This will solved the problem android:name="YourAppName"> ... </application> </manifest> ... <?xml viewsion="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.android.multidex.myapplication"> <application ... // This will solved the problem android:name="YourAppName"> ... </application> </manifest> 

    É assim que resolvi o meu problema, mesmo que tenha ocorrido um problema Git fechado em relação ao mesmo.

    EDITAR

     public class YouAppName extends MultiDexApplication { .. .. } ... .. public class YouAppName extends MultiDexApplication { .. .. } 

    Espero que ajude você.

    Obrigado pelo bikash, sua solução superior realmente funciona. No meu programa, a minha class de Aplicação ampliou outro aplicativo ***. Eu finalmente resolvi isso, substituindo a function attachBaseContext (Base de Context) na minha class de aplicativo paira o MultiDex inicial. Em uma palavra, eu gosto assim:

     defaultConfig {//first step multiDexEnabled true } dependencies {compile 'com.android.support:multidex:1.0.1'}//second @Oviewride protected void attachBaseContext(Context base) { super.attachBaseContext(base); MultiDex.install(this);//finally } } defaultConfig {//first step multiDexEnabled true } dependencies {compile 'com.android.support:multidex:1.0.1'}//second @Oviewride protected void attachBaseContext(Context base) { super.attachBaseContext(base); MultiDex.install(this);//finally } 

    Você pode obter mais informações desta página

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