You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But when I try with android.enableAapt2=false... I am getting following warnings
The option 'android.enableAapt2' is deprecated and should not be used anymore.
Use 'android.enableAapt2=true' to remove this warning.
It will be removed at the end of 2018..
And I can't execute the app as the debug mode with following error.
And when I try to build the signed apk - ./gradlew assembleRelease
I can build the apk with android.enableAapt2=false
But when install apk and execute it some features are not working
1.react native geolocation
2.https://www.npmjs.com/package/react-native-location-switch
And this is not working either and when I try enable location, app is always crushed
1.Delete the tmp files of the images that were created during the build process. (in tmp\YOURAPP\app\intermediates\res\merged\release\drawable....). The exact path is given by the compiler error.
2.Search for files that have a @-suffix different from @2x or @3x in your app folder and delete them. 3.See https://facebook.github.io/react-native/docs/images.html
4.Sometimes the issue stems from images of a module you use. Search for the images with wrong suffix in the respective node_modules folder and delete them.
DON'T USE the common workaround (which consists in disabling aapt2).
ADDITION you may be using different format of assets for example 1. image.jpg instead of image.png
mekaVR, bestimmaa, idw111, josefheld and poberwongmekaVR and dottifulmekaVR, vuongtuananh and parthflexsin
EDIT of 09-19-2018
delete the images in the node_modules the images that block the build and delete the piece of code above in the android/build.gradle
hi @jdegger my solution posted 15 days ago is not stable. The only solution I found that works every day and delete in the node_modules the images that block the build, and remove the piece of code I posted earlier in android/build.gradle.
My gradle version
------------------------------------------------------------
Gradle 4.10
------------------------------------------------------------
Build time: 2018-08-27 18:35:06 UTC
Revision: ee3751ed9f2034effc1f0072c2b2ee74b5dce67d
Kotlin DSL: 1.0-rc-3
Kotlin: 1.2.60
Groovy: 2.4.15
Ant: Apache Ant(TM) version 1.9.11 compiled on March 23 2018
JVM: 1.8.0_181 (Oracle Corporation 25.181-b13)
OS: Linux 3.10.0-862.11.6.el7.x86_64 amd64
/Users/motogod19/ReactNativeTutorial/MovieToGo/android/app/build/intermediates/res/merged/release/drawable-xhdpi/node_modules_teaset_icons_success.png: error: uncompiled PNG file passed as argument. Must be compiled first into .flat file.. error: failed parsing overlays.
,I try to delete the folder drawable-xhdpi when I type cd android && ./gradlew assembleRelease . It looks like the foler re-create and stills show the same error.
don't delete the folder juste img without prefix @x if I'm wrong the way is node_modules/teaset/icons/success.png or node_modules/teaset_icons/success.png no ? after deleting the image do not forget to delete where it is called in the code of the same module and do not forget to make a ./gradlew clean before ./gradlew assembleRelease
Thnkas @mekaVR , it's really helpful from your help.
EDIT My solution of 09-25-2018
Dlete the images success.pngsmile.pngstop.pnginfo.pngindicator.png under the path node_modules/teaset/icons/ (Depends on what is your error image) and where it is called in the code.
build apk will see another png error: node_modules_reactnavigationstack_dist_views_assets_backicon.png
Add android.enableAapt2=false in gradle.properties and build apk again will see next error node_modules_reactnavigationstack_dist_views_assets_backicon.png: error: **Duplicate file**.
Change assetPathUtil.js file code:
before:
function getAndroidAssetSuffix(scale: number): string {
switch (scale) {
case 0.75: return 'ldpi';
case 1: return 'mdpi';
case 1.5: return 'hdpi';
case 2: return 'xhdpi';
case 3: return 'xxhdpi';
case 4: return 'xxxhdpi';
}
throw new Error('no such scale');
}
after:
// fix upgrade android gradle version from 2 to 3
function getAndroidAssetSuffix(scale) {
switch (scale) {
case 0.75: return 'ldpi-v4';
case 1: return 'mdpi-v4';
case 1.5: return 'hdpi-v4';
case 2: return 'xhdpi-v4';
case 3: return 'xxhdpi-v4';
case 4: return 'xxxhdpi-v4';
}
}
The file path is node_modules\react-native\local-cli\bundle\assetPathUtils.js
Delete the folder android/app/build/intermediates/res/merged/release/drawable-xhdpi. It will cause the duplicate error if your gradle version upgrade to 3.
That's it and don't forget ./gradlew clean before ./gradlew assembleRelease.
If you fix the issue and meet the issue agian next time.
Make sure you do not type the command somthing like react-native bundle --platform android --dev false --entry-file index.android.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res before ./gradlew assembleRelease
If you type the command that will cause the issue happen agian. I have encountered such a situation before.
Just type ./gradlew assembleRelease.
Hope my response can helps.
My environment:
gradle 3.1.4
react-native 55.2
GaneshSaiKumar, adeojoemmanuel and lequangtuananhlequangtuananh
Hello I'm also facing the similar issue, did anyone found the solution for the below issue
uncompiled PNG file passed as argument. Must be compiled first into .flat file..
error: failed parsing overlays.
FAILURE: Build failed with an exception.
@motogod, Following solution worked for me 👍 try it out
I've upgraded my react native to 57.7
react to 16.3.2
build tools gradle to 3.2.0
gradle to 4.6
and removed all drawable* folders
rm -rf android/app/src/main/res/drawable-*
from gradle.properties remove android.enableAapt2=false
I Still have some issue with Android build, please check the attachment or the screen shot below
Actually i used to build my application a month ago, but all of sudden i'm facing issue(scrrenshot)
Can you please me out from this issue.
Hey @GaneshSaiKumar i have tried your solution but it didn't worked for me.
My application has following configuration:
react-native: 0.52.2
react: 16.2.0
uncompiled PNG file passed as argument. Must be compiled first into .flat file.. error: failed parsing overlays. · Issue #4755 · react-navigation/react-navigation
Activity
brentvatne commentedon Jul 24, 2018
#3097
Sim923 commentedon Jul 25, 2018
But when I try with android.enableAapt2=false... I am getting following warnings
The option 'android.enableAapt2' is deprecated and should not be used anymore.
Use 'android.enableAapt2=true' to remove this warning.
It will be removed at the end of 2018..
And I can't execute the app as the debug mode with following error.
Failed to execute aapt
Could you please help me?
Sim923 commentedon Jul 25, 2018
And when I try to build the signed apk - ./gradlew assembleRelease
I can build the apk with android.enableAapt2=false
But when install apk and execute it some features are not working
1.react native geolocation
2.https://www.npmjs.com/package/react-native-location-switch
And this is not working either and when I try enable location, app is always crushed
ggdegreat commentedon Aug 9, 2018
android.enableAapt2=false
only for a workaround and its not recommended. Should waiting for them to release an official fixed on this issue.NaleenDissanayake commentedon Aug 13, 2018
I'm also in trouble with that.
jayfour000 commentedon Aug 15, 2018
Why was this issue closed? It is still a blocking issue for me.
NaleenDissanayake commentedon Aug 15, 2018
yes. This is the solution for this
android.enableAapt2=false
mekaVR commentedon Sep 3, 2018
is not a solution @NaleenDissanay but a circumvention of the problem.
I have the same problem.
NaleenDissanayake commentedon Sep 3, 2018
But it works however
bekchan commentedon Sep 4, 2018
Same problem.
android.enableAapt2=false
helps, but build give this messageI think we need another solution
RameshSain commentedon Sep 4, 2018
1.Delete the tmp files of the images that were created during the build process. (in tmp\YOURAPP\app\intermediates\res\merged\release\drawable....). The exact path is given by the compiler error.
2.Search for files that have a @-suffix different from @2x or @3x in your app folder and delete them. 3.See https://facebook.github.io/react-native/docs/images.html
4.Sometimes the issue stems from images of a module you use. Search for the images with wrong suffix in the respective node_modules folder and delete them.
DON'T USE the common workaround (which consists in disabling aapt2).
ADDITION you may be using different format of assets for example 1. image.jpg instead of image.png
mekaVR commentedon Sep 4, 2018
@bearty
I upgraded gradle version https://gradle.org/install/
and added this in my android/build.gradle
subprojects {
afterEvaluate {project ->
if (project.hasProperty("android")) {
android {
compileSdkVersion 27
buildToolsVersion "27.0.2"
}
}
}
}
and it's work with
android.enableAapt2=true
EDIT of 09-19-2018
delete the images in the node_modules the images that block the build and delete the piece of code above in the android/build.gradle
jdegger commentedon Sep 19, 2018
@mekaVR what gradle version are you on?
mekaVR commentedon Sep 19, 2018
hi @jdegger my solution posted 15 days ago is not stable. The only solution I found that works every day and delete in the node_modules the images that block the build, and remove the piece of code I posted earlier in android/build.gradle.
My gradle version
I hope this will help you
3 remaining items
motogod commentedon Sep 24, 2018
Hi @mekaVR . Thanks for respond, In my error:
/Users/motogod19/ReactNativeTutorial/MovieToGo/android/app/build/intermediates/res/merged/release/drawable-xhdpi/node_modules_teaset_icons_success.png: error: uncompiled PNG file passed as argument. Must be compiled first into .flat file.. error: failed parsing overlays.
,I try to delete the folder
drawable-xhdpi
when I typecd android && ./gradlew assembleRelease
. It looks like the foler re-create and stills show the same error.mekaVR commentedon Sep 24, 2018
don't delete the folder juste img without prefix @x if I'm wrong the way is
node_modules/teaset/icons/success.png
ornode_modules/teaset_icons/success.png
no ? after deleting the image do not forget to delete where it is called in the code of the same module and do not forget to make a./gradlew clean
before./gradlew assembleRelease
I hope I was able to help you
motogod commentedon Sep 25, 2018
Thnkas @mekaVR , it's really helpful from your help.
EDIT My solution of 09-25-2018
Dlete the images
success.png
smile.png
stop.png
info.png
indicator.png
under the pathnode_modules/teaset/icons/
(Depends on what is your error image) and where it is called in the code.build apk will see another png error:
node_modules_reactnavigationstack_dist_views_assets_backicon.png
Add
android.enableAapt2=false
ingradle.properties
and build apk again will see next errornode_modules_reactnavigationstack_dist_views_assets_backicon.png: error: **Duplicate file**.
Change
assetPathUtil.js
file code:before:
after:
The file path is
node_modules\react-native\local-cli\bundle\assetPathUtils.js
Delete the folder
android/app/build/intermediates/res/merged/release/drawable-xhdpi
. It will cause the duplicate error if your gradle version upgrade to 3.That's it and don't forget
./gradlew clean
before./gradlew assembleRelease
.Hope it can helps someone too.
Thanks for @mekaVR help again.
patch for android release
doomsower commentedon Oct 5, 2018
So the upstream issue facebook/react-native#16906 seems to be fixed, but it still doesn't work for me in RN0.57.2 without
android.enableAapt2=false
michaelknoch commentedon Nov 22, 2018
still facing this issue in rn 0.57.5
GaneshSaiKumar commentedon Nov 29, 2018
@motogod
this solution is working sometimes and failing some times
i'm using gradle 4.6
build tools 3.1.0
react-native 55.2
motogod commentedon Nov 29, 2018
@GaneshSaiKumar
If you fix the issue and meet the issue agian next time.
Make sure you do not type the command somthing like
react-native bundle --platform android --dev false --entry-file index.android.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res
before./gradlew assembleRelease
If you type the command that will cause the issue happen agian. I have encountered such a situation before.
Just type
./gradlew assembleRelease
.Hope my response can helps.
My environment:
gradle 3.1.4
react-native 55.2
policz commentedon Dec 12, 2018
Hello I'm also facing the similar issue, did anyone found the solution for the below issue
uncompiled PNG file passed as argument. Must be compiled first into .flat file..
error: failed parsing overlays.
FAILURE: Build failed with an exception.
GaneshSaiKumar commentedon Dec 16, 2018
Thank you @motogod
Is there a way to take off android.enableAapt2=false, since support for aapt version 1 is being removed by the end of 2018.
motogod commentedon Dec 17, 2018
@GaneshSaiKumar Unfortunately, I'm still looking for another solution too.
GaneshSaiKumar commentedon Dec 18, 2018
@motogod, Following solution worked for me 👍 try it out
I've upgraded my react native to 57.7
react to 16.3.2
build tools gradle to 3.2.0
gradle to 4.6
rm -rf android/app/src/main/res/drawable-*
from gradle.properties remove android.enableAapt2=false
#use the following command to bundle assets:
react-native bundle --platform android --dev false --entry-file index.android.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/build/intermediates/res/merged/release/
now generate release apk using following command.
cd android && ./gradlew assembleRelease && cd ..
policz commentedon Jan 9, 2019
Hello @GaneshSaiKumar @motogod
I Still have some issue with Android build, please check the attachment or the screen shot below
Actually i used to build my application a month ago, but all of sudden i'm facing issue(scrrenshot)
Can you please me out from this issue.
Hey @GaneshSaiKumar i have tried your solution but it didn't worked for me.
My application has following configuration:
react-native: 0.52.2
react: 16.2.0
motogod commentedon Jan 11, 2019
@policz Try my EDIT My solution of 09-25-2018.
It may helps.
GaneshSaiKumar commentedon Jan 30, 2019
@policz sry for the late response.
I guess that you have to upgrade react native to 57+ to use my solution.
if you insist that you should be using RN 52 then @motogod 's solution is definitely one, that you can use.
by the way can you quote your build tools version and gradle version