更新Google服务插件并且无法安装应用程序成功完成gradle后

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了更新Google服务插件并且无法安装应用程序成功完成gradle后相关的知识,希望对你有一定的参考价值。

我正在开发使用Firebase数据库进行数据存储的android应用程序,但是在成功构建后应用程序无法安装时会出现问题。 Here is the Image of Built Error

这是Gradle Image 2中的错误图像

这是Build.gradle的代码

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation 'com.google.firebase:firebase-core:11.8.0'
implementation 'com.google.firebase:firebase-messaging:11.8.0'
implementation 'com.google.firebase:firebase-auth:11.8.0'
implementation 'com.google.firebase:firebase-database:11.8.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.android.support:gridlayout-v7:27.1.1'
implementation 'com.google.android.gms:play-services-maps:15.0.1'
implementation 'com.google.android.gms:play-services-ads:15.0.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'

}

答案

将firebase库更新为以下内容:

implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.google.firebase:firebase-messaging:17.1.0'
implementation 'com.google.firebase:firebase-auth:16.0.2'
implementation 'com.google.firebase:firebase-database:16.0.1'

并在顶级gradle文件中使用:

classpath 'com.google.gms:google-services:4.0.2'
另一答案

请试试这个,用26.1.0替换27.1.1

implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support:cardview-v7:26.1.0'
implementation 'com.android.support:design:26.1.0'
implementation 'com.android.support:recyclerview-v7:26.1.0'
implementation 'com.android.support:gridlayout-v7:26.1.0'

以上是关于更新Google服务插件并且无法安装应用程序成功完成gradle后的主要内容,如果未能解决你的问题,请参考以下文章

为啥google在我的电脑总显示安装错误求大神帮助

用于 Unity 的最新 Google Play 游戏服务插件无法正常工作

无法在 ionic 3 项目的模块中导入 google plus 插件

Google Play 服务在我的 Android 游戏中无法正常运行

elasticsearch 安装

kali 安装google输入法