2016-05-31 2 views
0

Недавно я добавил в свое приложение последнюю версию google analytics 9.0.0. Приложение работает отлично в новых андроид телефонов, но когда я попытался запустить его в более старых устройствах Android, я наткнулся на эту ошибку (и я не использую firebase аутентификации в любой части моего приложения):Добавлен FireBase analytic 9.0.0, когда я запускаю старые устройства Android, я получаю сообщение об ошибке: java.lang.NoClassDefFoundError: com.google.firebase.FirebaseOptions

05-31 11:50:33.466 5326-5326/xxxxxxxxxxxxxxx E/dalvikvm: Could not find class 'com.google.firebase.FirebaseOptions', referenced from method  com.google.firebase.FirebaseApp. 
05-31 11:50:33.476 5326-5326/xxxxxxxxxxxxxxx E/dalvikvm: Could not find class 'com.google.firebase.FirebaseApp$zzb', referenced from method com.google.firebase.FirebaseApp.zzaJ 

Ниже мой Gradle файл

buildscript { 
    repositories { 
     maven { url 'https://maven.fabric.io/public' } 
    } 

    dependencies { 
     classpath 'io.fabric.tools:gradle:1.+' 

    } 
    } 

    apply plugin: 'com.android.application' 
    apply plugin: 'io.fabric' 
    apply plugin: 'com.google.gms.google-services' 



    android { 
    compileSdkVersion 23 
    buildToolsVersion "23.0.2" 


    defaultConfig { 
     applicationId "xx.xxxxxxxxxx.xx" 
     minSdkVersion 16 
     targetSdkVersion 23 
     versionCode 4 
     versionName "1.0.3" 
     multiDexEnabled true 

    } 

    buildTypes { 

     release { 

      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
      zipAlignEnabled true 
     } 
    } 
    dexOptions { 
     javaMaxHeapSize "4g" 
    } 

    } 

    repositories { 
    mavenCentral() 
    maven { url 'https://maven.fabric.io/public' } 


    } 

    dependencies { 
    compile fileTree(include: ['*.jar'], dir: 'libs') 
    testCompile 'junit:junit:4.12' 
    compile project(':volley') 
    compile 'com.google.android.gms:play-services-analytics:9.0.0' 
    compile 'com.android.support:appcompat-v7:23.4.0' 
    compile 'fr.avianey.com.viewpagerindicator:library:[email protected]' 
    compile 'com.android.support:design:23.4.0' 
    compile 'com.facebook.android:facebook-android-sdk:4.7.0' 
    compile 'com.google.android.gms:play-services:9.0.0' 
    compile 'com.squareup.picasso:picasso:2.5.0' 
    compile 'com.baoyz.swipemenulistview:library:1.3.0' 
    compile 'com.lorentzos.swipecards:library:[email protected]' 
    compile 'com.google.android.gms:play-services-ads:9.0.0' 
    compile 'com.google.android.gms:play-services-identity:9.0.0' 
    compile 'com.google.android.gms:play-services-gcm:9.0.0' 

    compile 'com.wang.avi:library:1.0.1' 
    compile 'com.nineoldandroids:library:2.4.0' 
    compile 'de.hdodenhof:circleimageview:2.0.0' 
    compile 'com.android.support:multidex:1.0.1' 
    compile 'me.alexrs:wave-drawable:[email protected]' 
    compile 'org.apache.httpcomponents:httpclient:4.5' 
    compile 'org.apache.httpcomponents:httpmime:4.5' 
    compile 'com.github.aakira:expandable-layout:[email protected]' 

    compile('com.crashlytics.sdk.android:crashlytics:[email protected]') { 
     transitive = true; 
    } 

} 
+0

Это может помочь вам HTTP : //stackoverflow.com/questions/37360126/getting-exception-java-lang-noclassdeffounderror-com-google-firebase-firebaseop –

ответ

0
  1. Если вы еще не обновите ваш 'Google Play Services' в Revision 30 из Android SDK Manager> Дополнительно.

  2. А затем добавьте строки скомпилировать com.android.support:multidex:1.0.1 ваших зависимостей (или просто удалить multiDexEnabled true, если не требуются

  3. Добавить этот атрибут в теге приложения в манифесте: android:name="android.support.multidex.MultiDexApplication"

+0

Я пробовал 1 и 2, но все еще не работал. Для № 3, так как для Google Analyttic мы должны добавить «android: name = «AnalyticsApplication», мне не удалось добавить атрибут multidex – mrnobody

+0

try 3, он может решить вашу проблему – mdDroid