Habeeb E Sadeed
Habeeb E Sadeed

Reputation: 139

Execution failed for task ':app:processDebugGoogleServices'. > No matching client found for package name 'com.example.myapp '

No matching client found for package name 'com.example.myapp '

This is a client portion from Google Service.json

"client": [https://stackoverflow.com/questions/66766493/execution-failed-for-task-appprocessdebuggoogleservices-no-matching-clien {

  "client_info": {

"mobilesdk_app_id": "1:110944006455:android:f790b09ad0563a63046ab2",
"android_client_info": {
  "package_name": "com.example.myapp"
}
}

And here is my build.gradle

defaultConfig {
    // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
    applicationId "com.example.riderapp "
    minSdkVersion 16
    targetSdkVersion 28
    versionCode flutterVersionCode.toInteger()
    versionName flutterVersionName
}

You can see that the application ID for both is same. Yet I receiver this error:

No matching client found for package name 'com.example.myapp'

Upvotes: 9

Views: 22635

Answers (5)

upidev
upidev

Reputation: 21

you just change name "package_name": "com.example.myapp" to "com.example.riderapp"

Upvotes: 1

Akhzar Nazir
Akhzar Nazir

Reputation: 830

Your Android [React Native] Project Bundle id is different from firebase project bundle ID, Create new app on firebase or change your app local bundle id with same as it is on firebase

Upvotes: 1

BALASURIYA K A
BALASURIYA K A

Reputation: 11

Solution: As @Huthaifa Muayyad said application Ids are not the same, you can do as he said or the more straightforward way is to change the "package_name" in google-services.json to "com.example.riderapp",

Reason: This error happens when you share your project with your teammate who might have a different project name, so we need to change the package_name to our project name.

Even After this, there might be errors as "ERROR:D8: Cannot fit requested classes in a single dex file (# methods: 97652 > 65536) com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: The number of method references in a .dex file cannot exceed 64K." which you can resolve as said in this answer D8: Cannot fit requested classes in a single dex file by @king mort

Upvotes: 1

Huthaifa Muayyad
Huthaifa Muayyad

Reputation: 12373

The application Id for both is not the same. In google services json it says com.example.myapp

But in your buildGradle it's com.example.riderapp

Go to firebase, add your app again with the name used in buildGradle com.example.riderapp, add your SHA-1 debug key to firebase in this step also, then download your json again and remove the old one. And report back what happens.

Note: make sure to keep the new googlejson named exactly google-services.json

Upvotes: 16

omar
omar

Reputation: 93

change minSdkVersion to 21 in app/build.gradle and change every 'com.example.anything' in your project to you project id (you can find it in project details in firestore)

Upvotes: -1

Related Questions