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

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



  • 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,...)



  • 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



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



  • 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)```


  • 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.



  • 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>
    


  • This post is deleted!

Log in to reply