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. Manual fix for "org.qtproject.qt5.android.network.QtNetwork" class not found
Forum Updated to NodeBB v4.3 + New Features

Manual fix for "org.qtproject.qt5.android.network.QtNetwork" class not found

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
10 Posts 9 Posters 3.2k Views 1 Watching
  • 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.
  • S Offline
    S Offline
    swk.
    wrote on 10 Feb 2021, 08:37 last edited by
    #1

    Re: Downloading data from Web URL (For Android)

    in 5.15.2 its not working, there is a fix which is scheduled for 5.15.3 release. For now if you want to use QtNetwork in android you can apply this manual fix in your Qt android installation.

    1. for arm64-v8a android target, edit the file
      Qt\5.15.2\android\lib\Qt5Network_arm64-v8a-android-dependencies.xml
    2. search and replace "QtAndroidBearer.jar" with "QtAndroidNetwork.jar" and rebuild your application.

    repeat the steps for each of your android target (armeabi-v7a, x86,...)

    1 Reply Last reply
    3
    • T Offline
      T Offline
      Taulie
      wrote on 26 Feb 2021, 16:43 last edited by
      #2

      Hello,

      thanks for your solution.

      For me it does not work. My Question is why not?
      I use Qt5.15.2 & qbs1.17

      My Qt5Network_arm64-v8a-android-dependencies.xml after modification:
      <rules><dependencies><lib name="Qt5Network_arm64-v8a"><depends>
      <jar bundling="1" file="jar/QtAndroidNetwork.jar" />
      <lib file="plugins/bearer/libplugins_bearer_qandroidbearer_arm64-v8a.so" />
      <bundled file="plugins/bearer" />
      <permission name="android.permission.ACCESS_NETWORK_STATE" />
      </depends></lib></dependencies></rules>

      My output is:
      W System : ClassLoader referenced unknown path:
      D Qt JAVA : Class org.qtproject.qt5.android.multimedia.QtMultimediaUtils does not implement setActivity method
      I QtCore : Start
      I Qt : qt started
      E linker : normalize_path - invalid input: "C", the input path should be absolute
      W linker : Warning: unable to normalize "C"
      E linker : normalize_path - invalid input: "C", the input path should be absolute
      W linker : Warning: unable to normalize "C"
      D OpenGLRenderer: HWUI GL Pipeline
      I Adreno : QUALCOMM build : 8e3df98, Ie4790512f3
      I Adreno : Build Date : 04/11/18
      I Adreno : OpenGL ES Shader Compiler Version: EV031.22.00.01
      I Adreno : Local Branch :
      I Adreno : Remote Branch : quic/gfx-adreno.lnx.1.0.r36-rel
      I Adreno : Remote Branch : NONE
      I Adreno : Reconstruct Branch : NOTHING
      I Adreno : PFP: 0x005ff087, ME: 0x005ff063
      I zygote64: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasWideColorDisplay retrieved: 0
      I OpenGLRenderer: Initialized EGL, version 1.4
      D OpenGLRenderer: Swap behavior 2
      D libxxxxxxxxxxxxx_arm64-v8a.so: own IP-Addresses:
      D libxxxxxxxxxxxxx_arm64-v8a.so: "192.168.1.101"
      D libxxxxxxxxxxxxx_arm64-v8a.so: host IP-Addresses:
      W qtMainLoopThrea: type=1400 audit(0.0:213356): avc: denied { ioctl } for path="socket:[1158058]" dev="sockfs" ino=1158058 ioctlcmd=8927 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:r:untrusted_app:s0:c512,c768 tclass=tcp_socket permissive=0
      E linker : normalize_path - invalid input: "C", the input path should be absolute
      W linker : Warning: unable to normalize "C"
      E linker : normalize_path - invalid input: "C", the input path should be absolute
      W linker : Warning: unable to normalize "C"
      E linker : normalize_path - invalid input: "C", the input path should be absolute
      W linker : Warning: unable to normalize "C"
      E linker : normalize_path - invalid input: "C", the input path should be absolute
      W linker : Warning: unable to normalize "C"
      D libxxxxxxxxxxxxx_arm64-v8a.so: FT_New_Face failed with index 0 : 1
      I chatty : uid=10122(xxxxxxxxxxxxx) QtThread identical 1 line
      D libxxxxxxxxxxxxx_arm64-v8a.so: FT_New_Face failed with index 0 : 1
      E linker : normalize_path - invalid input: "C", the input path should be absolute
      W linker : Warning: unable to normalize "C"
      E linker : normalize_path - invalid input: "C", the input path should be absolute
      W linker : Warning: unable to normalize "C"
      E linker : normalize_path - invalid input: "C", the input path should be absolute
      W linker : Warning: unable to normalize "C"
      E linker : normalize_path - invalid input: "C", the input path should be absolute
      W linker : Warning: unable to normalize "C"

      You can help to resolve this please?

      Thanks

      1 Reply Last reply
      0
      • R Offline
        R Offline
        Ross
        wrote on 5 May 2021, 17:43 last edited by
        #3

        @swk.'s fix worked for me. Also had to nuke entire build directory and re-build from scratch.

        1 Reply Last reply
        0
        • R Offline
          R Offline
          RubbieKelvin
          wrote on 5 Jun 2021, 07:41 last edited by
          #4

          i did the same... and got this error...

          W System.err: java.lang.ClassNotFoundException: Didn't find class "org.qtproject.qt5.android.bearer.QtNetworkReceiver" on path: DexPathList[[],nativeLibraryDirectories=[/system/lib]]
          W System.err: 	at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
          W System.err: 	at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
          W System.err: 	at java.lang.ClassLoader.loadClass(ClassLoader.java:312)```
          1 Reply Last reply
          1
          • G Offline
            G Offline
            giantguppy
            wrote on 11 Aug 2021, 23:34 last edited by
            #5

            Same here, after the workaround I get:
            W System.err: java.lang.ClassNotFoundException: Didn't find class "org.qtproject.qt5.android.bearer.QtNetworkReceiver" on path: DexPathList[[],nativeLibraryDirectories=[/system/lib64]]

            I'm using Qt 5.15.2 on Linux.

            1 Reply Last reply
            1
            • V Offline
              V Offline
              Vu Trinh
              wrote on 25 Aug 2021, 08:45 last edited by Vu Trinh
              #6

              Instead of replace, just add <jar bundling="1" file="jar/QtAndroidNetwork.jar" /> to the xml file. So the final file should be:

              <rules><dependencies><lib name="Qt5Network_arm64-v8a"><depends>
              <jar bundling="1" file="jar/QtAndroidBearer.jar"  />
              <jar bundling="1" file="jar/QtAndroidNetwork.jar"  />
              <lib file="plugins/bearer/libplugins_bearer_qandroidbearer_arm64-v8a.so"  />
              <bundled file="plugins/bearer" />
              <permission name="android.permission.ACCESS_NETWORK_STATE" />
              </depends></lib></dependencies></rules>
              
              P 1 Reply Last reply 24 Jan 2022, 02:06
              4
              • O Offline
                O Offline
                owensmk
                wrote on 20 Sept 2021, 21:28 last edited by
                #7
                This post is deleted!
                1 Reply Last reply
                0
                • V Vu Trinh
                  25 Aug 2021, 08:45

                  Instead of replace, just add <jar bundling="1" file="jar/QtAndroidNetwork.jar" /> to the xml file. So the final file should be:

                  <rules><dependencies><lib name="Qt5Network_arm64-v8a"><depends>
                  <jar bundling="1" file="jar/QtAndroidBearer.jar"  />
                  <jar bundling="1" file="jar/QtAndroidNetwork.jar"  />
                  <lib file="plugins/bearer/libplugins_bearer_qandroidbearer_arm64-v8a.so"  />
                  <bundled file="plugins/bearer" />
                  <permission name="android.permission.ACCESS_NETWORK_STATE" />
                  </depends></lib></dependencies></rules>
                  
                  P Offline
                  P Offline
                  piervalli
                  wrote on 24 Jan 2022, 02:06 last edited by
                  #8

                  @Vu-Trinh thanks for the fix
                  To complate add two info

                  Forder path of adroid
                  C:\Qt\5.15.2\android\lib
                  File to edit
                  Qt5Network_armeabi-v7a-android-dependencies.xml
                  Qt5Multimedia_arm64-v8a-android-dependencies.xml

                  G 1 Reply Last reply 2 Feb 2022, 09:22
                  1
                  • P piervalli
                    24 Jan 2022, 02:06

                    @Vu-Trinh thanks for the fix
                    To complate add two info

                    Forder path of adroid
                    C:\Qt\5.15.2\android\lib
                    File to edit
                    Qt5Network_armeabi-v7a-android-dependencies.xml
                    Qt5Multimedia_arm64-v8a-android-dependencies.xml

                    G Offline
                    G Offline
                    GBergamo
                    wrote on 2 Feb 2022, 09:22 last edited by
                    #9

                    @piervalli why arm64-v8a for Qt5Multimedia and armeabi-v7a for Qt5Network?
                    You probably meant both architectures for Qt5Network...right?

                    P 1 Reply Last reply 5 Feb 2022, 16:31
                    0
                    • G GBergamo
                      2 Feb 2022, 09:22

                      @piervalli why arm64-v8a for Qt5Multimedia and armeabi-v7a for Qt5Network?
                      You probably meant both architectures for Qt5Network...right?

                      P Offline
                      P Offline
                      piervalli
                      wrote on 5 Feb 2022, 16:31 last edited by
                      #10

                      @GBergamo Yes, I create two apk, arm7 and arm8.

                      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