-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Rollback always in production #1096
Comments
Okay, after a few tries I found the problem and a workaround but not a solution. Inside my application I have a backup service that runs in background on Android. I declare a new React Native package:
And in my BackupModule I start the service:
In my BackupDataService I start a new Intent and set to run
Inside my application javascript code I import my module and start the service:
After I removed the call to my background service, rebuild the apk, install on the emulator, open the application, restart the aplication, the update was applied correctly, as you can see in the logs:
Could be this error related to the fact that I don't declare my the ReactInstanceHolder as the docs instruct to do so? The docs says:
But using the react-native-navigation package, my MainApplication.java is extending NavigationApplication.java and I don't know how to declare the ReactInstanceHolder. |
Hi @Fuhrmann and sorry for delayed response. Yes, you problem might be related with fact that you didn't declared ReactInstanceHolder. To declare ReactInstanceHolder you just need to edit import com.microsoft.codepush.react.ReactInstanceHolder;
//implement ReactInstanceHolder interface
public class MainApplication extends NavigationApplication implements ReactInstanceHolder {
///...
@Override
public ReactInstanceManager getReactInstanceManager() {
return getReactNativeHost().getReactInstanceManager();
}
} Please let us know if it solves your problem or any updates. |
Hi! You are right. That was the problem. Thanks so much for the help, I'll close since we solved it. |
Hello! I'm using react-native-navigation and maybe it has something to do with it, so I'll inform this first.
This is my package.json:
My .babelrc is configured correctly so I can use the decorator:
My index.js file:
My App/Containers/App file:
I've already searched in all issues and found a related issue: #875. I've followed the steps and created a custom component that returns null just to make codepush work:
So, I render in my DashboardScreen (the first screen that appears when the user opens the app):
The DashboardScreen is being registered this way:
The
screenWrapper
is just a HOC to apply some default navigation styles that is used in the react-native-navigation package:This is my MainApplication.java:
My deployment key is specified in a
.env.prod
file because I'm usingreact-native-conf
. This file is setup correctly when building from appcenter using aappcenter-pre-build.hs
build script. This is my .env.prod file:My application is being built using AppCenter:
(the build is fine)
While building, the pre build script create the .env.prod file and apply the codepush api key:
I download the APK and install on my simulator and physical device.
When I open the app, the bundle is loded correcly from CodePush:
Right before the DashboardScreen is open, I got the following log:
So the bundle is downloaded, applied, but when the app is restarted by codepush, it crashes:
After the crash, I try to open the app again and the following log is received:
Then in AppCenter I got the rollback results:
So the updated did not complete. I guess the notifyAppReady maybe is not being called?
Steps to Reproduce
I'm using inside my application, so I dont have any steps to reproduce to inform here.
Expected Behavior
I expect that the update is installed on the user's phone.
Actual Behavior
What actually happens?
The application try to update, download the bundle, restarts and rollback.
Environment
If I can provide any other information tell me. Thanks!
The text was updated successfully, but these errors were encountered: