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
RN upgrade 0.56.1 -- app:generateBundledResourcesHashDebug can't find CodePushHash #1427
Comments
I searched the issues again (for the 10th time, with google too) and was able to dig this up:
Manually creating the sub-folders Edit: yet another encounter on SO |
Hi @peacechen! react-native 0.56.1 Here is a part of my
So when And if can provide us with a simple reproducible demo it would be very helpful! |
Hello yuri, and thanks for looking into this. That stage is being skipped:
I don't recall turning that off. Any idea how to enable it? Edit: some information here may be applicable -- However enabling |
Hey @peacechen, you are right, I've created a new react-native 0.56.1 (gradle plugin 3.1.4) app and that stage was also skipped: Then I've tried gradle plugin 3.2.1 and finally reproduced the issue. (It's because Gradle Plugin 3.2 uses a new So if you are using gradle plugin 3.2+ it's also better to use react native 0.57.2+ for better compability. There is a workaround for this: generateBundledResourcesHash = tasks.create(
name: "generateBundledResourcesHash${targetName}",
type: Exec) {
+ doFirst {
+ jsBundleDir.mkdirs()
+ }
commandLine (*nodeExecutableAndArgs, "${nodeModulesPath}/react-native-code-push/scripts/generateBundledResourcesHash.js", resourcesDir, jsBundleFile, jsBundleDir, resourcesMapTempFileName)
} Can you tell me what version of gradle plugin you are using? |
My environment is using Gradle plugin 3.2.0, so it looks like you've found the culprit. We're not ready to upgrade to RN 0.57 due to some of its breaking changes. I could run a postinstall script to patch the codepush.gradle file until a new version is released. Will you be adding that to the repo? If not, I could create a PR. I just need a commit to reference for the patch file. |
Hey @peacechen!
Unfortunately, the problem is that the react-native 0.56 (< 0.57.2) does not support Gradle 3.2, so if you try to run Release version of RN 0.56 (even without CodePush) it just will not work (bundle will not be packed in the application). So our workaround is kinda useless in this case. I see two solutions:
P.S. and for the rest of those who are also looking for a solution:
project.ext.react = [
entryFile: "index.js",
jsBundleDirDebug: "$buildDir/intermediates/merged_assets/debug/mergeDebugAssets/out",
jsBundleDirRelease: "$buildDir/intermediates/merged_assets/release/mergeReleaseAssets/out"
] |
Thanks @yuri-kulikov for digging up that obscure bug! I would've burned hours trying to figure out why the production build failed. I owe ya one. 🍺 |
You're welcome🍺 I'm happy to help! |
Hi @yuri-kulikov, the solution that you mentioned here is not working for my react native project. The React native version is 0.58.6 and Gradle version is 4.7. Can you please help me out in this. |
@anmol-appzoy |
Task :app:generateBundledResourcesHashRelease FAILED no such file or directory, scandir /react-native-code-push/scripts/getFilesInFolder.js jenkins #1771 Had same issue react-native": "0.60.5" local its working fine but jenkins build failed with this issue ..need help.here . is the log
Error: ENOENT: no such file or directory, scandir '/home/jenkins/workspace///android/app/build/generated/res/react/release' |
Hi! I'm getting a similar problem, but with my release builds. `
In my android/app/build.gradle file, I added this line in the config block: I tried the solutions above, but nothing seemed to fix it. I'm also curious why with the debug builds this task is skipped, but for release builds it's not? We're using: |
Steps to Reproduce
I upgraded an existing project to RN 0.56.1. Previously the app built and ran on Android, but fails after the upgrade.
Are there any special steps needed for RN 0.56? I scanned through the documentation and the setup is correct (same as before).
Perhaps of note is that I had to upgrade to Gradle 4.6 and associated tools (Android SDK 28, etc).
Expected Behavior
Build & run on Android without errors
Actual Behavior
Result of
react-native run-android
. The fileCodePushHash
doesn't exist.Reproducible Demo
Can't repro the complex environment of our app in the example project.
Environment
The text was updated successfully, but these errors were encountered: