Zaktualizowałem playservice w moim SDK i otrzymałem ten błąd. I nie mam dostępu do tokena GCM. Przed aktualizacją sdk mój projekt działa idealnie.java.lang.IllegalAccessError: Metoda 'void android.support.v4.content
Ja marnuję cały mój dzień w tym, ale nie znalazłem żadnego rozwiązania. Próbowałem this ale gettting błąd w tym Zależności com.google.android.gms:play-services-plus:9.0.0
Oto moja logcat
Caused by: java.lang.IllegalAccessError: Method 'void android.support.v4.content.ContextCompat.<init>()' is inaccessible to class 'com.google.android.gms.iid.zzd' (declaration of 'com.google.android.gms.iid.zzd' appears in /data/data/com.hwindiapp.passenger/files/instant-run/dex/slice-com.google.android.gms-play-services-iid-9.0.0_b51865a18dbfbfb3651aaa54856c955adf1e354f-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.mainProfile.classFiles.RegisterFbLoginResCallBack$registerFBUser.processGCMID_user(RegisterFbLoginResCallBack.java:166)
at com.mainProfile.classFiles.RegisterFbLoginResCallBack$registerFBUser.doInBackground(RegisterFbLoginResCallBack.java:219)
at com.mainProfile.classFiles.RegisterFbLoginResCallBack$registerFBUser.doInBackground(RegisterFbLoginResCallBack.java:153)
at android.os.AsyncTask$2.call(AsyncTask.java:292)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:818)
12-01 12:23:59.553 18157-18703/com.hwindiapp.passenger E/ACRA: Not adding buildConfig to log. Class Not found : com.VolleyLibFiles.BuildConfig. Please configure 'buildConfigClass' in your ACRA config
12-01 12:24:00.013 18157-19059/com.hwindiapp.passenger E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #4
Process: com.hwindiapp.passenger, PID: 18157
java.lang.RuntimeException: An error occured while executing doInBackground()
at android.os.AsyncTask$3.done(AsyncTask.java:304)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355)
at java.util.concurrent.FutureTask.setException(FutureTask.java:222)
at java.util.concurrent.FutureTask.run(FutureTask.java:242)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:818)
Caused by: java.lang.IllegalAccessError: Method 'void android.support.v4.content.ContextCompat.<init>()' is inaccessible to class 'com.google.android.gms.iid.zzd' (declaration of 'com.google.android.gms.iid.zzd' appears in /data/data/com.hwindiapp.passenger/files/instant-run/dex/slice-com.google.android.gms-play-services-iid-9.0.0_b51865a18dbfbfb3651aaa54856c955adf1e354f-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.mainProfile.classFiles.RegisterFbLoginResCallBack$registerFBUser.processGCMID_user(RegisterFbLoginResCallBack.java:166)
at com.mainProfile.classFiles.RegisterFbLoginResCallBack$registerFBUser.doInBackground(RegisterFbLoginResCallBack.java:219)
at com.mainProfile.classFiles.RegisterFbLoginResCallBack$registerFBUser.doInBackground(RegisterFbLoginResCallBack.java:153)
at android.os.AsyncTask$2.call(AsyncTask.java:292)
Pokazuje błąd w tej linii kodu
InstanceID instanceID = InstanceID.getInstance(mContext);
GCMregistrationId = instanceID.getToken(CommonUtilities.SENDER_ID, GoogleCloudMessaging.INSTANCE_ID_SCOPE,
null);
I tu jest moje Gradle
apply plugin: 'com.android.application'
android {
signingConfigs {
config {
keyAlias 'hwindi'
keyPassword '123456'
storeFile file('D:/Company Projects/Hwindi/Project 2/Play_KeyStore/HwindiKeyStore.jks')
storePassword '123456'
}
}
compileSdkVersion 24
buildToolsVersion "24.0.3"
defaultConfig {
applicationId "com.hwindiapp.passenger"
minSdkVersion 16
targetSdkVersion 24
versionCode 12
versionName "1.12"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'lib/arm64-v8a/libcardioDecider.so'
exclude 'lib/arm64-v8a/libcardioRecognizer.so'
exclude 'lib/arm64-v8a/libcardioRecognizer_tegra2.so'
exclude 'lib/arm64-v8a/libopencv_core.so'
exclude 'lib/arm64-v8a/libopencv_imgproc.so'
exclude 'lib/armeabi/libcardioDecider.so'
exclude 'lib/armeabi-v7a/libcardioDecider.so'
exclude 'lib/armeabi-v7a/libcardioRecognizer.so'
exclude 'lib/armeabi-v7a/libcardioRecognizer_tegra2.so'
exclude 'lib/armeabi-v7a/libopencv_core.so'
exclude 'lib/armeabi-v7a/libopencv_imgproc.so'
exclude 'lib/mips/libcardioDecider.so'
exclude 'lib/x86/libcardioDecider.so'
exclude 'lib/x86/libcardioRecognizer.so'
exclude 'lib/x86/libcardioRecognizer_tegra2.so'
exclude 'lib/x86/libopencv_core.so'
exclude 'lib/x86/libopencv_imgproc.so'
exclude 'lib/x86_64/libcardioDecider.so'
exclude 'lib/x86_64/libcardioRecognizer.so'
exclude 'lib/x86_64/libcardioRecognizer_tegra2.so'
exclude 'lib/x86_64/libopencv_core.so'
exclude 'lib/x86_64/libopencv_imgproc.so'
}
configurations.all {
/*resolutionStrategy {
force 'com.android.support:design:23.4.0'
force 'com.android.support:support-v4:23.4.0'
force 'com.android.support:appcompat-v7:23.4.0'
}*/
}
}
repositories {
mavenCentral()
maven { url "https://jitpack.io" }
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile ('com.squareup:fest-android:1.0.8') {
exclude module: 'support-v4'
}
compile 'com.android.support:appcompat-v7:24.2.0'
compile 'com.android.support:design:24.2.0'
compile 'com.android.support:cardview-v7:24.2.0'
compile 'com.android.support:recyclerview-v7:24.2.0'
compile 'com.google.android.gms:play-services-gcm:9.0.0'
compile 'com.google.android.gms:play-services-location:9.0.0'
compile 'com.google.android.gms:play-services-maps:9.0.0'
compile 'com.google.android.gms:play-services-plus:9.0.0'
compile 'com.facebook.android:facebook-android-sdk:[4,5)'
compile 'com.paypal.sdk:paypal-android-sdk:2.13.3'
compile 'com.wdullaer:materialdatetimepicker:2.2.0'
compile 'com.mukesh:permissions:1.0.3'
}
Dzięki za odpowiedź, ale ja go rozwiązać. usuwając api 25 w sdk, a także budując narzędzia i zmieniając wersję na Facebooka na 4.16.+ –
Wygląda na to, że kompiluje się bez błędów, jeśli nie uwzględnisz zależności zależnej od appcomapt, ale nie będzie działać bez niej i nie powie Ci, że to jest problem ... Yeeesh –
Wydaje się, że nie działa, Przepraszam. Jedynym rozwiązaniem jest aktualizacja narzędzi do kompilacji i wykonanie wersji sdk ... –