React Native修改应用名称后processDebugGoogleServices任务执行失败
Fix: "No matching client found for package name 'com.newName'" After React Native Rename
This error happens because the Google Services configuration files haven’t been updated to match your new package name—react-native-rename handles core app files, but it doesn’t touch third-party service configs like Firebase/Google Services. Here’s how to fix it step by step:
For Android
- Update your Google Services config in Firebase Console
- Head to your Firebase project dashboard, click "Add app" and select Android.
- Enter your new package name (
com.newName) when prompted, then download the updatedgoogle-services.jsonfile.
- Replace the old config file
Overwrite the existing file atandroid/app/google-services.jsonwith the new one you just downloaded. - Double-check your Gradle configs
Openandroid/app/build.gradleand confirm theapplicationIdis set tocom.newName(the rename tool should have done this, but it’s worth verifying). - Clean build cache
Run these commands to clear cached build data:cd android ./gradlew clean cd .. npx react-native run-android
For iOS (if applicable)
- Update Firebase config for iOS
- In Firebase Console, add a new iOS app with your new Bundle ID (matching
com.newName). - Download the updated
GoogleService-Info.plistfile.
- In Firebase Console, add a new iOS app with your new Bundle ID (matching
- Replace the old plist file
Swap out the file atios/[YourAppName]/GoogleService-Info.plistwith the new one. - Verify Xcode settings
Open your project in Xcode, go to your target’s "Signing & Capabilities" tab, and make sure the Bundle Identifier matchescom.newName. - Clear Xcode cache
Delete Xcode’s Derived Data (find this via Xcode > Settings > Locations > Derived Data) then rebuild the app.
Extra Notes
If you’re using other Google services (like Google Sign-In, Maps, etc.), you’ll also need to update allowed package names/Bundle IDs in the Google Cloud Console:
- Navigate to the Google Cloud Console, find your project, go to "APIs & Services" > "Credentials".
- Edit any OAuth 2.0 client IDs for Android/iOS and add your new package name/Bundle ID to the authorized list.
That should resolve the "No matching client" error—your new package name will now be recognized by Google Services.
内容的提问来源于stack exchange,提问作者Asnad Atta
相关产品推荐
相关产品推荐

