【发布时间】:2018-10-29 00:32:26
【问题描述】:
我遇到这个问题很久了,我没有找到任何解决方案,所以我希望在这里找到它。
我做了什么来解决这个问题:
- 尝试删除所有广告和代码并重新构建。
- 当我删除
apply plugin: 'com.google.gms.google-services'时,它运行没有任何问题。
错误:失败:构建失败并出现异常。
出了什么问题:任务 ':app:processDebugGoogleServices' 执行失败。
文件 google-services.json 丢失。没有它,Google 服务插件将无法运行。搜索位置:
C:\Users\Mrwan\Desktop\QassWaNwadar\app\src\nullnull\debug\google-services.json C:\Users\Mrwan\Desktop\QassWaNwadar\app\src\debug\nullnull\google-services.json C:\Users\Mrwan\Desktop\QassWaNwadar\app\src\nullnull\google-services.json C:\Users\Mrwan\Desktop\QassWaNwadar\app\src\debug\google-services.json C:\Users\Mrwan\Desktop\QassWaNwadar\app\src\nullnullDebug\google-services.json C:\Users\Mrwan\Desktop\QassWaNwadar\app\google-services.json尝试:使用 --stacktrace 选项运行以获取堆栈跟踪。使用 --info 或 --debug 选项运行以获得更多日志输出。运行 --scan 以获得完整的见解。
通过https://help.gradle.org获得更多帮助
6 秒后构建失败
Gradle 模块应用
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
buildToolsVersion '27.0.3'
defaultConfig {
applicationId "com.date.brian.cradletest"
minSdkVersion 15
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
implementation 'com.android.support:design:26.1.0'
implementation 'com.android.support:cardview-v7:26.1.0'
implementation 'com.android.support:recyclerview-v7:26.1.0'
implementation 'com.getbase:floatingactionbutton:1.9.0'
implementation 'de.hdodenhof:circleimageview:2.1.0'
implementation 'com.google.android.gms:play-services-ads:15.0.1'
testImplementation 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
【问题讨论】:
-
但是您是否包含了 google-services.json?如果没有,那么您需要添加它。 developers.google.com/android/guides/…