Execution failed for task ': app: processReleaseGoogleServices'. > No matching client found for package name

Anytime I try to create my project, I get this error all the time:

Execution failed for task ':app:processReleaseGoogleServices'. No matching client found for package name 'com.my.package' 

I made and remade google-services.json and used the application and package com.my.package .

Here is my build.gradle project:

 buildscript { repositories { ... } dependencies { classpath 'com.android.tools.build:gradle:2.0.0-beta6' classpath 'com.github.JakeWharton:sdk-manager-plugin:220bf7a88a7072df3ed16dc8466fb144f2817070' classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8' classpath 'io.fabric.tools:gradle:1.+' classpath 'com.newrelic.agent.android:agent-gradle-plugin:4.265.0' classpath 'com.google.gms:google-services:2.0.0-alpha9' } } allprojects { repositories { ... } } // Define versions in a single place ext { supportLibraryVersion = '23.2.0' playServicesVersion = '8.4.0' } 

Here is my build.gradle application:

  apply plugin: 'android-sdk-manager' apply plugin: 'com.android.application' apply plugin: 'io.fabric' apply plugin: 'newrelic' apply plugin: 'com.neenbedankt.android-apt' android { packagingOptions { exclude 'LICENSE.txt' exclude 'META-INF/LICENSE' exclude 'META-INF/LICENSE.txt' exclude 'META-INF/NOTICE' exclude 'META-INF/services/javax.annotation.processing.Processor' } dexOptions { jumboMode true } lintOptions { disable 'InvalidPackage' abortOnError false } compileSdkVersion 23 buildToolsVersion '23.0.2' defaultConfig { applicationId "com.my.package" minSdkVersion 15 targetSdkVersion 23 } buildTypes { debug { applicationIdSuffix '.debug' versionNameSuffix '-DEBUG' ... } staging { applicationIdSuffix '.staging' versionNameSuffix '-STAGING' ... } release { ... } } } dependencies { compile "com.android.support:support-v4:$rootProject.supportLibraryVersion", "com.android.support:support-annotations:$rootProject.supportLibraryVersion", "com.android.support:percent:$rootProject.supportLibraryVersion", "com.android.support:appcompat-v7:$rootProject.supportLibraryVersion", "com.android.support:mediarouter-v7:$rootProject.supportLibraryVersion", "com.google.android.gms:play-services-base:$rootProject.playServicesVersion", "com.google.android.gms:play-services-cast:$rootProject.playServicesVersion", "com.google.android.gms:play-services-gcm:$rootProject.playServicesVersion", "com.google.android.gms:play-services-analytics:$rootProject.playServicesVersion", ... 'com.newrelic.agent.android:android-agent:4.265.0', 'com.android.support:multidex:1.0.0' compile 'com.squareup.dagger:dagger:1.2.1' } apply plugin: 'com.google.gms.google-services' 

I followed the instructions here several times. I also use my release configuration, so there is no reason why the IdSuffix application should be a problem. Also, com.my.pacakage is just a booth for my pacakge name. What can I do to solve this problem?

+5
source share
5 answers

The problem was actually with NewRelic not with my configuration. I deleted it and followed this answer as I used BuildTypes. Now it compiles as expected.

0
source

You need to provide google-services.json for all flavors (release and development, etc.)

A single google-services.json can have json / data for all tastes. Go to the Google Developers Console and restore the google-services.json file

Update

You can also create separate google-services.json files for flavors

https://developers.google.com/android/guides/google-services-plugin

+4
source

Google has included plugin support in version 2.0 of the service plugin. Since this version of the gradle plugin com.google.gms:google-services:2.0.0-alpha9

You can do it

enter image description here

For more information, click on the link below. If you want to know more about what this plugin does with these json files, here it is :

Link to official documents:

And go here to check the latest version of this plugin :

Link Link.

+3
source

In my case, he solved my problem

  ... "client": [ { "client_info": { "mobilesdk_app_id": "yourid", "android_client_info": { "package_name": "ru.example.app" } }, ... 

package_name should be the same as in applicationId

  defaultConfig { applicationId "ru.example.app" minSdkVersion 15 targetSdkVersion 23 ... } 
+2
source

Probably a little late, but I had a similar problem.

This happened when I initially connected my application to Firebase analytics for some reason, it only caught on to my β€œdebugging” taste.

I had to log into Firebase, go to the console and select the appropriate project, and then manually add an additional β€œrelease”.

Then I reconnected to Firebase in Android Studio (which automatically updated and downloaded the json file from Firebase in Studio), recompiled my application, and it worked.

0
source

Source: https://habr.com/ru/post/1244686/


All Articles