Expo Build for Android fails

since I’ve added this line - googleServicesFile:"./google-services.json" to my app.json, the Android build started to crash with the following error: “Execution failed for task ‘:app:processReleaseGoogleServices’.”
I’m using this command for the build process: expo build:android -t apk --public-url=myPath.
On the other hand, if I remove the --public-url and run the build with the local app.json (exact same file from the public URL) - the build is finished successfully. Unfortunately, due to some project decisions, I can not remove the --public-url option.

Build: f7b68cc5-9511-4c55-9896-171790470c9d.

Result of the Expo Diagnostics:

 Expo CLI 4.8.1 environment info:
      OS: macOS 11.4
      Shell: 5.8 - /bin/zsh
      Node: 12.22.1 - /usr/local/opt/node@12/bin/node
      Yarn: 1.22.5 - /usr/local/bin/yarn
      npm: 6.14.12 - /usr/local/opt/node@12/bin/npm
      Watchman: 2021.05.31.00 - /usr/local/bin/watchman
      CocoaPods: 1.10.1 - /usr/local/bin/pod
      iOS SDK:
        Platforms: iOS 14.5, DriverKit 20.4, macOS 11.3, tvOS 14.5, watchOS 7.4
      Android SDK:
        API Levels: 23, 25, 26, 27, 28, 29, 30
        Build Tools: 26.0.2, 27.0.0, 27.0.2, 27.0.3, 28.0.3, 29.0.2, 30.0.3
        System Images: android-29 | Intel x86 Atom_64, android-29 | Google APIs Intel x86 Atom, android-29 | Google Play Intel x86 Atom, android-30 | Google APIs Intel x86 Atom, android-30 | Google Play Intel x86 Atom
      Android Studio: 4.1 AI-201.8743.12.41.7042882
      Xcode: 12.5.1/12E507 - /usr/bin/xcodebuild
      expo: ^42.0.0 => 42.0.3 
      react: 16.13.1 => 16.13.1 
      react-dom: 16.13.1 => 16.13.1 
      react-native: https://github.com/expo/react-native/archive/sdk-42.0.0.tar.gz => 0.63.2 
      expo-cli: 4.8.1
    Expo Workflow: managed

the error says that the json is malformed, you should ensure that you are providing a valid json file. you should be able to verify this locally easily by validating the google services json file. try downloading it to ensure you have the correct file

As I wrote down before - if I run the build with the app.json local file, the build finishes successfully and also notifications working properly.

i see. this may be a bug with the --public-url option and expo build. this isn’t a high priority issue for us to investigate at the moment, i’d encourage you to attempt to diagnose the root cause in the expo-cli repository. we’d be happy to review a pr for this.

After further investigation, I found out that the android.googleServicesFile property has to be the content of the google-services.json file and not the path to the file.

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.