Android build fail (bare)

Hey,

After ejecting earlier today I tried to use eas for the first time (build id → c30d3874-fad1-4886-9a3f-2b0658f2d2e1) and received the following fail error:

Error: sh exited with non-zero code: 1 at ChildProcess.completionListener (/build/node_modules/@expo/spawn-async/build/spawnAsync.js:52:23) at Object.onceWrapper (events.js:422:26) at ChildProcess.emit (events.js:315:20) at ChildProcess.EventEmitter.emit (domain.js:486:12) at maybeClose (internal/child_process.js:1048:16) at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5) … at Object.spawnAsync [as default] (/build/node_modules/@expo/spawn-async/build/spawnAsync.js:17:21) at Object.spawn [as default] (/build/node_modules/@expo/turtle-spawn/dist/index.js:17:42) at Object.runGradleCommand (/build/node_modules/@expo/build-tools/dist/android/gradle.js:22:33) at /build/node_modules/@expo/build-tools/dist/builders/androidGeneric.js:31:24 at BuildContext.runBuildPhase (/build/node_modules/@expo/build-tools/dist/context.js:37:34) at Object.androidGenericBuilder (/build/node_modules/@expo/build-tools/dist/builders/androidGeneric.js:30:15) at async build (/build/dist/android/build.js:64:16) at async Object.buildAndroid [as default] (/build/dist/android/build.js:25:27) at async Object.build (/build/dist/build.js:21:31) at async BuildService.startBuildInternal (/build/dist/service.js:128:33)

you ejected an sdk 40 project, and there is some additional config required for it to work after ejecting. this is resolved ins dk 41.

notice that directly above the error you shared is a more useful error:

[stderr] /build/workingdir/build/android/app/src/main/AndroidManifest.xml Error:
[stderr] 	Attribute data@scheme at AndroidManifest.xml requires a placeholder substitution but no value for <appAuthRedirectScheme> is provided.
> Task :app:mergeReleaseResources
w: Detected multiple Kotlin daemon sessions at build/kotlin/sessions
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.3/userguide/command_line_interface.html#sec:command_line_warnings
916 actionable tasks: 916 executed
[stderr] FAILURE: Build failed with an exception.
[stderr] * What went wrong:
[stderr] Execution failed for task ':app:processReleaseManifest'.
[stderr] > Manifest merger failed : Attribute data@scheme at AndroidManifest.xml requires a placeholder substitution but no value for <appAuthRedirectScheme> is provided.
[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 3m 20s
Error: sh exited with non-zero code: 1

you can repro this locally by running yarn android - if it fails building on your machine, it won’t build on eas build either :slight_smile:

you can fix it by adding this to android/app/build.gradle in the defaultConfig block, possibly under versionName:

manifestPlaceholders = [
  'appAuthRedirectScheme': 'your.app.scheme.here'
]

(of course replace your.app.scheme.here with your scheme)

Like a charm. Thank you!