简体   繁体   English

添加google-services.json后,我也收到类似的错误

[英]after adding google-services.json also i am getting error like

GoogleService failed to initialize, status: 10, Missing an expected resource: 'R.string.google_app_id' for initializing Google services. GoogleService未能初始化,状态:10,缺少预期的资源:“ R.string.google_app_id”,用于初始化Google服务。 Possible causes are missing google-services.json or com.google.gms.google-services gradle plugin. 可能的原因是缺少google-services.json或com.google.gms.google-services gradle插件。

this is my project gradle file 这是我的项目gradle文件

// Top-level build file where you can add configuration options common to        all sub-projects/modules.
     apply plugin: 'maven-publish'
     apply plugin: "java"


     buildscript {
     repositories {
    jcenter()
   }
dependencies {

    classpath 'com.android.tools.build:gradle:2.1.0-alpha3'
    classpath 'com.google.gms:google-services:2.0.0-alpha5'

}

}

 allprojects {
 repositories {
      jcenter()
   }
 }
 task clean(type: Delete) {
      delete rootProject.buildDir
 }

   task sourceJar(type: Jar) {
     from sourceSets.main.allJava
     classifier "sources"
   }

  publishing {
       publications {
    mavenJava(MavenPublication) {
        from components.java
        artifact sourceJar
        pom.withXml {
            asNode().appendNode('description', 'A demonstration of Maven  POM customization')
        }
    }
}
    }

this is my app.gardle 这是我的app.gardle

apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
 android {
    compileSdkVersion 23
     buildToolsVersion '23.0.2'

defaultConfig {

    minSdkVersion 14
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"
    multiDexEnabled true
    vectorDrawables.useSupportLibrary = true
    generatedDensities = []
}

aaptOptions {
    additionalParameters "--no-version-vectors"
}

buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}

dexOptions {
    preDexLibraries = false
    javaMaxHeapSize "4g"
}
  }

 dependencies {
     compile fileTree(include: ['*.jar'], dir: 'libs')
      compile files('libs/universal-image-loader-1.9.5.jar')
      compile project(':databaseAutoCompleteLibrary')
    compile 'com.android.support:support-v4:23.2.0'
   compile 'com.android.support:gridlayout-v7:23.2.0'
    compile project(':MPChartLib')
    compile project(':filechooserlibrary')
   compile 'com.android.support:design:23.2.0'
   compile 'com.android.support:support-v13:23.2.0'
   compile 'com.android.support:appcompat-v7:23.2.0'
   compile project(':Volley')
   compile 'com.google.code.gson:gson:2.4'
   compile 'com.loopj.android:android-async-http:1.4.9'
   compile 'com.jakewharton:butterknife:7.0.1'
   compile 'com.baoyz.swipemenulistview:library:1.3.0'
   compile 'milyn:opencsv:1.6'
   compile 'de.hdodenhof:circleimageview:2.0.0'
   compile 'com.squareup.picasso:picasso:2.5.2'

   compile 'com.google.android.gms:play-services:8.3.0'
   compile 'com.android.support:multidex:1.0.1'

  }

Apply this in your app build.gradle file 将其应用到您的应用程序build.gradle文件中

apply plugin: 'com.google.gms.google-services'

dependencies {
    compile 'com.google.android.gms:play-services:8.3.0'
  }

In your project build.gradle define 在您的项目build.gradle中定义

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.2.3'
        classpath 'com.google.gms:google-services:1.5.0-beta2'
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我正在使用 flutter 编写 Firebase 应用程序,但我收到有关 google-services.json 和初始化的错误 - I am coding a Firebase app with flutter but i am getting errors about google-services.json and inititilization 我应该编辑google-services.json文件吗? - Am I supposed to edit the google-services.json file? google-services.json文件已添加,但出现错误:模块根文件夹中缺少文件google-services.json - google-services.json file already added, but getting an error : File google-services.json is missing from module root folder 我在正确的位置添加了 google-services.json 但不起作用,我也有错误 google-services.json 丢失 - i add the google-services.json in the right postion but not work ,alss i have a error google-services.json is missing Firebase:google-services.json 错误 - Firebase: google-services.json error google-services.json缺少错误 - google-services.json missing error 在我将原来的google-services.json替换为与Firebase相关的google-services.json后,Google登录停止了工作 - Google sign-in stopped working after I replaced the original google-services.json with one pertaining to Firebase 使用新的google-services.json后,Google登录失败 - Google sign in failed after using new google-services.json 在公共存储库上添加Google-services.json以使CircleCI正常运行 - Adding Google-services.json for CircleCI to function, on a public repository 找不到Google-services.json - Google-services.json not found
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM