Error: Standalone Build Failed while building apk

I am a beginner and trying to build my first app.
I get this error when I try to build: Standalone build failed
When I check my gradle error, this is what I got

> Task :app:mergeReleaseResources FAILED
> Task :app:mergeReleaseAssets
> Task :expo:compileReleaseKotlin

[stderr]

FAILURE: Build failed with an exception.

[stderr]

* What went wrong:

[stderr]

Execution failed for task ':app:mergeReleaseResources'.

[stderr]

> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade

[stderr]

   > Android resource compilation failed

[stderr]

     /app/turtle/workingdir/android/sdk44/android-shell-app/app/src/main/res/values/colors.xml:12:3-46: AAPT: error: invalid color.

[stderr]

         

[stderr]

     /app/turtle/workingdir/android/sdk44/android-shell-app/app/src/main/res/values/colors.xml:13:3-55: AAPT: error: invalid color.

[stderr]

         

[stderr]

     /app/turtle/workingdir/android/sdk44/android-shell-app/app/build/intermediates/incremental/mergeReleaseResources/merged.dir/values/values.xml: AAPT: error: file failed to compile.

[stderr]

         

[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 33s
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.9/userguide/command_line_interface.html#sec:command_line_warnings
28 actionable tasks: 28 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:421:26)
    at ChildProcess.emit (events.js:314:20)
    at ChildProcess.EventEmitter.emit (domain.js:483:12)
    at maybeClose (internal/child_process.js:1022:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:287: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:201:45)
    at buildShellAppAsync (/app/turtle/node_modules/@expo/xdl/build/detach/AndroidShellApp.js:985:11)
    at async Object.createAndroidShellAppAsync (/app/turtle/node_modules/@expo/xdl/build/detach/AndroidShellApp.js:396:5)
    at async runShellAppBuilder (/app/turtle/build/builders/android.js:102:9)
    at async Object.buildAndroid [as android] (/app/turtle/build/builders/android.js:50:28)
    at async build (/app/turtle/build/jobManager.js:181:33)
    at async processJob (/app/turtle/build/jobManager.js:118:32)
    at async Object.doJob (/app/turtle/build/jobManager.js:49:5)
    at async main (/app/turtle/build/server.js:66:13)

What colours do you have in app.json?

Also, please run expo diagnostics and paste the output here.

1 Like

This is my app.json

{
  "expo": {
    "name": "FMC Keffi SOP",
    "slug": "sop",
    "version": "1.0.0",
    "orientation": "portrait",
    "icon": "./assets/icon1.png",
    "splash": {
      "image": "./assets/splash2.png",
      "resizeMode": "contain",
      "backgroundColor": "#fffff"
    },
    "updates": {
      "fallbackToCacheTimeout": 0
    },
    "assetBundlePatterns": [
      "**/*"
    ],
    "ios": {
      "supportsTablet": true
    },
    "android": {
      "package":"sop.fmc.keffi",
      "versionCode":1,
      "adaptiveIcon": {
        "foregroundImage": "./assets/adaptive-icon1.png",
        "backgroundColor": "#fffff"
      }
      
    },
    
    "web": {
      "favicon": "./assets/favicon.png"
    }
  }
}

I ran expo diagnostics and this is the result:

Expo CLI 5.2.0 environment info:
System:
OS: Linux 5.13 Ubuntu 20.04.4 LTS (Focal Fossa)
Shell: 5.0.17 - /bin/bash
Binaries:
Node: 14.4.0 - ~/.nvm/versions/node/v14.4.0/bin/node
npm: 8.5.3 - ~/.nvm/versions/node/v14.4.0/bin/npm
npmPackages:
expo: ~44.0.0 => 44.0.6
react: 17.0.1 => 17.0.1
react-dom: 17.0.1 => 17.0.1
react-native: 0.64.3 => 0.64.3
react-native-web: 0.17.1 => 0.17.1
npmGlobalPackages:
eas-cli: 0.47.0
Expo Workflow: managed

You only have 5 "f"s in your backgroundColors. There should be 6.

3 Likes

It worked. Thank you very much

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