expo / expo/eas-cli

Build failing when using app.json splash config without backgroundColor - AAPT: error: resource color/splashscreen_background

Open
#2,442 4 comments 3 reactions 0 assignees View on GitHub
needs review
Dominant language
TypeScript
Stars
1.4k
Forks
236
Avg merge
3d 8h
Merged PRs (30d)
98

Description

### Summary

Android build using on local and remote EAS build if app.json splash:{ backgroundColor } is not specified.

I upgraded the app from expo 49 to expo 51 and the eas-cli to lastest version. Previously the app build worked without issues for android with only splash:{ image } being specified. After the upgrade the build fails and the solution was to add a color value for the splash:{ backgroundColor } attribute

fails:
```json
{
"expo": {
"splash": {
"image": "./app/assets/splashscreen_background.png"
}
}
}
```

succedes:
```json
{
"expo": {
"splash": {
"image": "./app/assets/splashscreen_background.png",
"backgroundColor": "#ffffff"
}
}
}
```

### Managed or bare?

Managed

### Environment

```
| expo-env-info 1.2.0 environment info:
System:
OS: macOS 13.6.7
Shell: 5.9 - /bin/zsh
Binaries:
Node: 18.20.2 - ~/.asdf/installs/nodejs/18.20.2/bin/node
Yarn: 3.2.1 - ~/.asdf/installs/nodejs/18.20.2/bin/yarn
npm: 10.5.0 - ~/.asdf/plugins/nodejs/shims/npm
Watchman: HEAD-067252e - /opt/homebrew/bin/watchman
SDKs:
iOS SDK:
Platforms: DriverKit 22.2, iOS 16.2, macOS 13.1, tvOS 16.1, watchOS 9.1
IDEs:
Android Studio: 2022.2 AI-222.4459.24.2221.10121639
Xcode: 14.2/14C18 - /usr/bin/xcodebuild
npmPackages:
expo: 51 => 51.0.14
react: 18.2.0 => 18.2.0
react-native: 0.74.2 => 0.74.2
npmGlobalPackages:
eas-cli: 10.0.2
Expo Workflow: managed
```

```
✔ Check Expo config for common issues
✔ Check package.json for common issues
✔ Check native tooling versions
✔ Check dependencies for packages that should not be installed directly
✔ Check for common project setup issues
✔ Check for issues with metro config
✔ Check npm/ yarn versions
✔ Check Expo config (app.json/ app.config.js) schema
✔ Check that packages match versions required by installed Expo SDK
✔ Check that native modules do not use incompatible support packages
✔ Check for legacy global CLI installed locally
✔ Check that native modules use compatible support package versions for installed Expo SDK

Didn't find any issues with the project
```

### Error output
```
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processReleaseResources'.
> A failure occurred while executing com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask$TaskAction
> Android resource linking failed
ERROR: /home/expo/workingdir/build/android/app/src/main/res/drawable/splashscreen.xml:2: AAPT: error: resource color/splashscreen_background (aka com.app.redactred:color/splashscreen_background) not found.

* Try:
> 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.
> Get more help at https://help.gradle.org.
BUILD FAILED in 8m 15s
```
### Reproducible demo or steps to reproduce from a blank project

I don't have time to create demo but I assume if you create project with the latest expo
add `app.json`/`app.config.js` splash with `image` without `backgroundColor` property and use `eas` to build the app for android.

Current behaviour is not consistent with the expo-doctor schema validation, and with types specified for ExpoConfig where the backgroundColor is optional.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.