Gradle error: Unexpected inputs: android.gms:play-services

孤人 提交于 2020-01-12 04:19:09

问题


In RunTime show error in Gradle the error:

Error:Execution failed for task ':app:transformClassesWithInstantRunForDebug'.

Unexpected inputs: ImmutableJarInput{name=com.google.android.gms:play-services-basement:9.0.0, file=/home/nawaf/AndroidStudioProjects/YugiohDeckBuilder/app/build/intermediates/transforms/profilers-transform/debug/43.jar, contentTypes=CLASSES, scopes=EXTERNAL_LIBRARIES, status=REMOVED}, ImmutableJarInput{name=com.google.firebase:firebase-analytics:9.0.0, file=/home/nawaf/AndroidStudioProjects/YugiohDeckBuilder/app/build/intermediates/transforms/profilers-transform/debug/37.jar, contentTypes=CLASSES, scopes=EXTERNAL_LIBRARIES, status=REMOVED}, ImmutableJarInput{name=com.google.android.gms:play-services-base:9.0.0, file=/home/nawaf/AndroidStudioProjects/YugiohDeckBuilder/app/build/intermediates/transforms/profilers-transform/debug/39.jar, contentTypes=CLASSES, scopes=EXTERNAL_LIBRARIES, status=REMOVED}, ImmutableJarInput{name=com.google.firebase:firebase-common:9.0.0, file=/home/nawaf/AndroidStudioProjects/YugiohDeckBuilder/app/build/intermediates/transforms/profilers-transform/debug/41.jar, contentTypes=CLASSES, scopes=EXTERNAL_LIBRARIES, status=REMOVED}, ImmutableJarInput{name=com.google.firebase:firebase-core:9.0.0, file=/home/nawaf/AndroidStudioProjects/YugiohDeckBuilder/app/build/intermediates/transforms/profilers-transform/debug/36.jar, contentTypes=CLASSES, scopes=EXTERNAL_LIBRARIES, status=REMOVED}, ImmutableJarInput{name=com.google.android.gms:play-services-tasks:9.0.0, file=/home/nawaf/AndroidStudioProjects/YugiohDeckBuilder/app/build/intermediates/transforms/profilers-transform/debug/42.jar, contentTypes=CLASSES, scopes=EXTERNAL_LIBRARIES, status=REMOVED}, ImmutableJarInput{name=com.google.firebase:firebase-analytics-impl:9.0.0, file=/home/nawaf/AndroidStudioProjects/YugiohDeckBuilder/app/build/intermediates/transforms/profilers-transform/debug/38.jar, contentTypes=CLASSES, scopes=EXTERNAL_LIBRARIES, status=REMOVED}, ImmutableJarInput{name=com.google.firebase:firebase-iid:9.0.0, file=/home/nawaf/AndroidStudioProjects/YugiohDeckBuilder/app/build/intermediates/transforms/profilers-transform/debug/40.jar, contentTypes=CLASSES, scopes=EXTERNAL_LIBRARIES, status=REMOVED}

Gradle project-level:

dependencies {
        classpath 'com.android.tools.build:gradle:3.0.1'
        classpath 'com.google.gms:google-services:3.1.0'

    }

gradle app-level:

dependencies {
...
}
apply plugin: 'com.google.gms.google-services'

回答1:


It seems you have enable Instant Run in Android Studio.

1) Disable Instant Run from File -> Settings -> Instant Run
2) Clean Your Project
3) Run Your App




回答2:


Personally, Build => Clean Project and then rebuilding fixed it for me.




回答3:


Remove Build Folder from Project->app->build and run your project.




回答4:


When I Add this line the problem solved:

        MobileAds.initialize(getApplicationContext(), "ca-app-pub-xxxxxxxxxxxxx");

Thanks for all who response.



来源:https://stackoverflow.com/questions/47814941/gradle-error-unexpected-inputs-android-gmsplay-services

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!