更新 Google Play 服务至 15.0.0 后出现“Error ImmutableJarInput”错误

8
更新了 Google Play 服务库(以及 Firebase)至15.0.0 后,我遇到了以下错误:
java.lang.IllegalStateException: Unexpected inputs:    ImmutableJarInput{name=com.google.android.gms:play-services-location-license:12.0.1, file=/home/hahn/MyAndroidApp/build/intermediates/transforms/desugar/debug/99.jar, contentTypes=CLASSES, scopes=EXTERNAL_LIBRARIES, status=REMOVED},
ImmutableJarInput{name=com.google.android.gms:play-services-auth-api-phone-license:12.0.1, file=/home/hahn/MyAndroidApp/build/intermediates/transforms/desugar/debug/116.jar, contentTypes=CLASSES, scopes=EXTERNAL_LIBRARIES, status=REMOVED},
ImmutableJarInput{name=com.google.android.gms:play-services-maps:12.0.1, file=/home/hahn/MyAndroidApp/build/intermediates/transforms/desugar/debug/108.jar, contentTypes=CLASSES, scopes=EXTERNAL_LIBRARIES, status=REMOVED},
ImmutableJarInput{name=com.google.android.gms:play-services-base-license:12.0.1, file=/home/hahn/MyAndroidApp/build/intermediates/transforms/desugar/debug/103.jar, contentTypes=CLASSES, scopes=EXTERNAL_LIBRARIES, status=REMOVED},
ImmutableJarInput{name=com.google.firebase:firebase-core:12.0.1, file=/home/hahn/MyAndroidApp/build/intermediates/transforms/desugar/debug/94.jar, contentTypes=CLASSES, scopes=EXTERNAL_LIBRARIES, status=REMOVED},
ImmutableJarInput{name=com.google.firebase:firebase-analytics-license:12.0.1, file=/home/hahn/MyAndroidApp/build/intermediates/transforms/desugar/debug/120.jar, contentTypes=CLASSES, scopes=EXTERNAL_LIBRARIES, status=REMOVED},
ImmutableJarInput{name=com.google.android.gms:play-services-location:12.0.1, file=/home/hahn/MyAndroidApp/build/intermediates/transforms/desugar/debug/111.jar, contentTypes=CLASSES, scopes=EXTERNAL_LIBRARIES, status=REMOVED},
ImmutableJarInput{name=com.google.firebase:firebase-common-license:12.0.1, file=/home/hahn/MyAndroidApp/build/intermediates/transforms/desugar/debug/93.jar, contentTypes=CLASSES, scopes=EXTERNAL_LIBRARIES, status=REMOVED},
ImmutableJarInput{name=com.google.android.gms:play-services-tasks:12.0.1, file=/home/hahn/MyAndroidApp/build/intermediates/transforms/desugar/debug/104.jar, contentTypes=CLASSES, scopes=EXTERNAL_LIBRARIES, status=REMOVED},
ImmutableJarInput{name=com.google.android.gms:play-services-base:12.0.1, file=/home/hahn/MyAndroidApp/build/intermediates/transforms/desugar/debug/117.jar, contentTypes=CLASSES, scopes=EXTERNAL_LIBRARIES, status=REMOVED},
ImmutableJarInput{name=com.google.android.gms:play-services-basement-license:12.0.1, file=/home/hahn/MyAndroidApp/build/intermediates/transforms/desugar/debug/107.jar, contentTypes=CLASSES, scopes=EXTERNAL_LIBRARIES, status=REMOVED},
ImmutableJarInput{name=com.google.firebase:firebase-analytics-impl:12.0.1, file=/home/hahn/MyAndroidApp/build/intermediates/transforms/desugar/debug/112.jar, contentTypes=CLASSES, scopes=EXTERNAL_LIBRARIES, status=REMOVED},
ImmutableJarInput{name=com.google.firebase:firebase-auth:12.0.1, file=/home/hahn/MyAndroidApp/build/intermediates/transforms/desugar/debug/105.jar, contentTypes=CLASSES, scopes=EXTERNAL_LIBRARIES, status=REMOVED},
ImmutableJarInput{name=com.google.firebase:firebase-iid-license:12.0.1, file=/home/hahn/MyAndroidApp/build/intermediates/transforms/desugar/debug/119.jar, contentTypes=CLASSES, scopes=EXTERNAL_LIBRARIES, status=REMOVED},
ImmutableJarInput{name=com.google.firebase:firebase-analytics:12.0.1, file=/home/hahn/MyAndroidApp/build/intermediates/transforms/desugar/debug/97.jar, contentTypes=CLASSES, scopes=EXTERNAL_LIBRARIES, status=REMOVED},
ImmutableJarInput{name=com.google.android.gms:play-services-maps-license:12.0.1, file=/home/hahn/MyAndroidApp/build/intermediates/transforms/desugar/debug/100.jar, contentTypes=CLASSES, scopes=EXTERNAL_LIBRARIES, status=REMOVED},
ImmutableJarInput{name=com.google.android.gms:play-services-auth-base:12.0.1, file=/home/hahn/MyAndroidApp/build/intermediates/transforms/desugar/debug/113.jar, contentTypes=CLASSES, scopes=EXTERNAL_LIBRARIES, status=REMOVED},
ImmutableJarInput{name=com.google.firebase:firebase-analytics-impl-license:12.0.1, file=/home/hahn/MyAndroidApp/build/intermediates/transforms/desugar/debug/96.jar, contentTypes=CLASSES, scopes=EXTERNAL_LIBRARIES, status=REMOVED},
ImmutableJarInput{name=com.google.android.gms:play-services-basement:12.0.1, file=/home/hahn/MyAndroidApp/build/intermediates/transforms/desugar/debug/109.jar, contentTypes=CLASSES, scopes=EXTERNAL_LIBRARIES, status=REMOVED},
ImmutableJarInput{name=com.google.android.gms:play-services-auth:12.0.1, file=/home/hahn/MyAndroidApp/build/intermediates/transforms/desugar/debug/115.jar, contentTypes=CLASSES, scopes=EXTERNAL_LIBRARIES, status=REMOVED},
ImmutableJarInput{name=com.google.firebase:firebase-auth-license:12.0.1, file=/home/hahn/MyAndroidApp/build/intermediates/transforms/desugar/debug/98.jar, contentTypes=CLASSES, scopes=EXTERNAL_LIBRARIES, status=REMOVED},
ImmutableJarInput{name=com.google.firebase:firebase-messaging-license:12.0.1, file=/home/hahn/MyAndroidApp/build/intermediates/transforms/desugar/debug/95.jar, contentTypes=CLASSES, scopes=EXTERNAL_LIBRARIES, status=REMOVED},
ImmutableJarInput{name=com.google.firebase:firebase-messaging:12.0.1, file=/home/hahn/MyAndroidApp/build/intermediates/transforms/desugar/debug/102.jar, contentTypes=CLASSES, scopes=EXTERNAL_LIBRARIES, status=REMOVED},
ImmutableJarInput{name=com.google.android.gms:play-services-auth-base-license:12.0.1, file=/home/hahn/MyAndroidApp/build/intermediates/transforms/desugar/debug/101.jar, contentTypes=CLASSES, scopes=EXTERNAL_LIBRARIES, status=REMOVED},
ImmutableJarInput{name=com.google.firebase:firebase-iid:12.0.1, file=/home/hahn/MyAndroidApp/build/intermediates/transforms/desugar/debug/118.jar, contentTypes=CLASSES, scopes=EXTERNAL_LIBRARIES, status=REMOVED},
ImmutableJarInput{name=com.google.firebase:firebase-common:12.0.1, file=/home/hahn/MyAndroidApp/build/intermediates/transforms/desugar/debug/106.jar, contentTypes=CLASSES, scopes=EXTERNAL_LIBRARIES, status=REMOVED},
ImmutableJarInput{name=com.google.android.gms:play-services-auth-api-phone:12.0.1, file=/home/hahn/MyAndroidApp/build/intermediates/transforms/desugar/debug/110.jar, contentTypes=CLASSES, scopes=EXTERNAL_LIBRARIES, status=REMOVED},
ImmutableJarInput{name=com.google.android.gms:play-services-tasks-license:12.0.1, file=/home/hahn/MyAndroidApp/build/intermediates/transforms/desugar/debug/114.jar, contentTypes=CLASSES, scopes=EXTERNAL_LIBRARIES, status=REMOVED}

但是当我将库的版本改回12.0.1时,我的应用程序就可以正常运行了。有什么解决这个问题的想法吗?

编辑: 好的,在重新构建之后,这个错误消失了。 但是在模拟器中运行应用程序时,我在logcat中看到了像这样的错误:

E/DialogRedirect: Failed to start resolution intent
android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=market://details?id=com.google.android.gms&pcampaignid=gcore_12451000-d-id.myapp.app-19 flg=0x80000 pkg=com.android.vending }
    at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1936)
    at android.app.Instrumentation.execStartActivity(Instrumentation.java:1615)
    at android.app.Activity.startActivityForResult(Activity.java:4472)
    at android.support.v4.app.BaseFragmentActivityApi16.startActivityForResult(BaseFragmentActivityApi16.java:54)
    at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:68)
    at android.support.v4.app.ActivityCompat.startActivityForResult(ActivityCompat.java:233)
    at android.support.v4.app.FragmentActivity.startActivityFromFragment(FragmentActivity.java:830)
    at android.support.v4.app.FragmentActivity$HostCallbacks.onStartActivityFromFragment(FragmentActivity.java:939)
    at android.support.v4.app.Fragment.startActivityForResult(Fragment.java:1021)
    at android.support.v4.app.Fragment.startActivityForResult(Fragment.java:1010)
    at com.google.android.gms.common.internal.zzd.redirect(Unknown Source:10)
    at com.google.android.gms.common.internal.DialogRedirect.onClick(Unknown Source:0)
    at com.android.internal.app.AlertController$ButtonHandler.handleMessage(AlertController.java:166)
    at android.os.Handler.dispatchMessage(Handler.java:105)
    at android.os.Looper.loop(Looper.java:164)
    at android.app.ActivityThread.main(ActivityThread.java:6541)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)

模拟器提示我需要更新谷歌服务,但当我点击消息时,什么也没发生。


7
尝试清理并重新构建您的项目。 - Mikhail Sharin
完成了,现在我的应用程序成功构建。但是当在模拟器上运行时,我遇到了错误,并且无法使用谷歌帐户登录(必须更新谷歌播放服务)。 - Hanhan
请查看此链接:https://dev59.com/eFsW5IYBdhLWcg3wCTeB#35496184 - Mikhail Sharin
1个回答

10

我遇到了同样的问题,只需要这样做

Build -> clean project 

并且再次运行正常工作


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接