Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Qt 5.1 and Android unable to start 'org.qtproject.example.myFirstAndroidApp'

Qt 5.1 and Android unable to start 'org.qtproject.example.myFirstAndroidApp'

Scheduled Pinned Locked Moved Mobile and Embedded
25 Posts 6 Posters 20.1k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    andrea993.93
    wrote on last edited by
    #1

    I tried Qt 5.1 on Windows 8 and on Ubuntu 13.04. I'm trying to start an application for Android.
    I've set the Android parameters on settings and it compile without problems, but when I try to launch the application on the real device or on the emulator I get this error: "unable to start 'org.qtproject.example.myFirstAndroidApp'"
    I've tried with api level 10 and 17.
    Maybe I should install Ministro first?

    Thank you

    1 Reply Last reply
    0
    • M Offline
      M Offline
      Moster
      wrote on last edited by
      #2

      Maybe check adb logcat. It might give some more information than qt creator

      Ministro is not recommended for qt5.1

      1 Reply Last reply
      0
      • S Offline
        S Offline
        stereomatching
        wrote on last edited by
        #3

        [quote author="Moster" date="1372276286"]Maybe check adb logcat. It might give some more information than qt creator

        Ministro is not recommended for qt5.1[/quote]
        If ministro is not recommended, then we have a big problem
        We should package all of the libraries we need or wait for Qt5.2
        a full support for android

        1 Reply Last reply
        0
        • A Offline
          A Offline
          andrea993.93
          wrote on last edited by
          #4

          I think that the problem is the qt library on device.
          logcat report:
          @E/Qt ( 977): Can't create main activity
          E/Qt ( 977): java.io.FileNotFoundException: /data/data/org.qtproject.example.prova0/lib/lib--Managed_by_Qt_Creator--plugins_platforms_libqoffscreen.so (No such file or directory)
          E/Qt ( 977): at org.apache.harmony.luni.platform.OSFileSystem.open(Native Method)
          E/Qt ( 977): at dalvik.system.BlockGuard$WrappedFileSystem.open(BlockGuard.java:232)
          E/Qt ( 977): at java.io.FileInputStream.<init>(FileInputStream.java:80)
          E/Qt ( 977): at java.io.FileInputStream.<init>(FileInputStream.java:132)
          E/Qt ( 977): at org.qtproject.qt5.android.bindings.QtActivity.createBundledBinary(QtActivity.java:366)
          E/Qt ( 977): at org.qtproject.qt5.android.bindings.QtActivity.extractBundledPluginsAndImports(QtActivity.java:386)
          E/Qt ( 977): at org.qtproject.qt5.android.bindings.QtActivity.startApp(QtActivity.java:436)
          E/Qt ( 977): at org.qtproject.qt5.android.bindings.QtActivity.onCreate(QtActivity.java:688)
          E/Qt ( 977): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
          E/Qt ( 977): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
          E/Qt ( 977): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
          E/Qt ( 977): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
          E/Qt ( 977): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
          E/Qt ( 977): at android.os.Handler.dispatchMessage(Handler.java:99)
          E/Qt ( 977): at android.os.Looper.loop(Looper.java:123)
          E/Qt ( 977): at android.app.ActivityThread.main(ActivityThread.java:3683)
          E/Qt ( 977): at java.lang.reflect.Method.invokeNative(Native Method)
          E/Qt ( 977): at java.lang.reflect.Method.invoke(Method.java:507)
          E/Qt ( 977): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
          E/Qt ( 977): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
          E/Qt ( 977): at dalvik.system.NativeStart.main(Native Method)
          @

          But this error occurs when I set "use qt library from device".
          If I set "Deploy local qt libraries" on the device I get an error which say that ministro is not installed.
          Then what should I do to install a qt project on Android?

          1 Reply Last reply
          0
          • M Offline
            M Offline
            Moster
            wrote on last edited by
            #5

            On qt5 you should use "Use Qt libraries from device" and also tick "Use local Qt libraries". Then the apk will include all the necessary libraries.
            Would you mind to share your source code of that example, with the .pro file?

            1 Reply Last reply
            0
            • A Offline
              A Offline
              andrea993.93
              wrote on last edited by
              #6

              I already tried to check those options but the same error occurs.
              I'm trying to launch the hello world generated when I choose qt quick 2 application.

              1 Reply Last reply
              0
              • A Offline
                A Offline
                andrea993.93
                wrote on last edited by
                #7

                If you had launched a qt application on android successfully can you tell me the operations that you had done?
                thank you

                1 Reply Last reply
                0
                • M Offline
                  M Offline
                  Moster
                  wrote on last edited by
                  #8

                  Im already working with it on android.

                  Can I know which smartphone you tried to use + android version?

                  Did you actually download the SDK and the android APIs?

                  Do you use the latest NDK?

                  Have you set OpenJDK location and also ant location?

                  1 Reply Last reply
                  0
                  • A Offline
                    A Offline
                    andrea993.93
                    wrote on last edited by
                    #9

                    I have all this software and I have already set the paths, all this software is in the last version. I've downloaded all yesterday.
                    I can build the project so it work. I'm trying with the emulator (nexus 5), with API level 10 and 11.
                    there are not compile errors and the installation on device work correctly but when the application start I can see only a black screen,and the application output on qt creator tell that error.
                    I've tried with windows and Ubuntu, I've also formatted and reinstalled Ubuntu but it doesn't work.
                    I'm trying with qt quick 2 application.
                    which kind of project do you use?

                    1 Reply Last reply
                    0
                    • M Offline
                      M Offline
                      Moster
                      wrote on last edited by
                      #10

                      Im using an empty qt project and write the stuff on my own.

                      1 Reply Last reply
                      0
                      • A Offline
                        A Offline
                        andrea993.93
                        wrote on last edited by
                        #11

                        Can you write me the code that works for you, please?. So I can try it

                        1 Reply Last reply
                        0
                        • M Offline
                          M Offline
                          Moster
                          wrote on last edited by
                          #12

                          Ok, here is a small project that only contains an exit button
                          The name is simpleWidget. Please test it on a real device.

                          simpleWidget.pro
                          @TEMPLATE = app
                          TARGET = simpleWidget

                          QT = core widgets gui

                          OTHER_FILES +=
                          android/version.xml
                          android/src/org/qtproject/qt5/android/bindings/QtActivity.java
                          android/src/org/qtproject/qt5/android/bindings/QtApplication.java
                          android/src/org/kde/necessitas/ministro/IMinistro.aidl
                          android/src/org/kde/necessitas/ministro/IMinistroCallback.aidl
                          android/res/values-el/strings.xml
                          android/res/values-nb/strings.xml
                          android/res/values-zh-rCN/strings.xml
                          android/res/values-id/strings.xml
                          android/res/values-ja/strings.xml
                          android/res/values-zh-rTW/strings.xml
                          android/res/values-de/strings.xml
                          android/res/values-fr/strings.xml
                          android/res/values-pl/strings.xml
                          android/res/values-ro/strings.xml
                          android/res/values-it/strings.xml
                          android/res/values-es/strings.xml
                          android/res/values-pt-rBR/strings.xml
                          android/res/values-fa/strings.xml
                          android/res/layout/splash.xml
                          android/res/values-rs/strings.xml
                          android/res/values-ms/strings.xml
                          android/res/values-et/strings.xml
                          android/res/values/strings.xml
                          android/res/values/libs.xml
                          android/res/values-nl/strings.xml
                          android/res/values-ru/strings.xml
                          android/AndroidManifest.xml

                          SOURCES +=
                          Main.cpp
                          window.cpp

                          HEADERS +=
                          window.h
                          @

                          main.cpp
                          @#include <QApplication>
                          #include <window.h>

                          int main(int argc, char** argv){

                          QApplication app(argc, argv);
                          
                          Window window;
                          
                          window.showMaximized();
                          
                          return app.exec&#40;&#41;;
                          

                          }@

                          window.cpp
                          @#include "window.h"
                          #include <QPushButton>
                          #include <QApplication>

                          Window::Window(QWidget *parent) :
                          QWidget(parent)
                          {
                          button = new QPushButton("Exit", this);

                              button->setGeometry(10,10, 300, 300);
                          
                          
                              connect(button, SIGNAL(clicked()), QApplication::instance(), SLOT(quit()));
                          

                          }
                          @

                          window.h
                          @#ifndef WINDOW_H
                          #define WINDOW_H

                          #include <QWidget>

                          class QPushButton;
                          class Window : public QWidget
                          {
                          Q_OBJECT
                          public:
                          explicit Window(QWidget *parent = 0);

                          signals:

                          public slots:

                          private:
                          QPushButton *button;

                          };

                          #endif // WINDOW_H
                          @

                          1 Reply Last reply
                          0
                          • L Offline
                            L Offline
                            linziwen
                            wrote on last edited by
                            #13

                            i have the same problem.i find out that the config of the emulator is bo be blamed.you can try to config it using "armeabi-v7a" instead of "armeabi",or just to choose the android-15 api or above.

                            1 Reply Last reply
                            0
                            • N Offline
                              N Offline
                              niks_android
                              wrote on last edited by
                              #14

                              I tried to run the Qt Quick 2 Application (Built in elements) on my android device (version 4.2.2) using API 17. It compiles successfully but on application output window i get this:
                              "Starting remote process.Unable to start 'org.qtproject.example.Sample2'."

                              On my device, i see a black screen.
                              In compile logs i see - "WARNING: No minSdkVersion value set. Application will install on all Android versions.", which seems to be favourable.

                              Can anyone suggest where am I going wrong?

                              1 Reply Last reply
                              0
                              • M Offline
                                M Offline
                                Moster
                                wrote on last edited by
                                #15

                                I have only tested this stuff on linux (ubuntu 12.04 and 13.04), talking about qtcreator. For me it runs great. What do you use?

                                I guess usb debugging is turned on, otherwise it would try to start the emulator

                                Maybe check adb logcat if it says more than qtcreator

                                1 Reply Last reply
                                0
                                • N Offline
                                  N Offline
                                  niks_android
                                  wrote on last edited by
                                  #16

                                  I am using Qt Creator 2.7.2 based on Qt 5.1.0 on Windows7 32-bit OS.
                                  Yes, USB debugging is ON (I think that is a mandate)

                                  Firstly i want to make it work on the emulator.
                                  On that too, it displays the same error and black screen.

                                  AVD Manager settings: Data partition size: 1024 Mb
                                  AVD Target: API17
                                  CPU/ABI: armeabi-v7a

                                  1 Reply Last reply
                                  0
                                  • M Offline
                                    M Offline
                                    Moster
                                    wrote on last edited by
                                    #17

                                    What does "adb logcat" say when you try to run the app?

                                    1 Reply Last reply
                                    0
                                    • A Offline
                                      A Offline
                                      andrea993.93
                                      wrote on last edited by
                                      #18

                                      Moster, which api Level do you use?

                                      1 Reply Last reply
                                      0
                                      • M Offline
                                        M Offline
                                        Moster
                                        wrote on last edited by
                                        #19

                                        17, since my devices run on 4.2.1 and 4.2.2, but Im using linux, since the windows version is supposed to be less stable

                                        1 Reply Last reply
                                        0
                                        • N Offline
                                          N Offline
                                          niks_android
                                          wrote on last edited by
                                          #20

                                          Moster,

                                          adb logcat shows the following error on start of application:

                                          E/Qt ( 1469): Can't create main activity
                                          E/Qt ( 1469): java.io.FileNotFoundException: /data/data/org.qtproject.example.Sample/lib/lib--Managed_by_Qt_Creator--plugins_platforms_android_libqtforandroid.so: open failed: ENOENT (No such file or directory)

                                          1 Reply Last reply
                                          0

                                          • Login

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • Users
                                          • Groups
                                          • Search
                                          • Get Qt Extensions
                                          • Unsolved