2
votes

Facing problem while running ./gradlew assembleRelease to generate APK in react native.

Error: Uncompiled PNG file passed as argument. Must be compiled first into .flat file.. error: failed parsing overlays

I already tried setting android.enableAapt2=false. It allows me to generate APK but unable to install APK in device using generated APK.

Actually I am using react-native-camera in application with following

classpath 'com.android.tools.build:gradle:3.1.0',
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip

How can I resolve this issue?

1
If disabling aapt2 didn't work for you, please see this answer: stackoverflow.com/a/51397028/4884617Shaked Sayag

1 Answers

3
votes

There's another option you can try in gradle.properties which is org.gradle.configureondemand=true. So use that instead of android.enableAapt2=false.

Run ./gradlew clean after.