Android build failure

Can someone help with below error for Android build? I tried both building apk and app-bundle:

Error log:

Parsing json file: /app/turtle/workingdir/android/sdk38/android-shell-app/app/google-services.json
[stderr] FAILURE: Build failed with an exception.
[stderr] * What went wrong:
[stderr] Execution failed for task ':app:processReleaseGoogleServices'.
[stderr] > com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 8 path $
[stderr] * Try:
[stderr] Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with 
[stderr] --scan to get full insights.
[stderr] * Get more help at https://help.gradle.org
[stderr] BUILD FAILED in 35s
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.0.1/userguide/command_line_interface.html#sec:command_line_warnings
7 actionable tasks: 7 executed
Error: ./gradlew exited with non-zero code: 1
    at ChildProcess.completionListener (/app/turtle/node_modules/@expo/xdl/node_modules/@expo/spawn-async/build/spawnAsync.js:52:23)
    at Object.onceWrapper (events.js:418:26)
    at ChildProcess.emit (events.js:311:20)
    at ChildProcess.EventEmitter.emit (domain.js:482:12)
    at maybeClose (internal/child_process.js:1021:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
    ...
    at spawnAsync (/app/turtle/node_modules/@expo/xdl/node_modules/@expo/spawn-async/build/spawnAsync.js:17:21)
    at spawnAsyncThrowError (/app/turtle/node_modules/@expo/xdl/build/detach/ExponentTools.js:190:45)
    at buildShellAppAsync (/app/turtle/node_modules/@expo/xdl/build/detach/AndroidShellApp.js:891:11)
    at async Object.createAndroidShellAppAsync (/app/turtle/node_modules/@expo/xdl/build/detach/AndroidShellApp.js:385:5)
    at async runShellAppBuilder (/app/turtle/build/builders/android.js:83:9)
    at async Object.buildAndroid [as android] (/app/turtle/build/builders/android.js:31:28)
    at async build (/app/turtle/build/jobManager.js:158:24)
    at async processJob (/app/turtle/build/jobManager.js:103:32)
    at async Object.doJob (/app/turtle/build/jobManager.js:35:5)
    at async main (/app/turtle/build/server.js:44:13)

Expo diagnostics:

  Expo CLI 3.22.3 environment info:
    System:
      OS: macOS 10.15.5
      Shell: 3.2.57 - /bin/bash
    Binaries:
      Node: 14.2.0 - ~/.nvm/versions/node/v14.2.0/bin/node
      Yarn: 1.17.3 - /usr/local/bin/yarn
      npm: 6.14.5 - ~/.nvm/versions/node/v14.2.0/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    IDEs:
      Android Studio: 3.6 AI-192.7142.36.36.6392135
      Xcode: 11.5/11E608c - /usr/bin/xcodebuild
    npmPackages:
      expo: ^38.0.0 => 38.0.3 
      react: 16.11.0 => 16.11.0 
      react-dom: 16.11.0 => 16.11.0 
      react-native: https://github.com/expo/react-native/archive/sdk-38.0.0.tar.gz => 0.62.2 
      react-native-web: ~0.11.7 => 0.11.7 
    npmGlobalPackages:
      expo-cli: 3.22.3

Hey @girishjjain,

It looks like the error is being thrown from the google-services.json file. Can you make sure have supplied a valid file and also make sure that the file is for the appropriate project and not a different google project.

Cheers,
Adam

Thanks @adamjnav, you’re correct. I had wrong file path for Android platform.

Glad to hear you got things sorted. Good luck with your project moving forward!

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