2016-08-26 3 views
2

gcmタスクを使用してAndroidのプッシュ通知中に、私はこれらのエラーを持っています。どのようにjava.io.File android.support.v4.content.ContextCompat.getNoBackupFilesDirを解決する

私は私のapplication.Giveの提案のbuild.gradleの詳細を添付し、解決するために私を助ける:

FATAL EXCEPTION: IntentService[] 
Process: push.gcm.android.com.pushsample, PID: 7930 
java.lang.IncompatibleClassChangeError: 
Methodjava.io.Fileandroid.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 'java.lang.reflect.ArtMethod' appears in /system/framework/core-libart.jar) 

はbuild.gradle:

apply plugin: 'com.android.application' 

android { 
compileSdkVersion 24 
buildToolsVersion "24.0.0" 

defaultConfig { 
    applicationId "push.gcm.android.com.pushsample" 
    minSdkVersion 15 
    targetSdkVersion 24 
    versionCode 1 
    versionName "1.0" 
} 
buildTypes { 
    release { 
     minifyEnabled false 
     proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
    } 
    } 
} 

dependencies { 
compile fileTree(include: ['*.jar'], dir: 'libs') 
testCompile 'junit:junit:4.12' 
compile 'com.android.support:appcompat-v7:24.1.1' 
compile 'com.android.support:design:24.1.1' 
compile 'com.google.android.gms:play-services-gcm:8.3.0' 
    } 
apply plugin: 'com.google.gms.google-services' 

感謝を。

+0

チェック[this](http://stackoverflow.com/questions/1980452/what-c​​auses-java-lang-incompatibleclasschangeerror) – Nikhil

答えて

0

いくつかのバージョンのアンドロイドサポートライブラリとGoogle Playサービスの互換性に関する既知の問題があります。 com.google.android.gms:play-services-gcm:8.3.0'を最新バージョンにアップグレードしてください。

関連する問題