Closed igorclark closed 8 years ago
OK, after much digging, it turns out it was an error in our code. (Natch.) Sorry to have troubled you.
No worries, thanks so much for the update @igorclark and feel free to come back if you have any other issues!
@igorclark Can you tell what was the problem with your code. I'm exactly struck in the same problem.
Hello @sriraman, I'm afraid I can't remember exactly, but I think I was doing something pretty dumb. I do seem to remember that it wasn't really related to CodePush, it was more an error somewhere else in my code that was meaning the paths weren't right, or something like that. Sorry not to be able to shed more light.
For anyone else who has stumbled across this error and are trying to figure out the issue, the MainApplication.java
isn't set up correctly and needs to be set up as directed in the README.
More specifically, I was messing around with getJSMainModuleName()
not realising that ReactNativeHost
has a method called. getJSBundleFile()
that I'd have to override myself. What I ended up doing was copying the following:
@Override
protected String getJSBundleFile() {
return CodePush.getJSBundleFile();
}
right in the ReactNativeHost
block of code, so my code ended up looking like:
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
@Override
public boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
}
@Override
protected List<ReactPackage> getPackages() {
List<ReactPackage> packages = new PackageList(this).getPackages();
// bunch of old packages which original repo was never updated. CodePush wasn't here as I was on RN 0.61
return packages;
}
@Nullable
@Override
protected String getJSBundleFile() {
return CodePush.getJSBundleFile();
}
@Override
protected String getJSMainModuleName() {
return "index";
}
};
Hi @igorclark !
I need your urgent help. I am getting error that:
com.microsoft.codepush.react.CodePushInvalidUpdateException: Update is invalid - A JS bundle file named "null" 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. at com.microsoft.codepush.react.CodePushUpdateManager.downloadPackage(CodePushUpdateManager.java:255) at com.microsoft.codepush.react.CodePushNativeModule$3.doInBackground(CodePushNativeModule.java:290) at com.microsoft.codepush.react.CodePushNativeModule$3.doInBackground(CodePushNativeModule.java:284)
@atifaziz1 getting same issue again on react native version 0.68.1, Please give me solution . also created new project getting same error on fresh project too. Please help me if you found solution
In my case, I was making the edits in MainApplicationReactNativeHost.java
file (As per doc for RN 0.68 - 0.70).
Instead of this this file, use MainApplication.java.
Hi!
code-push
works great on our React Native app under iOS, even when pushed through into TestFlight and running a full release build. Running the identical React Native code on Android runs into this problem, where it can't seem to find the name of the bundle it's trying to replace.Here's how we're running the Android release build:
And this is how we're building and deploying the
code-push
Android deployment:The same error happens whether on debug or release builds, on the simulator or on-device, and regardless of whether we specify
--bundleName index.android.bundle
in the Code Push deploy command.Are we missing something? How should we specify bundle names/locations, if so? If not, is this a bug?
Thanks for your help! 😊