React Nativeで`:app:mergeDebugResources FAILED`が出たときの対処

2 min read


yarn コマンド経由で Android エミュレータを起動する際に、その前まではうまくビルドが通っていたが、いきなりビルドが通らなくなったので、その対処法をメモしておきます。

$ yarn start
$ yarn android



yarn run v1.22.10
$ react-native run-android
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 1430 file(s) to forward-jetify. Using 8 workers...
info JS server already running.
info Installing the app...

> Configure project :app
Reading env from: .env

> Configure project :react-native-firebase
react-native-firebase: using React Native prebuilt binary from react-native-project/node_modules/react-native/android

> Configure project :react-native-open-settings
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed soon. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
WARNING: The specified Android SDK Build Tools version (23.0.1) is ignored, as it is below the minimum supported version (28.0.3) for Android Gradle Plugin 3.5.3.
Android SDK Build Tools 28.0.3 will be used.
To suppress this warning, remove "buildToolsVersion '23.0.1'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.

> Task :app:mergeDebugResources FAILED


gradlew clean をすることで解決しました。


$ cd android
$ ./gradlew clean
$ cd ..
$ yarn android


react-native — ディレクトリの作成に失敗しました:project \ Android \ app \ build \ intermediates \ res \ merged \ debug \ values:app:mergeDebugResources FAILED