React-native-code-push: A JS bundle file named "index.android.bundle" could not be found within the downloaded contents

Created on 8 Sep 2016  路  8Comments  路  Source: microsoft/react-native-code-push

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.

Most helpful comment

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.

All 8 comments

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"'
        }

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?

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?

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.

@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.

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.

@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 :)

@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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Adr1ann picture Adr1ann  路  3Comments

chrisjrex picture chrisjrex  路  4Comments

ninjz picture ninjz  路  4Comments

jaysig picture jaysig  路  3Comments

djw27 picture djw27  路  3Comments