-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
The react-navigation picture resource may cause a package error? #1976
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
我也遇见相同的问题...不知如何解决 |
I don't know if
|
Getting same error on Android Studio 3.0.
|
for now in your top-level gradle.properties file add this line: |
using this workaround leads to:
So at least for me this only shifted the issue
|
what is rest of the error. probably something else in your project causing the true error |
Seems like this only happens on production builds, so maybe it has something todo with proguard. update update2 updated to:
Still having issues. update3 -> workaround works for me now, although I am not happy that I have to use it. |
Gradle tool 3.0.0 beta 6 and android.enableAapt2=false flag in properties now works like a charm |
Quick update: the error is still present with the freshly released Android Studio 3.0, gradle 4.1 & gradle tools 3.0.0 (build tools 26.0.2). I'm investigating on why it happens, it's clearly related to It's clearly related to AAPT2, the new version present in gradle tools 3.0 - but even the migration guide doesn't seem to offer an explanation for this kind of error. This SO answer seems to provide some more details but, yeah, until better explanations, please keep using |
I'm having same issue, but My bad, it should be Anyway I consider this a weird workaround and it's almost clear that is an issue with gradle 3. |
We are facing same issues even after setting Do I need to do something else after setting the property to make it work? @xMikeTx how did you solve the problem. I am facing the same issue as you after setting enableAapt2=false in gradle.properties file. Appreciate any help. Following is my error `/Users/sachingupta/Development/figg/figgapp/android/app/build/intermediates/res/merged/release/drawable-hdpi-v4/node_modules_reactnavigation_src_views_assets_backicon.png: error: Duplicate file.
FAILURE: Build failed with an exception.
BUILD FAILED in 1m 9s |
@figgcoder Does this happen only in the release build? For me it did. I think that happens because you added the mentioned resource files in the react project and in the android project. I solved it by removing all images that are used in the react bundle from the android project. This leads however to that behavior that the resources are not showing in the debug build, but at least the production build works. |
@xMikeTx Thank you for the quick reply. this only happens with release build. I am new to react and don't understand what do you mean by android project and react project. I only added above library by using |
Okay, same here, also my first and last ;) project. project I added my resources to the resources[1] and also in one of the drawable[2] folders which caused my problem. So I removed all duplicate resources from the drawable[2] folders |
I encountered this issue as well, but the |
What exactly should I do with those I have add
|
This is what I discovered:
To make it work, before running
Or, generate signed APKs using android studio. That works as well for some reason. |
Hi @sujayjaju thanks for your comment - does you app works smoothly without the assets in those folders? |
@kelset Yes, the assets do carry over and the app works smoothly. |
Ok so I guess that we could try removing those assets completely? Will investigate/test. |
@sujayjaju, generate signed APKs using android studio was the best alternative until now.
|
Still having this issue. Any ETA for a proper fix instead of workaround? |
Currently, I can't understand why this happens in the first place, as I said here #1976 (comment) - so @soundstage if you have any insight please share it. |
Posted a similar issue on React Native here: facebook/react-native#16906, but no good answer yet. When Android Studio and Gradle are up to date, requiring images on Android fails. |
I added
It seems that this happens due to the Any ideas? |
Indeed, when I removed the This should not be the right approach though... I understand that when we do |
Adding @afilp I think your problem is a different one. Newer Gradle plugin versions requires all app's build configurations to match dependencies'. Google suggested adding
|
Enable Edit:
|
I'm having the same issue and I can't generate signed release apk and this is a BIG issue. The error is:
relative to: setting There is a workaround? I already test the previous workaround in this page I have a deadline and I can not create the apk |
@Ilario17 in the previous comments there are some other "workarounds". Like #1976 (comment) |
@kelset I already test the previous workaround and none seem to works |
You need put it to the right location and try to build it using command. |
@gengjiawen the file node_modules_reactnavigation_src_views_assets_backicon.png is automatically created during the build.. so I'm not putting it in the wrong position |
I mean the |
@gengjiawen Can you explain how I should edit gradle.properties |
@Ilario17 #1976 (comment) |
@kelset @gengjiawen ok maybe you are not reading my post well. |
What do you mean? Your first comment #1976 (comment) is literally detailing the same error that started this issue and that I re-commented here #1976 (comment) And |
In my first comment I have already said that android.enableAapt2=false does not work for me. It doesn't works because it generates a lot of other errors. This is the only workaround? |
Reason why me and @gengjiawen tried to help you figure out why it doesn't work for you, by assuming you were writing Since it looks like it is not the case, I suggest you investigate your Android Studio configuration and your gradle file. |
what's the new error? |
I'm putting android.enableAapt2=false in the right place. the new errors:
|
have you tried to delete the content as proposed here? #1976 (comment) Or to simply go into your node_modules/react-navigation/... folder and remove those image assets? |
Yes I tried to remove images from app/src/main/res but every time I build the images are recreated so.. removing from node_modules does not create problems with the module itself? Are the other errors related to Duplicate files? |
"Error:error: Duplicate file." 2nd line.
It depends, I think it's worth a try in your case, since apparently the standard way doesn't work. If that doesn't work, can you post your |
@kelset @gengjiawen Ok I re-delete images from app/src/main/res and this time they did not recreate themselves, this time Gradle project sync failed no matter what i do and I have this error:
I have already looked at all the dependencies of play-services (used only by one module) This is my dependencies inside my build.gradle:
I already tried to set play-services-gcm:11.2.6 for my build.gradle and push-notification build.gradle but the result is the same. All modules that have After some gradle clean, clean project and 'I hate android' , the app build but crash on start with: |
The crash problem is with fbsdk, not related to this project. |
Yes now for sure is not related to this project. I've only update my situation |
The debug problem : you are not config fbsdk right. release problem : you are import some library twice. |
@Ilario17 it really looks like, as I already said, you have your Android configuration misconfigured. You are using this issue as a chat, which pollutes the overall flow of keeping track of the issue and workarounds. |
Closing in favor of #3097 |
@agrosner solution work for me!
Now I can finally Generating Signed APK for Android. |
Uh oh!
There was an error while loading. Please reload this page.
The text was updated successfully, but these errors were encountered: