'expo build:android' fails: Could not resolve all files for configuration ':app:releaseCompileClasspath'.

Hi, I’m trying to build an APK for my app, but the build is failing with:

[stderr] Note: Some input files use unchecked or unsafe operations.
[stderr] Note: Recompile with -Xlint:unchecked for details.
> Task :expo-barcode-scanner:mergeReleaseResources
[stderr] FAILURE: Build failed with an exception.
[stderr] * What went wrong:
[stderr] Could not resolve all files for configuration ':app:releaseCompileClasspath'.
[stderr] > Could not resolve com.google.android.gms:play-services-ads-identifier:[15.0.1,16.0.0).
[stderr]   Required by:
[stderr]       project :app > com.google.android.gms:play-services-ads:15.0.1
[stderr]    > Failed to list versions for com.google.android.gms:play-services-ads-identifier.
[stderr]       > Unable to load Maven meta-data from https://dl.google.com/dl/android/maven2/com/google/android/gms/play-services-ads-identifier/maven-metadata.xml.
[stderr]          > org.apache.http.ssl.SSLInitializationException: /usr/lib/jvm/java-8-openjdk-amd64/lib/security/cacerts (No such file or directory)
[stderr]    > Failed to list versions for com.google.android.gms:play-services-ads-identifier.
[stderr]       > Unable to load Maven meta-data from https://jcenter.bintray.com/com/google/android/gms/play-services-ads-identifier/maven-metadata.xml.
[stderr]          > Could not get resource 'https://jcenter.bintray.com/com/google/android/gms/play-services-ads-identifier/maven-metadata.xml'.
[stderr]             > org.apache.http.ssl.SSLInitializationException: /usr/lib/jvm/java-8-openjdk-amd64/lib/security/cacerts (No such file or directory)
[stderr]    > Failed to list versions for com.google.android.gms:play-services-ads-identifier.
[stderr]       > Unable to load Maven meta-data from https://google.bintray.com/exoplayer/com/google/android/gms/play-services-ads-identifier/maven-metadata.xml.
[stderr]          > Could not get resource 'https://google.bintray.com/exoplayer/com/google/android/gms/play-services-ads-identifier/maven-metadata.xml'.
[stderr]             > org.apache.http.ssl.SSLInitializationException: /usr/lib/jvm/java-8-openjdk-amd64/lib/security/cacerts (No such file or directory)
[stderr]    > Failed to list versions for com.google.android.gms:play-services-ads-identifier.
[stderr]       > Unable to load Maven meta-data from https://jitpack.io/com/google/android/gms/play-services-ads-identifier/maven-metadata.xml.
[stderr]          > Could not get resource 'https://jitpack.io/com/google/android/gms/play-services-ads-identifier/maven-metadata.xml'.
[stderr]             > org.apache.http.ssl.SSLInitializationException: /usr/lib/jvm/java-8-openjdk-amd64/lib/security/cacerts (No such file or directory)
[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 --scan to get full insights.
[stderr] * Get more help at https://help.gradle.org
[stderr] BUILD FAILED in 52s
258 actionable tasks: 258 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:317:30)
    at emitTwo (events.js:126:13)
    at ChildProcess.emit (events.js:214:7)
    at maybeClose (internal/child_process.js:915:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:209: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:169:43)
    at buildShellAppAsync (/app/turtle/node_modules/@expo/xdl/build/detach/AndroidShellApp.js:697:11)
    at <anonymous>

Anyone know what could be causing this? If you need more info let me know.

Hey @dmtserv,

Can you run expo diagnostics and paste the log that’s printed out here as well as share your app.json?

Cheers,
Adam

Expo Diagnostics:

  Expo CLI 3.0.9 environment info:
    System:
      OS: Linux 5.0 Ubuntu 18.04.3 LTS (Bionic Beaver)
      Shell: 4.4.20 - /bin/bash
    Binaries:
      Node: 10.15.3 - ~/.nvm/versions/node/v10.15.3/bin/node
      Yarn: 1.17.3 - /usr/bin/yarn
      npm: 6.4.1 - ~/.nvm/versions/node/v10.15.3/bin/npm
    npmPackages:
      expo: ^34.0.3 => 34.0.4 
      react: 16.8.3 => 16.8.3 
      react-native: https://github.com/expo/react-native/archive/sdk-34.0.0.tar.gz => 0.59.8 
      react-navigation: ^3.11.1 => 3.11.1 
    npmGlobalPackages:
      expo-cli: 3.0.9

app.json:

{
  "expo": {
    "name": "ROADA React",
    "slug": "roada-react-prod",
    "privacy": "public",
    "sdkVersion": "34.0.0",
    "platforms": [
      "ios",
      "android"
    ],
    "version": "1.2",
    "orientation": "default",
    "icon": "./assets/icon.png",
    "splash": {
      "image": "./assets/splash.png",
      "resizeMode": "contain",
      "backgroundColor": "#ffffff"
    },
    "updates": {
      "fallbackToCacheTimeout": 0
    },
    "assetBundlePatterns": [
      "**/*"
    ],
    "ios": {
      "supportsTablet": true,
      "bundleIdentifier": "com.dmtserv.react",
      "infoPlist": {
        "NSCameraUsageDescription":
        "ROADA React uses the camera to attach photos to reports.",
        "NSPhotoLibraryUsageDescription":
        "ROADA React needs access to your photo library to attach photos to reports.",
        "NSLocationAlwaysUsageDescription":
        "ROADA React needs to access your location to add Lat/Long to reports.",
        "NSLocationUsageDescription":
        "ROADA React needs to access your location to add Lat/Long to reports.",
        "NSLocationWhenInUseUsageDescription":
        "ROADA React needs to access your location to add Lat/Long to reports.",
        "NSLocationAlwaysAndWhenInUseUsageDescription":
        "ROADA React needs to access your location to add Lat/Long to reports."
      }
    },
    "android": {
      "package": "com.dmtserv.react",
      "adaptiveIcon": {
        "foregroundImage": "./assets/icon-round.png",
        "backgroundColor": "#00BCD4"
      }
    },
    "androidStatusBar": {
      "backgroundColor": "#000000"
    }
  }
}

As of this morning my team has been running into the same issue. Here are my expo diagnostics:

  Expo CLI 3.0.6 environment info:
    System:
      OS: macOS 10.14.5
      Shell: 3.2.57 - /bin/bash
    Binaries:
      Node: 12.4.0 - /usr/local/bin/node
      Yarn: 1.17.0 - /usr/local/bin/yarn
      npm: 6.9.0 - /usr/local/bin/npm
    IDEs:
      Android Studio: 3.4 AI-183.6156.11.34.5522156
      Xcode: 10.2.1/10E1001 - /usr/bin/xcodebuild
    npmGlobalPackages:
      expo-cli: 3.0.6

Other people are reporting the same thing on the expo-cli repo in this issue:

I have also started a conversation in the expo slack general channel about this issue (hoping to get some attention).
https://expo-developers.slack.com/archives/C04Q3JTSV/p1566929204375700

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