自從我更新到Android SDK Tools 25.1.6和Android Support Repository 32.0.0(今天上午)以來,出現(xiàn)以下錯(cuò)誤,我沒有更改代碼中的任何內(nèi)容,并且仍在我的同事計(jì)算機(jī)上正常工作(Android SDK Tools 25.1.1 + Android支持存儲庫30.0.0)。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 'java.lang.reflect.ArtMethod' appears in /system/framework/core-libart.jar) at com.google.android.gms.iid.zzd.zzeb(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.xxxxxxx.utils.RegistrationIntentService.onHandleIntent(RegistrationIntentService.java:55) at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:145) at android.os.HandlerThread.run(HandlerThread.java:61)這是崩潰的一段代碼:InstanceID instanceID = InstanceID.getInstance(this); // <-- crash hereString instanceIDToken = instanceID.getToken(getString(R.string.google_app_id),GoogleCloudMessaging.INSTANCE_ID_SCOPE, null);這是我嘗試從Google Cloud Messaging獲取令牌的時(shí)候。禁用GCM的EDIT解決了該問題,所以我的猜測是我應(yīng)該遷移到Firebase Cloud MessageEDIT2 我的設(shè)備收到了Google Play服務(wù)9.0(昨天是8.4.x)?,F(xiàn)在它不再崩潰了,但是抱怨模塊描述符 Failed to load module descriptor class: Didn't find class "com.google.android.gms.dynamite.descriptors.com.google.firebase.auth.ModuleDescriptor" Firebase API initialization failure.有沒有人有類似的錯(cuò)誤,以及如何解決?已修復(fù), 特別感謝@stegranet。 ./gradlew -q app:dependencies --configuration compile幫助您確定哪些依賴項(xiàng)包括SDK 24.x主要問題是某些庫使用+符號(而不是版本)導(dǎo)入最新的支持庫。通過包括最新的可用版本,這會導(dǎo)致問題。因此,避免+登錄依賴項(xiàng);)
- 3 回答
- 0 關(guān)注
- 543 瀏覽
添加回答
舉報(bào)
0/150
提交
取消