React native build release error: uncompiled PNG file passed as argument. Must be compiled first into .flat file..
Error: uncompiled PNG file passed as argument. Must be compiled first into .flat file.. error: failed parsing overlays.
How to fix
DO NOT use android.enableAapt2=false in android/gradle.properties for temporary fixing. You will get the warning:
Use 'android.enableAapt2=true' to remove this warning.
It will be removed at the end of 2018..
DO
android/gradle.properties: keep as original
android.useDeprecatedNdk=true
android/build.gradle: upgrade gradle to 3.2.1
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
}
}
Full script of android/build.gradle
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
}
}allprojects {
repositories {
google()
mavenLocal()
jcenter()
maven {
url "$rootDir/../node_modules/react-native/android"
}
}
}