Skip to content
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

[ANDROID] error: [CodePush] An error has occurred : value@index.android.bundle: #1120

Closed
quy1403 opened this issue Dec 27, 2017 · 5 comments
Closed

Comments

@quy1403
Copy link

quy1403 commented Dec 27, 2017

UPDATE FAILED ONLY ON ANDROID, IOS WORK WELL

Steps to Reproduce

  1. integrate code push according the tutorial (I used wix navigation) and install release app on real device
  2. RUN CMD
    code-push release-react EDUAPP_ANDROID android
    Detecting android app version:

Using the target binary version value "1.0" from "android/app/build.gradle".

Running "react-native bundle" command:

node node_modules/react-native/local-cli/cli.js bundle --assets-dest /var/folders/ts/j35p87tj2rs0qqw6cbfxqkgw0000gn/T/CodePush --bundle-output /var/folders/ts/j35p87tj2rs0qqw6cbfxqkgw0000gn/T/CodePush/index.android.bundle --dev false --entry-file index.js --platform android
Scanning folders for symlinks in /Users/pantoo/Desktop/ReactNative/EduApp/node_modules (18ms)
Scanning folders for symlinks in /Users/pantoo/Desktop/ReactNative/EduApp/node_modules (37ms)
Loading dependency graph, done.
bundle: start
bundle: finish
bundle: Writing bundle output to: /var/folders/ts/j35p87tj2rs0qqw6cbfxqkgw0000gn/T/CodePush/index.android.bundle
bundle: Done writing bundle output
bundle: Copying 1 asset files
bundle: Done copying assets

Releasing update contents to CodePush:

Upload progress:[==================================================] 100% 0.0s
Successfully released an update containing the "/var/folders/ts/j35p87tj2rs0qqw6cbfxqkgw0000gn/T/CodePush" directory to the "Staging" deployment of the "EDUAPP_ANDROID" app.

Expected Behavior

check update, download, install, update my app successfuully

Actual Behavior

can not update but if I kill the app and reopen it, the app is updated successfully
STACK TRACE AND/OR SCREENSHOTS
Checking for update.
12-27 16:30:54.994 8296-8318/? I/ReactNativeJS: [CodePush] Reporting binary update (1.0)
12-27 16:30:55.072 8296-8318/? I/ReactNativeJS: Running application "Login" with appParams: {"initialProps":{"screenInstanceID":"screenInstanceID2","navigatorID":"navigatorID1_nav","navigatorEventID":"screenInstanceID2_events"},"rootTag":1}. DEV === false, development-level warning are OFF, performance optimizations are ON
12-27 16:30:56.149 8296-8318/? I/ReactNativeJS: Downloading package.
12-27 16:30:57.037 8296-8318/? I/ReactNativeJS: Installing update.
12-27 16:30:57.068 8296-8318/? I/ReactNativeJS: [CodePush] An error has occurred : value@index.android.bundle:370:2498
[native code]
s@index.android.bundle:805:7018
index.android.bundle:805:23829
index.android.bundle:812:505
n@index.android.bundle:116:1149
index.android.bundle:116:896
index.android.bundle:116:1331
n@index.android.bundle:116:1149
r@index.android.bundle:116:1406
index.android.bundle:116:1523
index.android.bundle:114:613
index.android.bundle:114:641
index.android.bundle:74:1764
a@index.android.bundle:74:506
o@index.android.bundle:74:870
callImmediates@index.android.bundle:74:3165
value@index.android.bundle:69:2778
index.android.bundle:69:1360
value@index.android.bundle:69:2606
value@index.android.bundle:69:1330
[native code]
value@index.android.bundle:69:1265
[native code]

Reproducible Demo

Environment

"react-native-code-push": "^5.1.3-beta",
"react-native": "0.50.3",
"react-native-navigation": "^1.1.313",

@quy1403
Copy link
Author

quy1403 commented Dec 27, 2017

@ruslan-bikkinin please help me, thanks

@quy1403 quy1403 changed the title [CodePush] An error has occurred : value@index.android.bundle: [ANDROID] error: [CodePush] An error has occurred : value@index.android.bundle: Dec 27, 2017
@ruslan-bikkinin
Copy link
Contributor

ruslan-bikkinin commented Dec 27, 2017

Hi @quy1403 and thanks for submitting the issue.

First of all, please make sure you have configured CodePush SDK on native side as described here: #1088 (comment). Then if it will not help you, please, share with us javascript code sample of how you use CodePush SDK on client side.

@quy1403
Copy link
Author

quy1403 commented Dec 28, 2017

hi @ruslan-bikkinin
thanks for you reply.

  1. (First of all, please make sure you have configured CodePush SDK on native side as described here: App crashing after restart on Android with react-native-navigation when starting app after AsyncStorage access #1088 (comment).) -> I Did it correctly.

my JS Code

*****WHen the app starts

startAppWithScreen(opts) {
       if (this._iconsLoaded) {
           this.startApp(opts)
       } else {
           iconsLoaded
               .then(() => {
                   if(!__DEV__)
                       codePush.sync({
                           installMode: codePush.InstallMode.ON_NEXT_RESTART
                       }, this.codePushStatusDidChange.bind(this));

                   this._iconsLoaded = true;
                   this.startApp(opts);
               }).catch(error => {
               console.error(error)
           })
       }
   }

****my code push handle callback

codePushStatusDidChange(syncStatus) {
        switch (syncStatus) {
            case codePush.SyncStatus.CHECKING_FOR_UPDATE:
                cc.log("Checking for update.");
                break;
            case codePush.SyncStatus.DOWNLOADING_PACKAGE:
                cc.log("Downloading package.");
                break;
            case codePush.SyncStatus.AWAITING_USER_ACTION:
                cc.log("Awaiting user action.");
                break;
            case codePush.SyncStatus.INSTALLING_UPDATE:
                cc.log("Installing update.");
                break;
            case codePush.SyncStatus.UP_TO_DATE:
                cc.log("App up to date.");
                break;
            case codePush.SyncStatus.UPDATE_IGNORED:
                cc.log("Update cancelled by user.");
                break;
            case codePush.SyncStatus.UPDATE_INSTALLED:
                cc.log("Update installed and will be applied on restart.");
                break;
            case codePush.SyncStatus.UNKNOWN_ERROR:
                cc.log("An unknown error occurred.");
                break;
        }
    }

I build release apk and install it on xperia z5, and get logcat from android studio. LOG here

_### _Checking for update.
12-27 16:30:54.994 8296-8318/? I/ReactNativeJS: [CodePush] Reporting binary update (1.0)
12-27 16:30:56.149 8296-8318/? I/ReactNativeJS: Downloading package.
12-27 16:30:57.037 8296-8318/? I/ReactNativeJS: Installing update.
12-27 16:30:57.068 8296-8318/? I/ReactNativeJS: [CodePush] An error has occurred : value@index.android.bundle:370:2498
[native code]
s@index.android.bundle:805:7018__

I think codepush downloaded package successfully, but can not install update. If I kill my app and reopen it. The update was installed and every thing worked as I expect.

NOTE: on IOS, codepush work perfectly
thanks you

@ruslan-bikkinin
Copy link
Contributor

ruslan-bikkinin commented Dec 28, 2017

@quy1403 could you please share the JS code you are using but without unknown methods to us like iconsLoaded, this.startApp(opts) etc? It would be better if you will prepare minimum version of the whole App.js so we could try to reproduce your issue on our side. It is really hard to help you without having full picture.

@sergey-akhalkov
Copy link
Contributor

@quy1403, closing this, please feel free to reopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants