-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Code Push 8.0.0/RN 0.71.6 - StackOverflowError CodePushHash: Resource and asset merger: Duplicate resources #2497
Comments
Having the same issue after upgrading from 7.0.4 to 8.0.1 as well on RN 71 |
This problem is ocurring to me every time I trying to run react-native run-android --variant release. I have to run ./gradlew assembleRelease and install the APK with ADB. No problem with the development command (react-native run-android). |
I had the same problem, but this resolved it for me:
|
I only ran into this issue when I tried to assemble a release build. |
having same issue, tried everything suggested here it's not working |
try |
Any update regarding the fix by |
I am the same issue, there still not have the solution |
Updating to version 8.0.2 while running react native 0.71.11 seems to have fixed the issue for me. edit: it did not fix the duplicate resource issue |
same here, also tried upgrading to latest release (8.0.2) but whenever I clean and build twice the second build breaks with the same log
|
Have the same problem. It works for me if I run |
What is the solution to this? @geof90 |
Any solution for this issue? |
As others have mentioned, it works if you run |
Created a PR for this issue. Waiting for some maintainers to code review, approve, merge and release. |
In my case adding this patch is not actually fixes subsequent builds. This workaround fixes the issue ./gradlew bundleRelease
rm -rf app/build/generated
gradlew assembleRelease |
This trick worked for me. |
Any update on this team ? |
Hi everyone, I'd recommend not cleaning your gradle cache for each build if you're just developing as that'll increase your build time. Important - Below is just my path to the file. You will need to update the part rm ./android/app/build/generated/assets/createBundleStgDebugJsAndAssets/CodePushHash |
This doesn't work for me. My situation is the same as what described here: After a gradlew clean, the second time we run a assemble/bundle command will fail with the error. And third and next runs become OK again. And delete the CodePushHash file before the assemble/bundle does not prevent the error on second run. |
@howg0924 I had to test a build with different settings a while ago, and from the history (and my memory) I can confirm that, at least on my side, deleting the hash works... it weird yours is passing on the third try, are you sure you're deleting the correct one for the flavor you're building? |
@howg0924 , you mentioned the comment with a workaround. Can you confirm the workaround works for you? |
Facing the same issue |
same issue I am using
|
Any idea if the fix @sanduluca created is still valid (PR has been open for ages) and if there will be fix for this. Right now doing ./gradlew clean before each build. There is also deleting just the CodePushHash file, but still needs manual work, so would be great if this would be fixed.
|
@Jonnboy91, I'd like to ask the same of you. Could you please check if the PR functions correctly in your environment? According to the discussion within the PR, it seems to work selectively. I'm thinking of approving and merging it since it doesn't seem to cause any problems, even if it doesn't help everyone. |
We patched that PR into our project last year and have not had any issues since. |
@DmitriyKirakosyan I don't mean to be difficult, but I'd like to push back a little bit on the idea of merging the PR because it doesn't make anything worse. I provided a minimal reproduction with a brand new React Native app that shows the behavior is the same with and without the changes in the PR. I haven't seen evidence showing it actually fixes the problem, so I'm not sure why it should be merged? If someone can provide a minimal reproduction that shows improvement, at least it would give some evidence that there is any improvement (anecdotal evidence without a reproduction isn't very helpful in this case, unfortunately). I've invested quite a bit of time into testing and providing the minimal reproduction, so I'd rather we wait for a proper fix rather than blindly merging changes that help minimally, if at all? |
I've been following this thread for a while as this issue was impacting me. I work around it by using the In this case, I have to side with @brianlenz. I don't tend to like fixes unless I can understand why it's solving the problem, otherwise it's "mystery code". I just took a look at the PR and I don't see how it would resolve the issue: it deletes the resources file if it exists, prior to writing it. |
I'm not currently able to check on my work computer, but for us the problem has actually stopped occuring for some reason 😅 So all good atm and we still have the same version that was release in January, so not exactly sure what has happened or if this is just some issue that happens in some situations (like running/building staging and production or something like that). But yeah I would agree with @fergusean & @brianlenz that a fix that works selectively isn't really a fix and could just be unneccessary to do if it just seems to happen sometimes. Since I had this happening constantly at one point, but now for the last week or so it has worked without any issues. |
This change fixed this issue in my project, does not require calling gradle clean anymore. |
Fixes #2497 Co-authored-by: Djordje Dimitrijev <[email protected]>
Thanks so much for filing an issue or feature request! Please fill out the following (wherever relevant): Recently we have changed react native version from 0.70 -> 0.71. Code push support for react native 0.71.6 is 8.0.0. Since then whenever changes we do in native code, we are getting below errors.
To fix this, for every native android code change we have to do ./gradlew clean and then use react-native run android to fix this issue. This is very very time consuming.
Steps to Reproduce
Expected Behavior
What you expected to happen?
Actual Behavior
What actually happens?
Environment
(The more info the faster we will be able to address it!)
The text was updated successfully, but these errors were encountered: