Could not build android app

Please provide the following:

  1. SDK Version:36
  2. Platforms(Android/iOS/web/all): android

Hi, i got an error when build android app. I’m using google login service and make sure that the google-service.json already exist in my project. But the error below always appear. Please help me. Thanks so much!

Could not find google-services.json while looking in [src/nullnull/debug, src/debug/nullnull, src/nullnull, src/debug, src/nullnullDebug]

registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
Could not find google-services.json while looking in [src/nullnull/release, src/release/nullnull, src/nullnull, src/release, src/nullnullRelease]

registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)

Are there any updates about this topic?

Hi

What version of expo-cli do you have installed?

What does your app.json look like? (You can obscure any API keys if you like.)

What exact command are you running?

All those "nullnull"s are a bit weird :confused:

hi @wodin,

I’m using expo-cli v3.11.1 & my app.json looks like below, it have no special thing and i run build with command: expo build:android
{
“expo”: {
“name”: “Demo app”,
“slug”: “Demo app”,
“privacy”: “public”,
“sdkVersion”: “36.0.0”,
“platforms”: [“ios”, “android”, “web”],
“version”: “1.0.8”,
“orientation”: “portrait”,
“icon”: “./src/assets/images/appIcon.png”,
“notification”: {
“icon”: “./src/assets/images/appIcon.png”
},
“updates”: {
“fallbackToCacheTimeout”: 0
},
“assetBundlePatterns”: ["**/*"],
“ios”: {
“supportsTablet”: true,
“bundleIdentifier”: “xxxxxx”,
“config”: {
“googleSignIn”: {
“reservedClientId”: “xxxxxxxxxx”
}
}
},
“android”: {
“package”: “xxxxx”,
// “config”: {
// “googleMaps”: {
// “apiKey”: “xxxxxxxxxxxxx”
// }
// },
“googleServicesFile”: “./google-services.json”
}
}
}

OK. Your expo-cli version is slightly out of date. I doubt that’s the problem, but you may as well upgrade to the latest version.

I see nothing obviously wrong with your app.json, except that you have some // characters before expo.android.config lines. Unfortunately this is not valid JSON. Do you have those in the actual file? Or only in your post here? If you have them in the file, please remove them and try again. Again, it seems unlikely that this JSON syntax error would cause the problem you’re seeing, but they should be fixed anyway.

By the way, in order to keep the formatting of things like the contents of app.json, code, etc. you should add ``` on a line before and after the block of text like this:

```
JSON
here
```

Then it will look more like this:

{
  "expo": {
    "name": "Demo app",
    "slug": "Demo app",
    "privacy": "public",
    "sdkVersion": "36.0.0",
    "platforms": ["ios", "android", "web"],
    "version": "1.0.8",
    "orientation": "portrait",
    "icon": "./src/assets/images/appIcon.png",
    "notification": {
      "icon": "./src/assets/images/appIcon.png"
    },
    "updates": {
      "fallbackToCacheTimeout": 0
    },
    "assetBundlePatterns": ["**/*"],
    "ios": {
      "supportsTablet": true,
      "bundleIdentifier": "xxxxxx",
      "config": {
        "googleSignIn": {
          "reservedClientId": "xxxxxxxxxx"
        }
      }
    },
    "android": {
      "package": "xxxxx",
      // "config": {
      //   "googleMaps": {
      //     "apiKey": "xxxxxxxxxxxxx"
      //   }
      // },
      "googleServicesFile": "./google-services.json"
    }
  }
}

thank you @wodin, let me try to upgrade expo-cli. That’s wonderful if this problem will be resolved

The more important thing is to fix the syntax errors in app.json.

Hi,

I actually built my same project few times with expo(35), but it started crashing on some android phones, so I upgrated to expo(36). Now I can’t build.

Here’s my app.json:

{
  "expo": {
    "name": "ThisApp",
    "description": "This app is great",
    "slug": "this-app",
    "privacy": "unlisted",
    "sdkVersion": "36.0.0",
    "platforms": ["ios", "android", "web"],
    "version": "1.9.0",
    "orientation": "portrait",
    "icon": "./assets/icon.png",
    "splash": {
        "image": "./assets/splash.png",
      "resizeMode": "contain",
      "backgroundColor": "#ffffff"
    },
    "updates": {
      "fallbackToCacheTimeout": 0
    },
    "assetBundlePatterns": ["**/*"],
    "ios": {
      "supportsTablet": false,
      "buildNumber": "19",
      "bundleIdentifier": "xxxxxxxxxxx",
      "splash": {
        "userInterfaceStyle": "light"
      }
    },
    "android": {
      "package": "xxxxxxxx",
      "versionCode": 19,
      "splash": {
        "resizeMode": "cover",
        "mdpi": "./assets/splash.png",
        "hdpi": "./assets/splash@1.5x.png",
        "xhdpi": "./assets/splash@2x.png",
        "xxhdpi": "./assets/splash@3x.png",
        "xxxhdpi": "./assets/splash@4x.png",
        "backgroundColor": "#ffffff"
      }
    },
    "extra": {
      "bugsnag": {
        "apiKey": "xxxxxxxxx"
      }
    }
  }
}

Here’s build log:

[stderr]

Note: Some input files use or override a deprecated API.

[stderr]

Note: Recompile with -Xlint:deprecation for details.

[stderr]

Note: /app/turtle/workingdir/android/sdk36/node_modules/expo-av/android/src/main/java/expo/modules/av/player/PlayerData.java uses unchecked or unsafe operations.

[stderr]

Note: Recompile with -Xlint:unchecked for details.

[stderr]

Note: /app/turtle/workingdir/android/sdk36/node_modules/expo-calendar/android/src/main/java/expo/modules/calendar/CalendarModule.java uses unchecked or unsafe operations.

[stderr]

Note: Recompile with -Xlint:unchecked for details.

[stderr]

Note: Some input files use unchecked or unsafe operations.

[stderr]

Note: Recompile with -Xlint:unchecked for details.

[stderr]

Note: Recompile with -Xlint:deprecation for details.

[stderr]

Note: /app/turtle/workingdir/android/sdk36/node_modules/expo-device/android/src/main/java/expo/modules/device/DeviceModule.java uses or overrides a deprecated API.

[stderr]

Note: /app/turtle/workingdir/android/sdk36/node_modules/expo-camera/android/src/main/java/expo/modules/camera/CameraViewHelper.java uses or overrides a deprecated API.

[stderr]

Note: Recompile with -Xlint:deprecation for details.

Is that the end of the build log? It looks like warnings rather than something that would cause the build to fail. Do you see errors (other than deprecation or “unsafe”/“unchecked” errors)?

Thank you for your quick reply. I didn’t see any errors other than deprecation or “unsafe”/“unchecked” errors.

Release Channel: default
Status: Errored
Platform: android
Duration: 4 minutes

Here’s the end of build log:

> Task :expo-face-detector:generateReleaseResValues
> Task :expo-face-detector:generateReleaseResources
> Task :expo-face-detector:packageReleaseResources
> Task :expo-camera:compileReleaseJavaWithJavac

[stderr]

Note: /app/turtle/workingdir/android/sdk36/node_modules/expo-camera/android/src/main/java/expo/modules/camera/CameraViewHelper.java uses or overrides a deprecated API.

[stderr]

Note: Recompile with -Xlint:deprecation for details.
> Task :expo-face-detector:parseReleaseLibraryResources
> Task :expo-face-detector:processReleaseManifest
> Task :expo-camera:extractReleaseAnnotations
> Task :expo-face-detector:javaPreCompileRelease
> Task :expo-camera:mergeReleaseGeneratedProguardFiles
> Task :expo-camera:mergeReleaseConsumerProguardFiles
> Task :expo-face-detector:mergeReleaseShaders
> Task :expo-camera:mergeReleaseJavaResource
> Task :expo-face-detector:compileReleaseShaders
> Task :expo-face-detector:generateReleaseAssets

OK. Have you tried again in case it was some temporary error on the Expo build farm?

If you have and it failed that time too, I think maybe one of the Expo team members will have to have a look. Please post the build URL. Only you and the Expo team will be able to access the build URL to figure out what’s gone wrong.

Yes, actually I was trying to build over 5 days.

Of course, here’s some of my failed build URLs:

https://expo.io/dashboard/cankatm/builds/25e2d308-27e2-4573-b38e-ce5545af8d4d

https://expo.io/dashboard/cankatm/builds/e38f00de-87ed-47a6-8ce5-f658db92bcfd

https://expo.io/dashboard/cankatm/builds/054c0fc2-f249-40f9-bfd6-eaf2b89b009e

https://expo.io/dashboard/cankatm/builds/bb11f621-e0ce-42da-a005-7d046ac5cf53

hi @cankatm! I took a look at your build logs, and although the first 4 definitely don’t look normal, I’m not exactly sure what caused the build failure

For the last one- it looks like it was cancelled

Job cancelled - killing process

What message do you get in your terminal after the build fails (if any)? Are you building on CI?

Hi @charliecruzan, thank you for your reply.

You’re right, I cancelled one of them. I used expo ba command and after a while I got timeout reached message in my terminal. I watched logs from these URLs, I realized processes starting over and over for couple of times and finally they stopped.

In final stage, I see this message:
Either you don't have permissions to view this page, this object doesn't exist, or our code broke. Refresh to try again.

and

Our code broke

No build job found for id: 8b4a359b-8e4f-43fa-9cfc-e0e49946e23f

I tried almost 15-20 times, I can see some of my build tries in my builds section, but I can’t see most of them.

@cankatm after digging into things on our end, it seems like there could be a problem specific to your app that’s causing it to fail silently. It also looks like whatever the change was that’s causing this, it happened when you upgraded to SDK 36. Were there any other notable changes you made, or was it just the specified upgrade steps

@charliecruzan after I upgraded, I added "userInterfaceStyle": "light" to app.json, and changed react-native-datepicker library to react-native-modal-datetime-picker. But after I saw your message, I removed react-native-modal-datetime-picker parts from my app, and tried to build again. Unfortunately it didn’t work. As I mentioned above, I upgraded to SDK 36 because my earlier(35) app crashed on some android phones. I know there’s a problem on my app (I think it’s about dark mode) but I still don’t understand why I can’t build. :slight_smile:

If you checkout a version of your code from before the upgrade does it build still?

If you then try to upgrade to SDK 36 without making any other changes, does it build?

If you create a new SDK 36 app from scratch, does it build?

hi @wodin,

I created a new SDK 36 app from scratch, it built. :white_check_mark:

I downgraded my current app to SDK 35, it built too. :white_check_mark:

But unfortunately I’m not able to build my current app with SDK 36.

1 Like

I’m afraid you might have to resort to trial and error to figure it out.

1 Like

I have lots of packages in this app, I think some of them causing this error when I upgrade, I’ll try to debug.

Thank you @wodin for your time.

1 Like