react-native-code-push icon indicating copy to clipboard operation
react-native-code-push copied to clipboard

A JS bundle file named "index.android.bundle" could not be found within the downloaded contents

Open sopaco opened this issue 10 years ago • 8 comments

I execute code-push release-react com.tongren.goldgot android -d Staging, but receive an error about the update-contents could't be fould. What's wrong?

 Checking for update.
[06:57:12] Downloading package.
[06:58:15] An unknown error occurred.
[06:58:15] Update is invalid - A JS bundle file named "index.android.bundle" could not be found within the downloaded contents. Please check that you are releasing your CodePush updates using the exact same JS bundle file name that was shipped with your app's binary.

sopaco avatar Sep 08 '16 11:09 sopaco

the problem was I add a build-schema in android/app/build.gradle, if I use release schema + Production key, it could works, but use my staging_release schema+Staging key, it show that error message

staging_release {
            initWith(buildTypes.release)

            buildConfigField "boolean", "couldDebug", 'true'
            buildConfigField "String", "deployName", '"staging_release"'
            buildConfigField "String", "SHD_CD_KEY", '"xxxxxxxxxxxxxxxxxx"'
        }

sopaco avatar Sep 08 '16 11:09 sopaco

If you downloaded the latest update on Staging, are you able to see what is in the contents? Do you indeed see that index.android.bundle file? Could you have published an iOS update to Staging and downloaded it from and android client by accident?

geof90 avatar Sep 08 '16 19:09 geof90

i found sometimes it could update and install properly, but sometimes not, in fact it was nothing to do with the release/staging @geof90 how do I determine what's wrong?

sopaco avatar Sep 09 '16 09:09 sopaco

Is it possible that you published an iOS update to the same deployment, instead of an Android one? We recommend that iOS and Android be kept as separate CodePush apps to avoid confusion.

richardhuaaa avatar Sep 13 '16 20:09 richardhuaaa

@silhouettes ✌️It's my falut, previously I thought the code-push could be able to distinguish between Android and IOS via the deployment {app-name} android/ios parameter. Infact it must be seperated by different app-name.

sopaco avatar Sep 20 '16 05:09 sopaco

Thank you @sopaco! We are soon hoping to add built-in platform support (distinguishing between iOS and Android) for apps, but we're not there yet.

richardhuaaa avatar Sep 20 '16 18:09 richardhuaaa

@silhouettes Is it best practice to have separate CodePush apps for android/ios? I might have missed it, but is this explained in the documentation somewhere? Thanks :)

hongkim91 avatar May 08 '17 22:05 hongkim91

@honki91 - hi, some additional information regarding this can be found here and there.

If your app targets both iOS and Android, please create separate apps for each platform with CodePush (see the note below for details).

Note, if you are targeting both platforms it is recommended to create separate CodePush applications for each platform.

max-mironov avatar May 09 '17 06:05 max-mironov