React-native-code-push: code push on android (unable to build app)

Created on 20 Nov 2018  Â·  8Comments  Â·  Source: microsoft/react-native-code-push

Thanks so much for filing an issue or feature request! Please fill out the following (wherever relevant):

Steps to Reproduce

1.Trying to integrate code push with link command it woked on iOS but is throwing an error on Android

Expected Behavior

It should run seamlessly

Actual Behavior

What actually happens?
can't build an app

Throws an error
Error: ENOENT: no such file or directory, open '/Users/apple/Documents/.../android/app/build/intermediates/assets/debug/CodePushHash'

There is an resolution (https://github.com/Microsoft/react-native-code-push/issues/1427#issuecomment-430913598)
but this didn't help me either

https://github.com/facebook/react-native/commit/a4fed6e203efd481175e61b7d2aa1c2b037a4279
In this the react.gradle file does no have the code as shown in the link above.

Environment

  • react-native-code-push version: "react-native-code-push": "^5.4.2",
  • react-native version: 0.56.0
  • iOS/Android/Windows version: android studio 3.2 gradle version 4.9

  • Does this reproduce on a debug build or release build?
    both

  • Does this reproduce on a simulator, or only on a physical device?
    both
    (The more info the faster we will be able to address it!)
android external

Most helpful comment

Hi @shashankmeddo,

I've found another solution and it's quite simple, you need to set the output directory manually in your project_path/android/app/build.gradle:

project.ext.react = [
    entryFile: "index.js",
    jsBundleDirDebug: "$buildDir/intermediates/merged_assets/debug/mergeDebugAssets/out",
    jsBundleDirRelease: "$buildDir/intermediates/merged_assets/release/mergeReleaseAssets/out"
]

Please try it and let me know if it helped.

All 8 comments

Hi @shashankmeddo,
Thanks for reporting!

I understand your disappointment, but we can't fix this in our repository, because it's basically react-native < 0.57.2 + gradle plugin >= 3.2 incompatibility (as explained in this comment which you mentioned).
Regardless of what we do with our code, you still won't be able to build a release version of your application (even without codepush).

There are three solutions in this case:

  1. You can use gradle plugin 3.1.4.
  2. You can use react-native >= v0.57.2.
  3. (dirty one) Or you can implement this code in your /node_modules/react-native/react.gradle file yourself.

Unfortunately, there's not much we can do about this, we can only warn users about this incompatibility.
I hope my answer was helpful. Feel free to ask any questions if something remains unclear.

Hi
As mentioned earlier I couldn't found this code

from jsBundleDir
into file(config."jsBundleDir${targetName}" ?:
"$buildDir/intermediates/assets/${targetPath}")

hence could not replace with the correct one :(

Now I understand. It's gonna take some time to research and then I'll let you know how to fix it.

Hi @shashankmeddo,

I've found another solution and it's quite simple, you need to set the output directory manually in your project_path/android/app/build.gradle:

project.ext.react = [
    entryFile: "index.js",
    jsBundleDirDebug: "$buildDir/intermediates/merged_assets/debug/mergeDebugAssets/out",
    jsBundleDirRelease: "$buildDir/intermediates/merged_assets/release/mergeReleaseAssets/out"
]

Please try it and let me know if it helped.

Thank you so much, it worked.

On Wed, Nov 21, 2018 at 2:37 PM Yuri Kulikov notifications@github.com
wrote:

Hi @shashankmeddo https://github.com/shashankmeddo,

I've found another solution and it's quite simple, you need to set the
output directory manually in your project_path/android/app/build.gradle:

project.ext.react = [
entryFile: "index.js",
jsBundleDirDebug: "$buildDir/intermediates/merged_assets/debug/mergeDebugAssets/out",
jsBundleDirRelease: "$buildDir/intermediates/merged_assets/release/mergeReleaseAssets/out"
]

Please try it and let me know if it helped.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/Microsoft/react-native-code-push/issues/1456#issuecomment-440589072,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ArHFdYxh1LDbagLeBnv0zg4x_k-UKomqks5uxRfugaJpZM4YrONE
.

That's great!
Thanks for using CodePush!

Hi @yuri-kulikov
I was also facing the same. I did what you suggested in project.ext.react. Now debug build is working fine but release build is not showing local app images like icons.

RN Version - 0.53.3
Gradle Version - 3.2.0

Hi @shashankmeddo,
It is actually an external (react-native) issue, and I'm not sure how react-native 0.53.3 gradle script works with gradle 3.2, maybe you could find something similar (or create an issue) in react-native repository.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

vira-khdr picture vira-khdr  Â·  3Comments

kevando picture kevando  Â·  4Comments

chrisjrex picture chrisjrex  Â·  4Comments

cgerikj picture cgerikj  Â·  3Comments

ninjz picture ninjz  Â·  4Comments