expo icon indicating copy to clipboard operation
expo copied to clipboard

Upgrade Google Services Version for `expo-config`

Open ChromeQ opened this issue 1 year ago • 2 comments

Minimal reproducible example

N/A

What platform(s) does this occur on?

Android

Did you reproduce this issue in a development build?

Yes

Summary

I recently upgraded to the latest react-native-firebase v20.0.0 and I ran into a build error:

FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':app:minifyReleaseWithR8'.
> Could not create task ':app:uploadCrashlyticsMappingFileRelease'.
   > Failed to query the value of task ':app:uploadCrashlyticsMappingFileRelease' property 'appIdFile'.
      > The Crashlytics Gradle plugin 3 requires Google-Services 4.4.1 and above. For more information, see https://firebase.google.com/docs/crashlytics/upgrade-to-crashlytics-gradle-plugin-v3

Turns out the version of Google Services was behind. Looking at the log and the changelog on rn-firebase https://github.com/invertase/react-native-firebase/blob/main/CHANGELOG.md#2000-2024-05-20 we need to use google-services v4.4.1+ (as I am using crashlytics)

I found the version is set here: https://github.com/expo/expo/blob/b7238c682ae31c27e63e0e3eeb882d8483d26813/packages/%40expo/config-plugins/src/android/GoogleServices.ts#L16

I updated the version to 4.4.1 using patch-package and builds succeeded, but I wanted to open a discussion here whether there may be other side effects which I am not aware of and get the PR opened to update if not.

Environment

expo-env-info 1.2.0 environment info: System: OS: Linux 6.5 Ubuntu 22.04.4 LTS 22.04.4 LTS (Jammy Jellyfish) Shell: 5.1.16 - /bin/bash Binaries: Node: 20.13.1 - ~/.nvm/versions/node/v20.13.1/bin/node Yarn: 1.22.22 - ~/.yarn/bin/yarn npm: 10.5.2 - ~/.nvm/versions/node/v20.13.1/bin/npm SDKs: Android SDK: Android NDK: 26.1.10909125 npmPackages: expo: 51.0.8 => 51.0.8 react: 18.2.0 => 18.2.0 react-dom: 18.2.0 => 18.2.0 react-native: 0.74.1 => 0.74.1 Expo Workflow: managed

Expo Doctor Diagnostics

✔ Check Expo config for common issues ✔ Check package.json for common issues ✔ Check native tooling versions ✔ Check dependencies for packages that should not be installed directly ✔ Check for common project setup issues ✔ Check for issues with metro config ✔ Check npm/ yarn versions ✔ Check Expo config (app.json/ app.config.js) schema ✔ Check that packages match versions required by installed Expo SDK ✔ Check that native modules do not use incompatible support packages ✔ Check for legacy global CLI installed locally ✔ Check that native modules use compatible support package versions for installed Expo SDK

Didn't find any issues with the project!

ChromeQ avatar May 26 '24 06:05 ChromeQ

@brentvatne Adding you as your name comes up on the comment directly above the version and looks like you were right 😅 https://github.com/expo/expo/blob/main/packages/%40expo/config-plugins/src/android/GoogleServices.ts

// NOTE(brentvatne): This may be annoying to keep up to date...
const googleServicesVersion = '4.3.3';

ChromeQ avatar May 26 '24 06:05 ChromeQ

Thank you for filing this issue! This comment acknowledges we believe this may be a bug and there’s enough information to investigate it. However, we can’t promise any sort of timeline for resolution. We prioritize issues based on severity, breadth of impact, and alignment with our roadmap. If you’d like to help move it more quickly, you can continue to investigate it more deeply and/or you can open a pull request that fixes the cause.

expo-bot avatar May 27 '24 12:05 expo-bot

I can confirm the issue, I have the same problem.

bbialas avatar May 31 '24 13:05 bbialas

I can confirm the issue, I have the same problem.

@bbialas Do you use patch-package? For now you can add this to your patches dir and it should build for you (named @expo+config-plugins+8.0.4.patch):

diff --git a/node_modules/@expo/config-plugins/build/android/GoogleServices.js b/node_modules/@expo/config-plugins/build/android/GoogleServices.js
index b228fa7..f579f33 100644
--- a/node_modules/@expo/config-plugins/build/android/GoogleServices.js
+++ b/node_modules/@expo/config-plugins/build/android/GoogleServices.js
@@ -49,7 +49,7 @@ const googleServicesClassPath = 'com.google.gms:google-services';
 const googleServicesPlugin = 'com.google.gms.google-services';
 
 // NOTE(brentvatne): This may be annoying to keep up to date...
-const googleServicesVersion = '4.3.3';
+const googleServicesVersion = '4.4.1';
 const withClassPath = config => {
   return (0, _androidPlugins().withProjectBuildGradle)(config, config => {
     if (config.modResults.language === 'groovy') {

ChromeQ avatar May 31 '24 13:05 ChromeQ

I can confirm the issue, I have the same problem.

@bbialas Do you use patch-package? For now you can add this to your patches dir and it should build for you (named @expo+config-plugins+8.0.4.patch):

diff --git a/node_modules/@expo/config-plugins/build/android/GoogleServices.js b/node_modules/@expo/config-plugins/build/android/GoogleServices.js
index b228fa7..f579f33 100644
--- a/node_modules/@expo/config-plugins/build/android/GoogleServices.js
+++ b/node_modules/@expo/config-plugins/build/android/GoogleServices.js
@@ -49,7 +49,7 @@ const googleServicesClassPath = 'com.google.gms:google-services';
 const googleServicesPlugin = 'com.google.gms.google-services';
 
 // NOTE(brentvatne): This may be annoying to keep up to date...
-const googleServicesVersion = '4.3.3';
+const googleServicesVersion = '4.4.1';
 const withClassPath = config => {
   return (0, _androidPlugins().withProjectBuildGradle)(config, config => {
     if (config.modResults.language === 'groovy') {

Yes, I use it exactly like that as a workaround. Thanks! :)

bbialas avatar May 31 '24 13:05 bbialas

  • I also do manual change in the build.gradle file. Better have a fundamental solution.

12levoav avatar May 31 '24 16:05 12levoav

When will this be released in a new version?

JohnnyFasching avatar Jun 07 '24 08:06 JohnnyFasching