Closed yulunjiang closed 2 years ago
I hope this correction can be arranged into the plan . Thanks!
There are some wrong code in the codepush.gradle
cause the task generateBundledResourcesHash
can not skipped.
if (variant.hasProperty("bundleJsAndAssets")) {
def reactBundleTask = variant.bundleJsAndAssets
jsBundleDir = reactBundleTask.generatedAssetsFolders[0].absolutePath
resourcesDir = reactBundleTask.generatedResFolders[0].absolutePath
jsBundleFile = file("$jsBundleDir/$bundleAssetName")
generateBundledResourcesHash = tasks.create(
name: "generateBundledResourcesHash${targetName}",
type: Exec) {
commandLine (*nodeExecutableAndArgs, "${nodeModulesPath}/react-native-code-push/scripts/generateBundledResourcesHash.js", resourcesDir, jsBundleFile, jsBundleDir)
// wrong code :
enabled config."bundleIn${targetName}" ||
config."bundleIn${variant.buildType.name.capitalize()}" ?:
targetName.toLowerCase().contains("release")
}
}
replace this:
// correct code :
enabled config."bundleIn${targetName}" != null
? config."bundleIn${targetName}"
: config."bundleIn${variant.buildType.name.capitalize()}" != null
? config."bundleIn${variant.buildType.name.capitalize()}"
: targetName.toLowerCase().contains("release")
then it's work well!
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.
This is still hapenning! Can we reopen it?
Hi @lucianobracco-geojam , would you able to check if the fix in https://github.com/microsoft/react-native-code-push/issues/2182/#issuecomment-968716466 works for you?
Steps to Reproduce
android/app/build.gradle
set flagbundleInRelease: false
make sure flag to add it before theapply from: "../../node_modules/react-native/react.gradle"
apply from: "../../node_modules/react-native-code-push/android/codepush.gradle"
line.Expected Behavior
Build & run on Android without errors
Actual Behavior
What actually happens?
Environment