Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Can't create main activity, java.lang.String.split(java.lang.String)' on a null object reference



  • E Qt      : Can't create main activity
    E Qt      : java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String[] java.lang.String.split(java.lang.String)' on a null object reference
    E Qt      : 	at org.qtproject.qt5.android.bindings.QtLoader.startApp(QtLoader.java:613)
    E Qt      : 	at org.qtproject.qt5.android.bindings.QtActivityLoader.onCreate(QtActivityLoader.java:183)
    E Qt      : 	at org.qtproject.qt5.android.bindings.QtActivity.onCreateHook(QtActivity.java:266)
    E Qt      : 	at org.qtproject.qt5.android.bindings.QtActivity.onCreate(QtActivity.java:273)
    E Qt      : 	at android.app.Activity.performCreate(Activity.java:6984)
    E Qt      : 	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1235)
    E Qt      : 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2797)
    E Qt      : 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2923)
    E Qt      : 	at android.app.ActivityThread.-wrap11(Unknown Source:0)
    E Qt      : 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1616)
    E Qt      : 	at android.os.Handler.dispatchMessage(Handler.java:105)
    E Qt      : 	at android.os.Looper.loop(Looper.java:164)
    E Qt      : 	at android.app.ActivityThread.main(ActivityThread.java:6617)
    E Qt      : 	at java.lang.reflect.Method.invoke(Native Method)
    E Qt      : 	at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
    E Qt      : 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:769)
    

    Here's the main:

    int main(int argc, char *argv[])
    {
        qDebug() << "gonna create application";
        QApplication a(argc, argv);
        qDebug() << "gonna create main window";
        MainWindow w;
        w.show();
        return a.exec();
    }
    

    I dont even see those qDebug messages, which means the problem is probably before this.

    Looks like some bug in the Qt itself



  • @lucaszanella could you show your project file (.pro)?

    In addition, do you have any Java code in your project? If so, could you also show that?`

    Just in case, and to check that your Qt Creator/Android environment is setup OK, are you able to run any Android example? like Qt Notifier or Qt JNI Messenger?


Log in to reply