0
即使文件位於應用程序目錄中,文件google-sevices.json從模塊根文件夾中缺失。我的gradle版本是2.10。我花了大部分時間來解決這個問題,但我仍然無法解決問題。google-services.json缺少錯誤
項目級gradle這個
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.0'
classpath 'com.google.gms:google-services:2.1.0' //this is the latest version
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
應用級gradle這個
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.myairticket.testpush3"
minSdkVersion 9
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
sourceSets { main { res.srcDirs = \['src/main/res', 'src/main/jsonfiles'\] } }
}
dependencies {
compile fileTree(dir: 'libs', include: \['*.jar'\])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.3.0'
compile 'com.android.support:design:23.3.0'
compile 'com.google.android.gms:play-services-gcm:8.4.0'
}
apply plugin:'com.google.gms.google-services
參考http://stackoverflow.com/questions/32072568/add-google-services-json-in-android-studio – sasikumar
檢查應用程序目錄中的google-services.json文件 – sasikumar
是的,它是。文件在應用程序中目錄仍然沒有得到錯誤 –