-
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
Unable to get the hash of the binary's bundled resources - "codepush.gradle" may have not been added to the build definition. #1981
Comments
i have the same problem, when i use bundleRelease to generate an Android App Bundle i do have this issue, can anyone help us? |
In my tests the file CodePushHash was generated but, has not been copied to assets folder in the bundle |
I wonder if this could be related to this problem here: #1977. I was having problems when setting |
@jessamp where you put the script to make this folders? |
in my case i use product Flavors this folder structure maybe it`s not supported by code push |
I set it up in my build pipelines. It's in a yaml file. If you don't use pipelines, you could probably add a post-script in the npm install step. I also use product flavors. So in that case it would be: |
@alexandergoncharov could you help me with this issue? |
我试了下改codepush.gradle文件后可以一直强制复制CodePushHash后解决了这个问题
可有试一下 |
I ran into microsoft#1981 and upon digging in I noticed that that generateBundledResourcesHash task does not run when org.gradle.configureondemand is set to true. This diff uses afterEvaluate instead of gradle.projectsEvaluated to ensure that the generateBundledResourcesHash is run.
pull request |
What I found trying to solve this:
Any ideas? :) |
Is it working???Anyone |
+1 on this |
I confirm it worked. I must create a patch package with codepush to run post install. |
I'm seeing the same thing as @rafalzawadzki. I tried to use
Any ideas? |
After upgrading our project to RN >= 0.64 the issue resolved itself. Check out this PR: facebook/react-native@53f5500 |
@rafalzawadzki I'm still reproducing the issue in a fresh build after upgrading to RN 0.64. I'm using Gradle 7.1 Alpha 6, so that's probably causing the issue with task ordering between react-native and react-native-code-push gradle files. In testing a fresh build, a |
Update:
Here’s a working environment for release builds (should work for both APK and AAB):
Just to be on the safe side with Gradle 7+, I have opted to disable certain build optimizations:
If your
For anyone that has trouble reproducing the crash with release builds locally, here’s some commands that I found helpful to quickly put a project into a ‘clean’ state without resorting to cloning a fresh copy of the project: |
This issue has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs within 15 days of this comment. |
This issue will now be closed because it hasn't had any activity for 15 days after stale. Please feel free to open a new issue if you still have a question/issue or suggestion. |
I hope that this explains everything and helps to solve the issue: #838 (comment) |
#1981 (comment) worked for me |
Hi my RN Application is crashing for release builds with the error:
[CodePush] Unable to get the hash of the binary's bundled resources - "codepush.gradle" may have not been added to the build definition.
Below you can find my description. Please help!!Steps to Reproduce
gradlew bundleRelease
appcenter codepush release-react -b app.bundle -a <REDACTED>/<REDACTED> -d Staging
Resulting Setup
settings.gradle
app/build.gradle
MainApplication.java
Expected Behavior
The app should load the bundle from CodePush and start properly like when testet with
npx react-native run-android --variant release
Actual Behavior
The app crashes with the following error
Environment
Release build bundle with bundleRelease command
Only on a physical device
The text was updated successfully, but these errors were encountered: