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

a problem when load the latest jsbundle after download the file in android 0.29+ #47

Open
jianguangyu opened this issue Sep 22, 2016 · 5 comments

Comments

@jianguangyu
Copy link

Hey,I found that i can't load the jsbundle whitch is downloaded from the server in android 0.29+.
Then I override function getJSBundleFile of class ReactNativeHost in file MainApplication.java,like this:
@nullable
@OverRide
protected String getJSBundleFile() {
updater = ReactNativeAutoUpdater.getInstance(getApplicationContext());
updater.setMetadataAssetName("meta.android.json");
String location = updater.getLatestJSCodeLocation();
return location;
}
It worked.
I hope my case will be helpful to you lib.

@DanDance
Copy link

DanDance commented Sep 28, 2016

@jianguangyu, I have error

/Users/danil/Desktop/projects/DriverApp/android/app/src/main/java/com/driverapp/MainApplication.java:40: error: cannot find symbol
updater = ReactNativeAutoUpdater.getInstance(getApplicationContext());
^
symbol: variable updater
/Users/danil/Desktop/projects/DriverApp/android/app/src/main/java/com/driverapp/MainApplication.java:40: error: cannot find symbol
updater = ReactNativeAutoUpdater.getInstance(getApplicationContext());
^
symbol: variable ReactNativeAutoUpdater
/Users/danil/Desktop/projects/DriverApp/android/app/src/main/java/com/driverapp/MainApplication.java:41: error: cannot find symbol
updater.setMetadataAssetName("meta.android.json");
^
symbol: variable updater
/Users/danil/Desktop/projects/DriverApp/android/app/src/main/java/com/driverapp/MainApplication.java:42: error: cannot find symbol
String location = updater.getLatestJSCodeLocation();
^
symbol: variable updater

@jianguangyu
Copy link
Author

@DanDance
Sorry to forget to define the member.
you can add a private member to ReactNativeHost,like this :
private ReactNativeAutoUpdater updater;

@WaydeWang
Copy link

@jianguangyu
I have used the solution you mentioned. But the getJSBundleFile function return null.

@alex44jzy
Copy link

@jianguangyu
i also can get the version changed, But the getJSBundleFile return null... have you got any better ideas.

@yabinliu
Copy link

@alex44jzy solved?

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

No branches or pull requests

5 participants