Expo build:android failed

My app is working fine on expo client, but when i try to build a standalone apk, it fails.

err :

FAILURE: Build failed with an exception.

[stderr] * What went wrong:

[stderr] Execution failed for task ':app:mergeProdMinSdkProdKernelReleaseResources'.

[stderr] > Error: java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: AAPT2 error: check logs for details

[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 5m 25s

690 actionable tasks: 690 executed

my app.json :

{
  "expo": {
    "name": "project2",
    "description": "This project is really great.",
    "slug": "project2",
    "privacy": "public",
    "sdkVersion": "31.0.0",
    "platforms": [
      "ios",
      "android"
    ],
    "version": "1.0.0",
    "orientation": "portrait",
    "icon": "./assets/icon.png",
    "splash": {
      "image": "./assets/splash.png",
      "resizeMode": "contain",
      "backgroundColor": "#ffffff"
    },
    "ios": {
      "supportsTablet": true,
      "bundleIdentifier": "com.k2a.project2"
    },
    "android": {
      "package": "com.k2a.project2"
    }
  }
}

I’m getting the same error message. Any updates?

Indeed I am getting the exact same message.

{
  "expo": {
    "sdkVersion": "31.0.0",
    "name": "xxxxx",
    "slug": "xxxxx",
    "icon": "src/images/Icon-512.png",
    "platforms": ["android"],
    "privacy": "public",
    "splash": {
      "image": "src/images/splash.png"
    },
    "android": {
      "package": "com.xxxxx.xxxxxx",
      "permissions": [
        "CAMERA",
        "READ_EXTERNAL_STORAGE"
      ],
    }
  }
}

The files used as icon must be also included in assetBundlePatterns. You can try adding

    "assetBundlePatterns": [
      "**/*"
    ],

to your app.json.

(it’s default in new versions of SDK when you init a project with expo-cli)

What’s your Android Studio Version?
Check your Android Sdk Platform- Tools

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