You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 20, 2018. It is now read-only.
Hey,
when I'm trying to run app with react-native-cordova-plugin, it builds properly, but crashes instantly after run on tablet / emulator ("Unfortunately, has stopped.").
Android monitor in android studio throws that error: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.appname/com.appname.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void io.cordova.reactnative.CordovaPluginPackage.setSavedInstanceState(android.os.Bundle)' on a null object reference.
My MainActivity.java: (...imports...) public class MainActivity extends ReactActivity {
/**
* Returns the name of the main component registered from JavaScript.
* This is used to schedule rendering of the component.
*/
@Override
protected String getMainComponentName() {
return "appname";
}
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
cordovaPluginPackage = new CordovaPluginPackage(this)
);
}
private CordovaPluginPackage cordovaPluginPackage;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
cordovaPluginPackage.setSavedInstanceState(savedInstanceState);
}
@Override
public void onActivityResult(int requestCode, int resultCode, Intent intent) {
super.onActivityResult(requestCode, resultCode, intent);
cordovaPluginPackage.onActivityResult(requestCode, resultCode, intent);
}
}
I deleted the @OverRide keyword from getPackages() because it didn't compile.
The text was updated successfully, but these errors were encountered:
tomasz-nowak
changed the title
NullPointerException
[QUESTION] NullPointerException
Jan 13, 2017
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hey,
when I'm trying to run app with react-native-cordova-plugin, it builds properly, but crashes instantly after run on tablet / emulator ("Unfortunately, has stopped.").
Android monitor in android studio throws that error:
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.appname/com.appname.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void io.cordova.reactnative.CordovaPluginPackage.setSavedInstanceState(android.os.Bundle)' on a null object reference
.My MainActivity.java:
(...imports...)
public class MainActivity extends ReactActivity {
}
I deleted the @OverRide keyword from getPackages() because it didn't compile.
The text was updated successfully, but these errors were encountered: