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. Cannot open device's image after targeting api 29 on android X device
QtWS25 Last Chance

Cannot open device's image after targeting api 29 on android X device

Scheduled Pinned Locked Moved Solved Mobile and Embedded
4 Posts 2 Posters 1.7k 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.
  • V Offline
    V Offline
    vudangkhoa2906
    wrote on last edited by vudangkhoa2906
    #1

    I'm maintaining a legacy project, Qt version is 5.12.8. Android sdk 30, ndk 21.

    Everything works normal when the target api is 28. But when I set the target api to 29, after selecting an image from device library, and set the uri to the source of an QImage, I got this error:

    QML Image: Cannot open: file:///storage/emulated/0/Download/v_bts.jpeg
    

    I don't encounter this problem on device with android version <= 9, only android X.
    Anyone has any idea on how to solve this problem? Thank you very much!

    1 Reply Last reply
    0
    • A Offline
      A Offline
      antoinnneee
      wrote on last edited by antoinnneee
      #2

      Hi,
      I have the same problem, since I try to update my app to api29 I can't create or access any folder or file in file:///storage/emulated/0/***
      That's an huge issue, i'm currently working on an file managing app

      According to an other post in this forum, there is some update on the last android version that change the way of access file, but i don't understand how to fix this issue
      update link : https://developer.android.com/about/versions/11/privacy/storage

      I try with 2 kit version with the same results:
      Qt 5.12.10 (apk v 29)
      Qt 5.15.2 (apk v 29)

      I also try 2 ou 3 ndk version

      I hope someone has a solution

      1 Reply Last reply
      0
      • A Offline
        A Offline
        antoinnneee
        wrote on last edited by antoinnneee
        #3

        Sorry for the multi post message, but i just found a solution that work on 5.15.2, I think this will work with 5.12.10. We can use the old storage option by adding android:requestLegacyExternalStorage="true" in the application part of the manifest

        ...
            <application android:requestLegacyExternalStorage="true" android:hardwareAccelerated="true" android:name="org.qtproject.qt5.android.bindings.QtApplication" android:label="-- %%INSERT_APP_NAME%% --" android:extractNativeLibs="true">
        ...
        

        I've a new issu when trying to build with 5.12.10, my app crash at startup, but i thinks it's due to something in my AppActivity.java file

        log:

        ...
        W Gralloc3: mapper 3.x is not supported
        D HiTouch_PressGestureDetector: onAttached, package=org.barthe.cceleve, windowType=1, mHiTouchRestricted=false
        D mali_winsys: EGLint new_window_surface(egl_winsys_display *, void *, EGLSurface, EGLConfig, egl_winsys_surface **, EGLBoolean) returns 0x3000
        E .barthe.ccelev: No implementation found for boolean org.qtproject.qt5.android.QtNative.startQtAndroidPlugin(java.lang.String, java.lang.String) (tried Java_org_qtproject_qt5_android_QtNative_startQtAndroidPlugin and Java_org_qtproject_qt5_android_QtNative_startQtAndroidPlugin__Ljava_lang_String_2Ljava_lang_String_2)
        I QarthLog: [PatchStore] createDisableExceptionQarthFile
        I QarthLog: [PatchStore] create disable file for org.barthe.cceleve uid is 10664
        E .barthe.ccelev: No implementation found for void org.qtproject.qt5.android.QtNative.waitForServiceSetup() (tried Java_org_qtproject_qt5_android_QtNative_waitForServiceSetup and Java_org_qtproject_qt5_android_QtNative_waitForServiceSetup__)
        D AndroidRuntime: Shutting down VM
        E AndroidRuntime: FATAL EXCEPTION: qtMainLoopThread
        E AndroidRuntime: Process: org.barthe.cceleve, PID: 19024
        E AndroidRuntime: java.lang.UnsatisfiedLinkError: No implementation found for boolean org.qtproject.qt5.android.QtNative.startQtAndroidPlugin(java.lang.String, java.lang.String) (tried Java_org_qtproject_qt5_android_QtNative_startQtAndroidPlugin and Java_org_qtproject_qt5_android_QtNative_startQtAndroidPlugin__Ljava_lang_String_2Ljava_lang_String_2)
        E AndroidRuntime: 	at org.qtproject.qt5.android.QtNative.startQtAndroidPlugin(Native Method)
        E AndroidRuntime: 	at org.qtproject.qt5.android.QtNative$6.run(QtNative.java:360)
        E AndroidRuntime: 	at org.qtproject.qt5.android.QtThread$2.run(QtThread.java:88)
        E AndroidRuntime: 	at org.qtproject.qt5.android.QtThread$1.run(QtThread.java:61)
        E AndroidRuntime: 	at java.lang.Thread.run(Thread.java:929)
        I QarthLog: [PatchStore] createDisableExceptionQarthFile
        I QarthLog: [PatchStore] create disable file for org.barthe.cceleve uid is 10664
        I Process : Sending signal. PID: 19024 SIG: 9
        
        

        edit: I finaly fix all my issues, I confirm that adding android:requestLegacyExternalStorage="true" solve storage problem on 5.12.10
        The other problem that I have report is due to an error in the build.gradle file, I just have to remove manifest and all gradle related file to fix

        V 1 Reply Last reply
        1
        • A antoinnneee

          Sorry for the multi post message, but i just found a solution that work on 5.15.2, I think this will work with 5.12.10. We can use the old storage option by adding android:requestLegacyExternalStorage="true" in the application part of the manifest

          ...
              <application android:requestLegacyExternalStorage="true" android:hardwareAccelerated="true" android:name="org.qtproject.qt5.android.bindings.QtApplication" android:label="-- %%INSERT_APP_NAME%% --" android:extractNativeLibs="true">
          ...
          

          I've a new issu when trying to build with 5.12.10, my app crash at startup, but i thinks it's due to something in my AppActivity.java file

          log:

          ...
          W Gralloc3: mapper 3.x is not supported
          D HiTouch_PressGestureDetector: onAttached, package=org.barthe.cceleve, windowType=1, mHiTouchRestricted=false
          D mali_winsys: EGLint new_window_surface(egl_winsys_display *, void *, EGLSurface, EGLConfig, egl_winsys_surface **, EGLBoolean) returns 0x3000
          E .barthe.ccelev: No implementation found for boolean org.qtproject.qt5.android.QtNative.startQtAndroidPlugin(java.lang.String, java.lang.String) (tried Java_org_qtproject_qt5_android_QtNative_startQtAndroidPlugin and Java_org_qtproject_qt5_android_QtNative_startQtAndroidPlugin__Ljava_lang_String_2Ljava_lang_String_2)
          I QarthLog: [PatchStore] createDisableExceptionQarthFile
          I QarthLog: [PatchStore] create disable file for org.barthe.cceleve uid is 10664
          E .barthe.ccelev: No implementation found for void org.qtproject.qt5.android.QtNative.waitForServiceSetup() (tried Java_org_qtproject_qt5_android_QtNative_waitForServiceSetup and Java_org_qtproject_qt5_android_QtNative_waitForServiceSetup__)
          D AndroidRuntime: Shutting down VM
          E AndroidRuntime: FATAL EXCEPTION: qtMainLoopThread
          E AndroidRuntime: Process: org.barthe.cceleve, PID: 19024
          E AndroidRuntime: java.lang.UnsatisfiedLinkError: No implementation found for boolean org.qtproject.qt5.android.QtNative.startQtAndroidPlugin(java.lang.String, java.lang.String) (tried Java_org_qtproject_qt5_android_QtNative_startQtAndroidPlugin and Java_org_qtproject_qt5_android_QtNative_startQtAndroidPlugin__Ljava_lang_String_2Ljava_lang_String_2)
          E AndroidRuntime: 	at org.qtproject.qt5.android.QtNative.startQtAndroidPlugin(Native Method)
          E AndroidRuntime: 	at org.qtproject.qt5.android.QtNative$6.run(QtNative.java:360)
          E AndroidRuntime: 	at org.qtproject.qt5.android.QtThread$2.run(QtThread.java:88)
          E AndroidRuntime: 	at org.qtproject.qt5.android.QtThread$1.run(QtThread.java:61)
          E AndroidRuntime: 	at java.lang.Thread.run(Thread.java:929)
          I QarthLog: [PatchStore] createDisableExceptionQarthFile
          I QarthLog: [PatchStore] create disable file for org.barthe.cceleve uid is 10664
          I Process : Sending signal. PID: 19024 SIG: 9
          
          

          edit: I finaly fix all my issues, I confirm that adding android:requestLegacyExternalStorage="true" solve storage problem on 5.12.10
          The other problem that I have report is due to an error in the build.gradle file, I just have to remove manifest and all gradle related file to fix

          V Offline
          V Offline
          vudangkhoa2906
          wrote on last edited by
          #4

          @antoinnneee said in Cannot open device's image after targeting api 29 on android X device:

          android:requestLegacyExternalStorage="true"

          thank you so very much! indeed this fixed my issue!

          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