有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

任务的java执行失败“:app:ProcessDebuggGoogleService”

我想从GCM迁移到FCM。我已经升级了我的库的版本以实现FCM。单击“现在同步”后,我出现了此错误

注:JDK 1.7、Android Studio 2.2和AdnRoid版本23

错误

 Information:Gradle tasks [:app:generateDebugSources,    :app:generateDebugAndroidTestSources, :app:mockableAndroidJar,  :app:prepareDebugUnitTestDependencies]
 Warning:WARNING: Dependency org.apache.httpcomponents:httpclient:4.0.1 is ignored for debug as it may be conflicting with the internal version provided by Android.
 Warning:WARNING: Dependency org.apache.httpcomponents:httpclient:4.0.1 is ignored for release as it may be conflicting with the internal version provided by Android.     
 Error:Execution failed for task ':app:processDebugGoogleServices'.
 > No matching client found for package name 'healysta.tenwave.com.doctor'
  Information:BUILD FAILED
  Information:Total time: 0.521 secs
  Information:1 error
  Information:2 warnings
  Information:See complete output in console

构建。格拉德尔

  apply plugin: 'com.安卓.application'

  安卓 {
           signingConfigs {
              release {
                   storeFile file("/home/jenkin/5.1.2/docapp.jks")
                   storePassword "*****"
                   keyAlias "Tenwave"
                  keyPassword "*******"


           }

     }
    /*compileSdkVersion 21*/
      compileSdkVersion 23
      buildToolsVersion '22.0.1'
      sourceSets.main {
               jniLibs.srcDir 'libs'
               jni.srcDirs = [] //disable automatic ndk-build call
      }
      defaultConfig {
               applicationId "healysta.tenwave.com.doctor"
               minSdkVersion 14
              //targetSdkVersion 21
               targetSdkVersion 23
               versionCode 7
               versionName "2.1.2"
               signingConfig signingConfigs.release

               multiDexEnabled true
       }
      dexOptions {
          javaMaxHeapSize "4g"
      }

   buildTypes {
       release {
           minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-安卓.txt'), 'proguard-rules.pro'
            signingConfig signingConfigs.release
         }
     }
     productFlavors {
     }
  }

   dependencies {
       //compile 'com.google.安卓.gms:play-services-analytics:7.5.0'
      compile 'com.google.安卓.gms:play-services-analytics:9.6.1'

     //compile 'com.google.安卓.gms:play-services-gcm:7.5.0'
     compile "com.google.firebase:firebase-messaging:9.0.2"
     //compile 'com.google.安卓.gms:play-services-location:7.5.0'
     compile 'com.google.安卓.gms:play-services-location:9.6.1'

    //compile 'com.google.安卓.gms:play-services-drive:7.5.0'

    compile 'com.安卓.support:support-v13:22.2.1'
    compile 'com.安卓.support:appcompat-v7:22.2.1'
    compile 'com.安卓.support:cardview-v7:22.2.1'
    compile 'com.安卓.support:recyclerview-v7:22.2.1'
    compile 'com.google.code.gson:gson:2.+'
    compile('com.google.api-client:google-api-client:1.+') {
    exclude group: 'xpp3', module: 'shared'
    exclude group: 'org.apache.httpcomponents', module: 'httpclient'
    exclude group: 'junit', module: 'junit'
    exclude group: 'com.google.安卓', module: '安卓'
   }
    compile 'com.google.api-client:google-api-client-安卓:1.17.+'
    compile 'com.google.apis:google-api-services-plus:+'
    compile 'com.github.japgolly.安卓:svg-安卓:2.0.6'
    compile fileTree(dir: 'libs', include: '*.jar')
    compile files('../third_party/glide/library/libs/glide-3.2.0a.jar')

    compile files('../third_party/basic-http-client/libs/basic-http-client-安卓-0.88.jar')
   // Google Maps Android API utility library
    compile('com.google.maps.安卓:安卓-maps-utils:0.3+') {
    exclude group: "com.google.安卓.gms"
   }
    compile 'com.google.http-client:google-http-client-gson:1.+'
   //compile 'com.google.apis:google-api-services-drive:+'
    compile 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
  //for apprtc
  compile files('libs/autobanh.jar')
 //compile files('libs/libjingle_peerconnection_java.jar')
   compile files('libs/libjingle_peerconnection.jar')
  //compile files('../third_party/webrtc/autobanh.jar')
  //compile files('../third_party/webrtc/libjingle_peerconnection.jar')
   compile 'com.安卓.support:multidex:1.0.0'

  //for firebase cloud messaging

  //compile 'com.google.firebase:firebase-core:9.6.1'
 }
 // ADD THIS AT THE BOTTOM
 apply plugin: 'com.google.gms.google-services'

顶级渐变。构建

 // Top-level build file where you can add configuration options common to all sub-projects/modules.

  buildscript {
        repositories {
           jcenter()
           maven {
                 url 'http://dl.bintray.com/amulyakhare/maven'
           }
        }
        dependencies {
           classpath 'com.安卓.tools.build:gradle:2.2.0'
           classpath 'com.google.gms:google-services:1.3.0-beta1'
           classpath 'com.google.gms:google-services:3.0.0'
          // classpath 'com.google.gms:google-services:1.5.0-beta2'
          // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
      }
   }

  allprojects {
           repositories {
                jcenter()
            }
  }

共 (2) 个答案

  1. # 1 楼答案

    你的gradle设置似乎有问题。尝试以下更改:

    compileSdkVersion 23
    buildToolsVersion "23.0.3"
    

    然后再次同步

  2. # 2 楼答案

    问题是您没有在google-services.json中定义healysta.tenwave.com.doctor的节点

    此外,您还有多个谷歌服务插件的类路径声明。只需使用3.0.0