2016-05-25 2 views
0

Meine App funktionierte gut, aber wenn ich kompiliert 'com.google.android.gms:play-services von version 8.0 to 9.0 es gibt folgende Ausnahme.UncaughtException: java.lang.IncompatibleClassChangeError

E/UncaughtException: java.lang.IncompatibleClassChangeError: The method 'java.io.File android.support.v4.content.ContextCompat.getNoBackupFilesDir(android.content.Context)' was expected to be of type virtual but instead was found to be of type direct (declaration of 'com.google.android.gms.iid.zzd' appears in /data/data/com.dp.needdepartmentalstore/files/instant-run/dex/slice-com.google.android.gms-play-services-iid-9.0.0_e1052c945fd50ca8f379bb7d2402b9b1cd0dcbb4-classes.dex) 
at com.google.android.gms.iid.zzd.zzeC(Unknown Source) 
at com.google.android.gms.iid.zzd.<init>(Unknown Source) 
at com.google.android.gms.iid.zzd.<init>(Unknown Source) 
at com.google.android.gms.iid.InstanceID.zza(Unknown Source) 
at com.google.android.gms.iid.InstanceID.getInstance(Unknown Source) 
at com.google.android.gms.iid.InstanceIDListenerService.zzn(Unknown Source) 
at com.google.android.gms.iid.InstanceIDListenerService.onStartCommand(Unknown Source) 
at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3010) 
at android.app.ActivityThread.-wrap17(ActivityThread.java) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1442) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:148) 
at android.app.ActivityThread.main(ActivityThread.java:5417) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 

unten ist mein app.gradle Datei

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' 

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

apply plugin: 'com.google.gms.google-services' 

android { 
    compileSdkVersion 23 
    buildToolsVersion '23.0.3' 

    defaultConfig { 
     applicationId "com.dp.needdepartmentalstore" 
     minSdkVersion 14 
     targetSdkVersion 23 
     versionCode 26 
     versionName "5.13" 
     multiDexEnabled true 

     manifestPlaceholders = [manifestApplicationId   : "${applicationId}", 
           onesignal_app_id    : "16c778cf-8ebc-47a8-9ba8-6815f0223a0e", 
           onesignal_google_project_number: "253919422974"] 


    } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 
} 

    dependencies { 
     compile fileTree(dir: 'libs', include: ['*.jar']) 
     testCompile 'junit:junit:4.12' 
     compile('com.mikepenz:actionitembadge:[email protected]') { 
      transitive = true 
     } 
     compile('com.weiwangcn.betterspinner:library-material:1.1.0') { 
      exclude group: 'com.android.support', module: 'appcompat-v7' 
     } 
     compile project(':niceSpinner') 
     compile files('libs/PGSDK_v1.0.jar') 
     compile files('libs/App42_ANDROID_SDK_3.8.jar') 
     compile('com.crashlytics.sdk.android:crashlytics:[email protected]') { 
      transitive = true; 
     } 
     compile('com.instabug.library:instabugsupport:1+') { 
      exclude group: 'com.mcxiaoke.volley', module: 'library' 
     } 
     compile 'com.android.support:support-v4:23.4.0' 
     compile 'com.android.support:design:23.4.0' 
     compile 'com.daimajia.slider:library:[email protected]' 
     compile 'com.squareup.picasso:picasso:2.5.2' 
     compile 'com.mcxiaoke.volley:library:1.0.19' 
     compile 'com.nineoldandroids:library:2.4.0' 
     compile 'com.makeramen:roundedimageview:2.2.1' 
     compile 'com.android.support:cardview-v7:23.2.1' 
     compile 'com.facebook.android:facebook-android-sdk:4.5.0' 
     compile 'com.bignerdranch.android:expandablerecyclerview:2.0.3' 
     compile 'com.marshalchen.ultimaterecyclerview:library:0.3.18' 
     compile 'com.miguelcatalan:materialsearchview:1.3.0' 
     compile 'com.wdullaer:materialdatetimepicker:2.0.2' 
     compile 'com.google.android.gms:play-services:9.0.0' 
     compile 'de.greenrobot:eventbus:2.4.0' 
     compile 'com.github.shell-software:fab:1.1.2' 
     compile 'com.google.android.gms:play-services-analytics:9.0.0' 
     compile 'com.onesignal:OneSignal:[email protected]' 
     compile 'com.daimajia.swipelayout:library:[email protected]' 
     compile 'com.intuit.sdp:sdp-android:1.0.2' 
    } 
    apply plugin: 'com.google.gms.google-services' 

unten ist hohe gradle Datei

buildscript { 
    repositories { 
     jcenter() 
    } 
    dependencies { 
     classpath 'com.android.tools.build:gradle:2.1.0' 
     classpath 'com.google.gms:google-services:3.0.0' 
     // NOTE: Do not place your application dependencies here; they belong 
     // in the individual module build.gradle files 
    } 
} 

allprojects { 
    repositories { 
     jcenter() 
    } 
} 

task clean(type: Delete) { 
    delete rootProject.buildDir 
} 

Wie kann ich diese Art von Problem beheben

+0

Warum Sie das geschrieben haben 'anwenden Plugin:‚com.google.gms.google-services'' zweimal !!. Mache es nur einmal in 'Gradle'. –

+0

Ich mache nur eine, aber es funktioniert immer noch nicht und das Problem bleibt gleich –

+0

Überprüfen Sie dies kann Ihnen helfen http://StackOverflow.com/questions/37312340/incompatibleClasschangeerror-after-updating-to-android-build-Tools-25-1 -6-gcm –

Antwort

0

in Abhängigkeiten dieser hinzufügen Linie Ich hoffe, es wird funktionieren.

compile 'com.google.android.gms:play-services-maps:8.3.0' 

Entfernen Sie diese Zeile

classpath 'com.google.gms:google-services:3.0.0' 
+0

Ich habe beide geändert aber immer noch nicht woking ... –