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. Android deployment with Ministro
QtWS25 Last Chance

Android deployment with Ministro

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
androidqt 5.7deployingministro
21 Posts 2 Posters 9.8k 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.
  • K Offline
    K Offline
    KroMignon
    wrote on 14 Dec 2016, 10:08 last edited by KroMignon
    #1

    Hi all,

    I have create an Android application based on Qt 5.7.0, all works fine on my test device.
    To test my application, I have used Bundle Qt libraries in APK

    This works fine, now development is finished and I have to deploy it on several devices.
    I have create a release APK (signed), and have choose Use Ministro service to install Qt

    I have download ministro APK, and installed Ministro and my application on a device with help of adb.

    adb install -r ministro.apk
    adb install -r QtApp-release-signed.apk
    

    But my application didn't start/works !

    What did I wrong?

    How can I force Qt Libs download installation on this device?

    My configuration is:

    • Qt 5.7.1 (ARM EABI-v7a)
    • QtCreator 4.2.0
    • Android 5.1
    • Ministro v10.5

    Thanks for any help

    It is an old maxim of mine that when you have excluded the impossible, whatever remains, however improbable, must be the truth. (Sherlock Holmes)

    R 1 Reply Last reply 14 Dec 2016, 12:45
    0
    • K KroMignon
      14 Dec 2016, 10:08

      Hi all,

      I have create an Android application based on Qt 5.7.0, all works fine on my test device.
      To test my application, I have used Bundle Qt libraries in APK

      This works fine, now development is finished and I have to deploy it on several devices.
      I have create a release APK (signed), and have choose Use Ministro service to install Qt

      I have download ministro APK, and installed Ministro and my application on a device with help of adb.

      adb install -r ministro.apk
      adb install -r QtApp-release-signed.apk
      

      But my application didn't start/works !

      What did I wrong?

      How can I force Qt Libs download installation on this device?

      My configuration is:

      • Qt 5.7.1 (ARM EABI-v7a)
      • QtCreator 4.2.0
      • Android 5.1
      • Ministro v10.5

      Thanks for any help

      R Offline
      R Offline
      raven-worx
      Moderators
      wrote on 14 Dec 2016, 12:45 last edited by
      #2

      @KroMignon
      any output on the console?

      Also check the logcat

      adb logcat -c
      // start the app and let it crash etc.
      adb logcat -d > logcat.txt
      

      In there should be the reason for the failing startup process.

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      K 1 Reply Last reply 14 Dec 2016, 14:56
      0
      • R raven-worx
        14 Dec 2016, 12:45

        @KroMignon
        any output on the console?

        Also check the logcat

        adb logcat -c
        // start the app and let it crash etc.
        adb logcat -d > logcat.txt
        

        In there should be the reason for the failing startup process.

        K Offline
        K Offline
        KroMignon
        wrote on 14 Dec 2016, 14:56 last edited by
        #3

        @raven-worx

        Here the output of the log your asking for

        I/Timeline( 3905): Timeline: Activity_launch_request id:com.geocept.android time:95426461
        --------- beginning of system
        I/ActivityManager(  771): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.geocept.android/.StartActivity (has extras)} from uid 10018 on display 0
        D/audio_hw_primary(  277): start_output_stream: enter: stream(0xb7b83c18)usecase(1: low-latency-playback) devices(0x2)
        D/audio_hw_primary(  277): select_devices: out_snd_device(2: speaker) in_snd_device(0: )
        D/hardware_info(  277): hw_info_append_hw_type : device_name = speaker
        I/soundtrigger(  277): audio_extn_sound_trigger_update_device_status: device 0x2 of type 0 for Event 1, with Raise=0
        W/audio_hw_utils(  277): audio_extn_utils_update_stream_app_type_cfg: App type could not be selected. Falling back to default
        I/audio_hw_primary(  277): select_devices Selected apptype: 69936
        D/soundtrigger(  277): audio_extn_sound_trigger_update_stream_status: uc_id 1 of type 0 for Event 3, with Raise=0
        D/ACDB-LOADER(  277): ACDB -> send_audio_cal, acdb_id = 14, path =  0
        D/ACDB-LOADER(  277): ACDB -> send_asm_topology
        D/ACDB-LOADER(  277): ACDB -> ACDB_CMD_GET_AUDPROC_STREAM_TOPOLOGY_ID
        D/ACDB-LOADER(  277): ACDB -> send_adm_topology
        D/ACDB-LOADER(  277): ACDB -> ACDB_CMD_GET_AUDPROC_COMMON_TOPOLOGY_ID
        D/ACDB-LOADER(  277): ACDB -> send_audtable
        D/ACDB-LOADER(  277): ACDB -> ACDB_CMD_GET_AUDPROC_COMMON_TABLE
        D/ACDB-LOADER(  277): ACDB -> AUDIO_SET_AUDPROC_CAL
        D/ACDB-LOADER(  277): ACDB -> send_audvoltable
        D/ACDB-LOADER(  277): ACDB -> ACDB_CMD_GET_AUDPROC_GAIN_DEP_STEP_TABLE
        D/ACDB-LOADER(  277): ACDB -> AUDIO_SET_AUDPROC_VOL_CAL
        D/ACDB-LOADER(  277): ACDB -> send_afe_cal
        D/ACDB-LOADER(  277): ACDB -> ACDB_CMD_GET_AFE_COMMON_TABLE
        D/ACDB-LOADER(  277): ACDB -> AUDIO_SET_AFE_CAL
        D/ACDB-LOADER(  277): ACDB -> send_hw_delay : acdb_id = 14 path = 0
        D/ACDB-LOADER(  277): ACDB -> ACDB_AVSYNC_INFO: ACDB_CMD_GET_DEVICE_PROPERTY
        I/audio_hw_utils(  277): audio_extn_utils_send_app_type_cfg app_type 69936, acdb_dev_id 14, sample_rate 48000
        D/audio_hw_primary(  277): select_devices: done
        V/WindowManager(  771): addAppToken: AppWindowToken{24df240c token=Token{1343e33f ActivityRecord{3262235e u0 com.geocept.android/.StartActivity t95}}} to stack=1 task=95 at 0
        W/BroadcastQueue(  771): Permission Denial: broadcasting Intent { act=com.android.launcher3.action.LAUNCH flg=0x10 (has extras) } from com.android.launcher3 (pid=3905, uid=10018) requires com.google.android.launcher.permission.RECEIVE_LAUNCH_BROADCASTS due to receiver com.google.android.gms/.icing.proxy.ApplicationLauncherReceiver
        W/BroadcastQueue(  771): Permission Denial: receiving Intent { act=com.android.launcher3.action.LAUNCH flg=0x10 (has extras) } to com.google.android.gms/.icing.proxy.ApplicationLauncherReceiver requires com.android.launcher3.permission.RECEIVE_LAUNCH_BROADCASTS due to sender com.android.launcher3 (uid 10018)
        W/BroadcastQueue(  771): Permission Denial: broadcasting Intent { act=com.android.launcher3.action.LAUNCH flg=0x10 (has extras) } from com.android.launcher3 (pid=3905, uid=10018) requires com.google.android.launcher.permission.RECEIVE_LAUNCH_BROADCASTS due to receiver com.google.android.googlequicksearchbox/com.google.android.apps.gsa.search.core.icingsync.ApplicationLaunchReceiver
        W/BroadcastQueue(  771): Permission Denial: receiving Intent { act=com.android.launcher3.action.LAUNCH flg=0x10 (has extras) } to com.google.android.googlequicksearchbox/com.google.android.apps.gsa.search.core.icingsync.ApplicationLaunchReceiver requires com.android.launcher3.permission.RECEIVE_LAUNCH_BROADCASTS due to sender com.android.launcher3 (uid 10018)
        V/CEI-debug( 3905): onPause() mLauncher = com.android.launcher3.Launcher@2d0a0cac
        I/ViewRootImpl(  771): CPU Rendering VSync enable = false
        V/WindowManager(  771): Adding window Window{1d88eb10 u0 Starting com.geocept.android} at 5 of 9 (after Window{367838f1 u0 com.google.android.googlequicksearchbox/com.google.android.apps.gsa.sidekick.main.optin.NewOptInActivity})
        I/ActivityManager(  771): Start proc 9188:com.geocept.android/u0a106 for activity com.geocept.android/.StartActivity
        I/Activity( 9188): StartActivity::StartActivity()
        D/AudioPolicyManager(  277): unknown stream type 13
        D/AudioPolicyManager(  277): unknown stream type 13
        D/AudioPolicyManager(  277): unknown stream type 13
        D/AudioPolicyManager(  277): unknown stream type 13
        D/AudioPolicyManager(  277): unknown stream type 13
        D/AudioPolicyManager(  277): unknown stream type 13
        D/AudioPolicyManager(  277): unknown stream type 13
        D/AudioPolicyManager(  277): unknown stream type 13
        D/AudioPolicyManager(  277): unknown stream type 13
        D/AudioPolicyManager(  277): unknown stream type 13
        D/AudioPolicyManager(  277): unknown stream type 13
        D/AudioPolicyManager(  277): unknown stream type 13
        D/AudioPolicyManager(  277): unknown stream type 13
        D/AudioPolicyManager(  277): unknown stream type 13
        D/AudioPolicyManager(  277): unknown stream type 13
        D/AudioPolicyManager(  277): unknown stream type 13
        D/AudioPolicyManager(  277): unknown stream type 13
        I/ViewRootImpl( 9188): CPU Rendering VSync enable = false
        D/OpenGLRenderer( 9188): Use EGL_SWAP_BEHAVIOR_PRESERVED: true
        V/WLAN_PSA(  284): NL MSG, len[048], NL type[0x11] WNI type[0x5050] len[028]
        V/WLAN_PSA(  284): NL MSG, PID: 284
        V/WindowManager(  771): Adding window Window{32b48d41 u0 com.geocept.android/com.geocept.android.StartActivity} at 5 of 10 (before Window{1d88eb10 u0 Starting com.geocept.android})
        D/WifiService(  771): New client listening to asynchronous messages
        I/ValidateNoPeople(  771): skipping global notification
        E/art     ( 9188): No implementation found for void com.geocept.android.NativeFunctions.focusWindow() (tried Java_com_geocept_android_NativeFunctions_focusWindow and Java_com_geocept_android_NativeFunctions_focusWindow__)
        D/AndroidRuntime( 9188): Shutting down VM
        E/AndroidRuntime( 9188): [ERB] Update app failure countmain
        E/AndroidRuntime( 9188): [ERB] Update app failure - ActivityThread.currentProcessName : com.geocept.android
        E/AndroidRuntime( 9188): [ERB] Update app failure - Process.myPid : 9188
        --------- beginning of crash
        E/AndroidRuntime( 9188): FATAL EXCEPTION: main
        E/AndroidRuntime( 9188): Process: com.geocept.android, PID: 9188
        E/AndroidRuntime( 9188): java.lang.UnsatisfiedLinkError: No implementation found for void com.geocept.android.NativeFunctions.focusWindow() (tried Java_com_geocept_android_NativeFunctions_focusWindow and Java_com_geocept_android_NativeFunctions_focusWindow__)
        E/AndroidRuntime( 9188): 	at com.geocept.android.NativeFunctions.focusWindow(Native Method)
        E/AndroidRuntime( 9188): 	at com.geocept.android.StartActivity.onResume(StartActivity.java:185)
        E/AndroidRuntime( 9188): 	at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1257)
        E/AndroidRuntime( 9188): 	at android.app.Activity.performResume(Activity.java:6122)
        E/AndroidRuntime( 9188): 	at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2975)
        E/AndroidRuntime( 9188): 	at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3017)
        E/AndroidRuntime( 9188): 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2392)
        E/AndroidRuntime( 9188): 	at android.app.ActivityThread.access$800(ActivityThread.java:151)
        E/AndroidRuntime( 9188): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
        E/AndroidRuntime( 9188): 	at android.os.Handler.dispatchMessage(Handler.java:102)
        E/AndroidRuntime( 9188): 	at android.os.Looper.loop(Looper.java:135)
        E/AndroidRuntime( 9188): 	at android.app.ActivityThread.main(ActivityThread.java:5255)
        E/AndroidRuntime( 9188): 	at java.lang.reflect.Method.invoke(Native Method)
        E/AndroidRuntime( 9188): 	at java.lang.reflect.Method.invoke(Method.java:372)
        E/AndroidRuntime( 9188): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905)
        E/AndroidRuntime( 9188): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:700)
        E/ErbService-QiQueue(  771): add(B) id = 6 , mQueue.size()=5
        E/ErbService-QiQueue(  771): add(E) id = 6 , mQueue.size()=5
        E/ErbService-QiQueue(  771): add(E)
        W/ActivityManager(  771):   Force finishing activity 1 com.geocept.android/.StartActivity
        I/Process ( 9188): Sending signal. PID: 9188 SIG: 9
        I/WindowState(  771): WIN DEATH: Window{32b48d41 u0 com.geocept.android/com.geocept.android.StartActivity}
        D/WifiService(  771): Client connection lost with reason: 4
        I/ActivityManager(  771): Process com.geocept.android (pid 9188) has died
        E/ActivityManager(  771): app.processName = com.android.systemui app.pid = 3240, try to set adj -12 --> -12
        I/BackgroundMemoryTrimmer( 4917): Trimming objects from memory, since app is in the background.
        E/ActivityManager(  771): app.processName = com.android.systemui app.pid = 3240, try to set adj -12 --> -12
        V/CEI-debug( 3905): onResume() mLauncher = com.android.launcher3.Launcher@2d0a0cac
        W/InputMethodManagerService(  771): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@1d8ca379 attribute=null, token = android.os.BinderProxy@7173b6d
        I/Timeline( 3905): Timeline: Activity_idle id: android.os.BinderProxy@3de26725 time:95427094
        E/ActivityManager(  771): app.processName = com.android.systemui app.pid = 3240, try to set adj -12 --> -12
        I/Timeline(  771): Timeline: Activity_windows_visible id: ActivityRecord{3d1447a4 u0 com.android.launcher3/.Launcher t52} time:95427342
        D/wpa_supplicant( 3419): wlan0: Control interface command 'SIGNAL_POLL'
        V/WLAN_PSA(  284): NL MSG, len[4035], NL type[0x1C] WNI type[0x5900] len[43791]
        V/WLAN_PSA(  284): NL MSG, PID: 284
        E/BatteryService(  771): mShutdownBatteryLowTemperature_LT12
        E/BatteryService(  771): mShutdownBatteryLowTemperature_null
        D/audio_hw_primary(  277): out_standby: enter: stream (0xb7b83c18) usecase(1: low-latency-playback)
        D/soundtrigger(  277): audio_extn_sound_trigger_update_stream_status: uc_id 1 of type 0 for Event 2, with Raise=0
        D/hardware_info(  277): hw_info_append_hw_type : device_name = speaker
        I/soundtrigger(  277): audio_extn_sound_trigger_update_device_status: device 0x2 of type 0 for Event 0, with Raise=0
        D/wpa_supplicant( 3419): wlan0: Control interface command 'SIGNAL_POLL'
        V/WLAN_PSA(  284): NL MSG, len[4012], NL type[0x1C] WNI type[0x5900] len[37903]
        V/WLAN_PSA(  284): NL MSG, PID: 284
        V/WLAN_PSA(  284): NL MSG, len[048], NL type[0x11] WNI type[0x5050] len[028]
        V/WLAN_PSA(  284): NL MSG, PID: 284
        E/ActivityManager(  771): app.processName = com.android.systemui app.pid = 3240, try to set adj -12 --> -12
        E/ActivityManager(  771): app.processName = com.android.systemui app.pid = 3240, try to set adj -12 --> -12
        E/ActivityManager(  771): app.processName = com.android.systemui app.pid = 3240, try to set adj -12 --> -12
        E/ActivityManager(  771): app.processName = com.android.systemui app.pid = 3240, try to set adj -12 --> -12
        E/ActivityManager(  771): app.processName = com.android.systemui app.pid = 3240, try to set adj -12 --> -12
        E/ActivityManager(  771): app.processName = com.android.systemui app.pid = 3240, try to set adj -12 --> -12
        E/ActivityManager(  771): app.processName = com.android.systemui app.pid = 3240, try to set adj -12 --> -12
        E/ActivityManager(  771): app.processName = com.android.systemui app.pid = 3240, try to set adj -12 --> -12
        E/ActivityManager(  771): app.processName = com.android.systemui app.pid = 3240, try to set adj -12 --> -12
        E/ActivityManager(  771): app.processName = com.android.systemui app.pid = 3240, try to set adj -12 --> -12
        E/ActivityManager(  771): app.processName = com.android.systemui app.pid = 3240, try to set adj -12 --> -12
        E/ActivityManager(  771): app.processName = com.android.systemui app.pid = 3240, try to set adj -12 --> -12
        

        It is an old maxim of mine that when you have excluded the impossible, whatever remains, however improbable, must be the truth. (Sherlock Holmes)

        1 Reply Last reply
        0
        • K Offline
          K Offline
          KroMignon
          wrote on 14 Dec 2016, 15:08 last edited by KroMignon
          #4

          Perhaps the way I try is not be best.

          What I want to do, is to install once all needed Qt libs so I can later only install new APK with application upgrades.

          ==> This way the APK will only need 1MB instead of 20MB !

          Do you have a better solution?

          I have to do this on about 50 devices!

          I've have try to copy Qt Libs on device in /data/local/tmp/qt, but this don't work...
          Application and/or android didn't search in this location.

          It is an old maxim of mine that when you have excluded the impossible, whatever remains, however improbable, must be the truth. (Sherlock Holmes)

          R 1 Reply Last reply 14 Dec 2016, 15:12
          0
          • K KroMignon
            14 Dec 2016, 15:08

            Perhaps the way I try is not be best.

            What I want to do, is to install once all needed Qt libs so I can later only install new APK with application upgrades.

            ==> This way the APK will only need 1MB instead of 20MB !

            Do you have a better solution?

            I have to do this on about 50 devices!

            I've have try to copy Qt Libs on device in /data/local/tmp/qt, but this don't work...
            Application and/or android didn't search in this location.

            R Offline
            R Offline
            raven-worx
            Moderators
            wrote on 14 Dec 2016, 15:12 last edited by
            #5

            @KroMignon
            java.lang.UnsatisfiedLinkError: No implementation found for void com.geocept.android.NativeFunctions.focusWindow()

            you didn't register your native JNI methods?!?

            --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
            If you have a question please use the forum so others can benefit from the solution in the future

            K 2 Replies Last reply 14 Dec 2016, 16:09
            0
            • R raven-worx
              14 Dec 2016, 15:12

              @KroMignon
              java.lang.UnsatisfiedLinkError: No implementation found for void com.geocept.android.NativeFunctions.focusWindow()

              you didn't register your native JNI methods?!?

              K Offline
              K Offline
              KroMignon
              wrote on 14 Dec 2016, 16:09 last edited by
              #6

              @raven-worx

              I do...
              It works fine when I use Bundle Qt libraries in APK as Qt Deployment strategy.
              I haven't change any line of code between the two APK generation.

              With Use Ministro service to install Qt, the application crash

              It is an old maxim of mine that when you have excluded the impossible, whatever remains, however improbable, must be the truth. (Sherlock Holmes)

              1 Reply Last reply
              0
              • R raven-worx
                14 Dec 2016, 15:12

                @KroMignon
                java.lang.UnsatisfiedLinkError: No implementation found for void com.geocept.android.NativeFunctions.focusWindow()

                you didn't register your native JNI methods?!?

                K Offline
                K Offline
                KroMignon
                wrote on 16 Dec 2016, 10:21 last edited by
                #7

                @raven-worx said in Android deployment with Ministro:

                you didn't register your native JNI methods?!?

                I do register them with following code:

                //create a vector with all our JNINativeMethod(s)
                static JNINativeMethod methods[] = {
                    { "focusWindow", "()V", (void *)focusWindow },
                };
                
                // this method is called automatically by Java after the .so file is loaded
                JNIEXPORT jint JNI_OnLoad(JavaVM* vm, void* /*reserved*/)
                {
                    JNIEnv* env;
                    // get the JNIEnv pointer.
                    if (vm->GetEnv(reinterpret_cast<void**>(&env), JNI_VERSION_1_6) != JNI_OK)
                      return JNI_ERR;
                
                    // search for Java class which declares the native methods
                    jclass javaClass = env->FindClass("com/geocept/android/NativeFunctions");
                    if (!javaClass)
                      return JNI_ERR;
                
                    // register our native methods
                    if (env->RegisterNatives(javaClass, methods,
                                          sizeof(methods) / sizeof(methods[0])) < 0) {
                      return JNI_ERR;
                    }
                
                    return JNI_VERSION_1_6;
                }
                

                Is there a way to made "incremental updates" with APK?
                I install first a full featured APK then only APK without the Qt libs?

                It is an old maxim of mine that when you have excluded the impossible, whatever remains, however improbable, must be the truth. (Sherlock Holmes)

                R 1 Reply Last reply 16 Dec 2016, 11:24
                0
                • K KroMignon
                  16 Dec 2016, 10:21

                  @raven-worx said in Android deployment with Ministro:

                  you didn't register your native JNI methods?!?

                  I do register them with following code:

                  //create a vector with all our JNINativeMethod(s)
                  static JNINativeMethod methods[] = {
                      { "focusWindow", "()V", (void *)focusWindow },
                  };
                  
                  // this method is called automatically by Java after the .so file is loaded
                  JNIEXPORT jint JNI_OnLoad(JavaVM* vm, void* /*reserved*/)
                  {
                      JNIEnv* env;
                      // get the JNIEnv pointer.
                      if (vm->GetEnv(reinterpret_cast<void**>(&env), JNI_VERSION_1_6) != JNI_OK)
                        return JNI_ERR;
                  
                      // search for Java class which declares the native methods
                      jclass javaClass = env->FindClass("com/geocept/android/NativeFunctions");
                      if (!javaClass)
                        return JNI_ERR;
                  
                      // register our native methods
                      if (env->RegisterNatives(javaClass, methods,
                                            sizeof(methods) / sizeof(methods[0])) < 0) {
                        return JNI_ERR;
                      }
                  
                      return JNI_VERSION_1_6;
                  }
                  

                  Is there a way to made "incremental updates" with APK?
                  I install first a full featured APK then only APK without the Qt libs?

                  R Offline
                  R Offline
                  raven-worx
                  Moderators
                  wrote on 16 Dec 2016, 11:24 last edited by raven-worx
                  #8

                  @KroMignon
                  i suspect that there is still something wrong in your code/project-setup...

                  Did you try to debug and step through in the call to JNI_OnLoad()?
                  Also where is this method defined? What kind of library is this?
                  Note that JNI_OnLoad() isn't loaded in Qt plugins (QQmlExtensionPlugin, ...)

                  --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
                  If you have a question please use the forum so others can benefit from the solution in the future

                  K 1 Reply Last reply 16 Dec 2016, 11:33
                  0
                  • R raven-worx
                    16 Dec 2016, 11:24

                    @KroMignon
                    i suspect that there is still something wrong in your code/project-setup...

                    Did you try to debug and step through in the call to JNI_OnLoad()?
                    Also where is this method defined? What kind of library is this?
                    Note that JNI_OnLoad() isn't loaded in Qt plugins (QQmlExtensionPlugin, ...)

                    K Offline
                    K Offline
                    KroMignon
                    wrote on 16 Dec 2016, 11:33 last edited by KroMignon
                    #9

                    @raven-worx

                    Did you try to debug and step through in the call to JNI_OnLoad()?
                    Also where is this method defined? What kind of library is this?
                    Note that JNI_OnLoad() isn't loaded in Qt plugins (QQmlExtensionPlugin, ...)

                    I have picked JNI_OnLoad() usage from a presentation made by BogDan Vatra on QtCon 2016 ==> which was based on Qt 5.7
                    This presentation was called Practical Qt on Android JNI

                    It is an old maxim of mine that when you have excluded the impossible, whatever remains, however improbable, must be the truth. (Sherlock Holmes)

                    R 1 Reply Last reply 16 Dec 2016, 11:36
                    0
                    • K KroMignon
                      16 Dec 2016, 11:33

                      @raven-worx

                      Did you try to debug and step through in the call to JNI_OnLoad()?
                      Also where is this method defined? What kind of library is this?
                      Note that JNI_OnLoad() isn't loaded in Qt plugins (QQmlExtensionPlugin, ...)

                      I have picked JNI_OnLoad() usage from a presentation made by BogDan Vatra on QtCon 2016 ==> which was based on Qt 5.7
                      This presentation was called Practical Qt on Android JNI

                      R Offline
                      R Offline
                      raven-worx
                      Moderators
                      wrote on 16 Dec 2016, 11:36 last edited by
                      #10

                      @KroMignon
                      JNI_OnLoad() is only called when the library is loaded using System.loadLibrary() (Java method). Which isn't used when loading Qt plugins.
                      Thats why i asked what kind of library yours is.

                      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
                      If you have a question please use the forum so others can benefit from the solution in the future

                      K 1 Reply Last reply 16 Dec 2016, 11:40
                      0
                      • R raven-worx
                        16 Dec 2016, 11:36

                        @KroMignon
                        JNI_OnLoad() is only called when the library is loaded using System.loadLibrary() (Java method). Which isn't used when loading Qt plugins.
                        Thats why i asked what kind of library yours is.

                        K Offline
                        K Offline
                        KroMignon
                        wrote on 16 Dec 2016, 11:40 last edited by KroMignon
                        #11

                        @raven-worx

                        I use this to call C++ functions from Java, for example to be informed about Battery and WIFI level (which are got with an Android/Java BroadcastReceiver).

                        I don't understand why this works when Qt libs in APK and don't work when using Ministro...

                        It is an old maxim of mine that when you have excluded the impossible, whatever remains, however improbable, must be the truth. (Sherlock Holmes)

                        R 1 Reply Last reply 16 Dec 2016, 12:10
                        0
                        • K KroMignon
                          16 Dec 2016, 11:40

                          @raven-worx

                          I use this to call C++ functions from Java, for example to be informed about Battery and WIFI level (which are got with an Android/Java BroadcastReceiver).

                          I don't understand why this works when Qt libs in APK and don't work when using Ministro...

                          R Offline
                          R Offline
                          raven-worx
                          Moderators
                          wrote on 16 Dec 2016, 12:10 last edited by
                          #12

                          @KroMignon
                          again: what is this library? Is this a simple default library linked to your application or is it a plugin?
                          How did you (exactly) add this library to your APK?

                          I guess at the time you are trying to call the native method the method isn't registered yet. And set a breakpoint in your JNI_OnLoad(), as i already suggested. If the crash occurs before the breakpoint is hit, then this is your problem.

                          If thats the case you can try to create the Java notification callback once you are sure that the methods have been registered successfully. You could set a Java variable at the end of JNI_onLoad() for example.

                          --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
                          If you have a question please use the forum so others can benefit from the solution in the future

                          K 1 Reply Last reply 16 Dec 2016, 12:15
                          0
                          • R raven-worx
                            16 Dec 2016, 12:10

                            @KroMignon
                            again: what is this library? Is this a simple default library linked to your application or is it a plugin?
                            How did you (exactly) add this library to your APK?

                            I guess at the time you are trying to call the native method the method isn't registered yet. And set a breakpoint in your JNI_OnLoad(), as i already suggested. If the crash occurs before the breakpoint is hit, then this is your problem.

                            If thats the case you can try to create the Java notification callback once you are sure that the methods have been registered successfully. You could set a Java variable at the end of JNI_onLoad() for example.

                            K Offline
                            K Offline
                            KroMignon
                            wrote on 16 Dec 2016, 12:15 last edited by
                            #13

                            @raven-worx

                            This is in my application, there no external library, other than Qt.
                            This JNI_OnLoad() function is in a C++ class in my App project. The file name is JniInterfaces.cpp.
                            The function signature is:

                            ...
                            static void focusWindow(JNIEnv * /*env*/,
                                                    jobject /*obj*/)
                            {
                                if(HandheldInit::exists() && qGuiApp->focusWindow() != Q_NULLPTR)
                                {
                                    QTimer::singleShot(0, qGuiApp->focusWindow(), SLOT(raise()));
                                }
                            }
                            
                            //create a vector with all our JNINativeMethod(s)
                            static JNINativeMethod methods[] = {
                                { "focusWindow", "()V", (void *)focusWindow },
                            };
                            // this method is called automatically by Java after the .so file is loaded
                            JNIEXPORT jint JNI_OnLoad(JavaVM* vm, void* /*reserved*/)
                            { ... } // See BogDan Vatra presentation at Qt Con 2016
                            ...
                            

                            It is an old maxim of mine that when you have excluded the impossible, whatever remains, however improbable, must be the truth. (Sherlock Holmes)

                            R 1 Reply Last reply 16 Dec 2016, 12:17
                            0
                            • K KroMignon
                              16 Dec 2016, 12:15

                              @raven-worx

                              This is in my application, there no external library, other than Qt.
                              This JNI_OnLoad() function is in a C++ class in my App project. The file name is JniInterfaces.cpp.
                              The function signature is:

                              ...
                              static void focusWindow(JNIEnv * /*env*/,
                                                      jobject /*obj*/)
                              {
                                  if(HandheldInit::exists() && qGuiApp->focusWindow() != Q_NULLPTR)
                                  {
                                      QTimer::singleShot(0, qGuiApp->focusWindow(), SLOT(raise()));
                                  }
                              }
                              
                              //create a vector with all our JNINativeMethod(s)
                              static JNINativeMethod methods[] = {
                                  { "focusWindow", "()V", (void *)focusWindow },
                              };
                              // this method is called automatically by Java after the .so file is loaded
                              JNIEXPORT jint JNI_OnLoad(JavaVM* vm, void* /*reserved*/)
                              { ... } // See BogDan Vatra presentation at Qt Con 2016
                              ...
                              
                              R Offline
                              R Offline
                              raven-worx
                              Moderators
                              wrote on 16 Dec 2016, 12:17 last edited by raven-worx
                              #14

                              @KroMignon
                              ok i give up....
                              I am on hold until you answer the questions i asked. I wont ask a third time....

                              --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
                              If you have a question please use the forum so others can benefit from the solution in the future

                              K 1 Reply Last reply 16 Dec 2016, 12:39
                              0
                              • R raven-worx
                                16 Dec 2016, 12:17

                                @KroMignon
                                ok i give up....
                                I am on hold until you answer the questions i asked. I wont ask a third time....

                                K Offline
                                K Offline
                                KroMignon
                                wrote on 16 Dec 2016, 12:39 last edited by
                                #15

                                @raven-worx: sorry but there is no other library than Qt libraries...
                                I don't understand your question!
                                JNI_OnLoad() is in my application Project, focusWindow() also.
                                The Java code also.
                                There is no library!!!

                                It is an old maxim of mine that when you have excluded the impossible, whatever remains, however improbable, must be the truth. (Sherlock Holmes)

                                R 1 Reply Last reply 16 Dec 2016, 12:55
                                0
                                • K KroMignon
                                  16 Dec 2016, 12:39

                                  @raven-worx: sorry but there is no other library than Qt libraries...
                                  I don't understand your question!
                                  JNI_OnLoad() is in my application Project, focusWindow() also.
                                  The Java code also.
                                  There is no library!!!

                                  R Offline
                                  R Offline
                                  raven-worx
                                  Moderators
                                  wrote on 16 Dec 2016, 12:55 last edited by
                                  #16

                                  @KroMignon said in Android deployment with Ministro:

                                  There is no library!!!

                                  @KroMignon said in Android deployment with Ministro:

                                  // this method is called automatically by Java after the .so file is loaded
                                  JNIEXPORT jint JNI_OnLoad(JavaVM* vm, void* /reserved/)
                                  { ... } // See BogDan Vatra presentation at Qt Con 2016

                                  You said it's working when you don't use Ministro but bundle the Qt libs with the APK.
                                  But even then the JNI_OnLoad() wouldn't be called, since you implemented JNI_OnLoad() not in a library.

                                  --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
                                  If you have a question please use the forum so others can benefit from the solution in the future

                                  K 1 Reply Last reply 16 Dec 2016, 13:02
                                  0
                                  • R raven-worx
                                    16 Dec 2016, 12:55

                                    @KroMignon said in Android deployment with Ministro:

                                    There is no library!!!

                                    @KroMignon said in Android deployment with Ministro:

                                    // this method is called automatically by Java after the .so file is loaded
                                    JNIEXPORT jint JNI_OnLoad(JavaVM* vm, void* /reserved/)
                                    { ... } // See BogDan Vatra presentation at Qt Con 2016

                                    You said it's working when you don't use Ministro but bundle the Qt libs with the APK.
                                    But even then the JNI_OnLoad() wouldn't be called, since you implemented JNI_OnLoad() not in a library.

                                    K Offline
                                    K Offline
                                    KroMignon
                                    wrote on 16 Dec 2016, 13:02 last edited by
                                    #17

                                    @raven-worx: the Qt Project create a library, called libNavDispatchHandheld.so, this is in the APK in /lib/armeabi-v7a.
                                    Is this your are talking about?
                                    And in this lib, which contains my C++ classes, is the JNI_OnLoad() function.

                                    It is an old maxim of mine that when you have excluded the impossible, whatever remains, however improbable, must be the truth. (Sherlock Holmes)

                                    K 1 Reply Last reply 16 Dec 2016, 14:17
                                    0
                                    • K KroMignon
                                      16 Dec 2016, 13:02

                                      @raven-worx: the Qt Project create a library, called libNavDispatchHandheld.so, this is in the APK in /lib/armeabi-v7a.
                                      Is this your are talking about?
                                      And in this lib, which contains my C++ classes, is the JNI_OnLoad() function.

                                      K Offline
                                      K Offline
                                      KroMignon
                                      wrote on 16 Dec 2016, 14:17 last edited by
                                      #18

                                      @raven-worx: just to pass this annoying question about JNI. I have made a simple test, on which I removed all JNI functions (from Java => C++)
                                      This also didn't work.
                                      I've got an system error which indicates Ministro not available. But I have installed it (App-Info say it is v10.5).

                                      Is Qt5.7.1 not supported by Ministro?

                                      I there a way to generate APK with all needed Qt stuff and then just do "upgrades" with my libs/qml/whatever ?

                                      I'm a big Qt enthusiast, but it is very discouraging and sad to have the feeling to have to battle agains the System and not to work with it :(

                                      It is an old maxim of mine that when you have excluded the impossible, whatever remains, however improbable, must be the truth. (Sherlock Holmes)

                                      R 1 Reply Last reply 16 Dec 2016, 14:58
                                      0
                                      • K KroMignon
                                        16 Dec 2016, 14:17

                                        @raven-worx: just to pass this annoying question about JNI. I have made a simple test, on which I removed all JNI functions (from Java => C++)
                                        This also didn't work.
                                        I've got an system error which indicates Ministro not available. But I have installed it (App-Info say it is v10.5).

                                        Is Qt5.7.1 not supported by Ministro?

                                        I there a way to generate APK with all needed Qt stuff and then just do "upgrades" with my libs/qml/whatever ?

                                        I'm a big Qt enthusiast, but it is very discouraging and sad to have the feeling to have to battle agains the System and not to work with it :(

                                        R Offline
                                        R Offline
                                        raven-worx
                                        Moderators
                                        wrote on 16 Dec 2016, 14:58 last edited by
                                        #19

                                        @KroMignon said in Android deployment with Ministro:

                                        just to pass this annoying question about JNI. I have made a simple test, on which I removed all JNI functions (from Java => C++)
                                        This also didn't work.

                                        same error/exception?!?!

                                        --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
                                        If you have a question please use the forum so others can benefit from the solution in the future

                                        K 2 Replies Last reply 16 Dec 2016, 15:43
                                        0
                                        • R raven-worx
                                          16 Dec 2016, 14:58

                                          @KroMignon said in Android deployment with Ministro:

                                          just to pass this annoying question about JNI. I have made a simple test, on which I removed all JNI functions (from Java => C++)
                                          This also didn't work.

                                          same error/exception?!?!

                                          K Offline
                                          K Offline
                                          KroMignon
                                          wrote on 16 Dec 2016, 15:43 last edited by
                                          #20

                                          @raven-worx : no, there is an Android Popup which says I have to install Ministro... Which is already installed! ==> v10.5

                                          It is an old maxim of mine that when you have excluded the impossible, whatever remains, however improbable, must be the truth. (Sherlock Holmes)

                                          1 Reply Last reply
                                          0

                                          2/21

                                          14 Dec 2016, 12:45

                                          topic:navigator.unread, 19
                                          • Login

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