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. Is this crash due to loading large Android expansion files as a Qt external resource file?
Forum Updated to NodeBB v4.3 + New Features

Is this crash due to loading large Android expansion files as a Qt external resource file?

Scheduled Pinned Locked Moved Mobile and Embedded
6 Posts 2 Posters 1.5k Views 2 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.
  • P Offline
    P Offline
    Phataas
    wrote on last edited by Phataas
    #1

    I have written my first app for Android with Qt and some ANR reports has been received. (They all look like the code at the end).

    From the output I can see that the problem is related to the function:

    QResource::registerResource()
    

    and it throws because of the new operator. The file to be loaded as an external Qt resource file is very large (500MB+).

    I am unable to reproduce the ANR on any of my devices, but I do not have any of the devices the ANR is reported on.

    So far the possible problems might be:

    1. The QResource::registerResource() function might be slow and blocking (running in GUI thread) and therefor the application might crash?
    2. If, when using QResource::registerResource(), the whole file is loaded into memory and since the file is so large the Android OS refuses to allocate any more memory? (From Qt Doc: "When loaded at run time the resource file will be loaded as one big set of data")

    I am sure that some other Qt developer deploying for Android must have had a large Android expansion file. How did you solve it? Any guidance is much appreciated!

    *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
    Build fingerprint: 'samsung/jactiveltexx/jactivelte:5.0.1/LRX22C/I9295XXUDOB4:user/release-keys'
    Revision: '16'
    ABI: 'arm'
    pid: 23341, tid: 23365, name: QtThread  >>> no.myApp.www <<<
    signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
    	r0 00000000  r1 00005b45  r2 00000006  r3 00000000
    	r4 ad7ffdb8  r5 00000006  r6 0000000c  r7 0000010c
    	r8 ad7fee30  r9 275951ac  sl ad7fee6c  fp ad7fecf4
    	ip 00005b45  sp ad7fec88  lr b6f68fc5  pc b6f8c910  cpsr 600f0010
    
    backtrace:
    	#00 pc 00037910  /system/lib/libc.so (tgkill+12)
    	#01 pc 00013fc1  /system/lib/libc.so (pthread_kill+52)
    	#02 pc 00014bdf  /system/lib/libc.so (raise+10)
    	#03 pc 00011521  /system/lib/libc.so (__libc_android_abort+36)
    	#04 pc 0000fcac  /system/lib/libc.so (abort+4)
    	#05 pc 00050810  /data/app/no.myApp.www-1/lib/arm/libgnustl_shared.so (__gnu_cxx::__verbose_terminate_handler()+348)
    	#06 pc 0004e6e0  /data/app/no.myApp.www-1/lib/arm/libgnustl_shared.so (__cxxabiv1::__terminate(void (*)())+8)
    	#07 pc 0004e780  /data/app/no.myApp.www-1/lib/arm/libgnustl_shared.so (std::terminate()+12)
    	#08 pc 0004eacc  /data/app/no.myApp.www-1/lib/arm/libgnustl_shared.so (__cxa_throw+156)
    	#09 pc 0004f0a8  /data/app/no.myApp.www-1/lib/arm/libgnustl_shared.so (operator new(unsigned int)+108)
    	#10 pc 0004f11c  /data/app/no.myApp.www-1/lib/arm/libgnustl_shared.so (operator new[](unsigned int)+4)
    	#11 pc 00123179  /data/app/no.myApp.www-1/lib/arm/libQt5Core.so
    	#12 pc 001233d7  /data/app/no.myApp.www-1/lib/arm/libQt5Core.so (QResource::registerResource(QString const&, QString const&)+350)
    	#13 pc 000044ed  /data/app/no.myApp.www-1/lib/arm/libmyApp.so (DeviceAndroid::loadExpansionFile(unsigned int)+640)
    	#14 pc 00004925  /data/app/no.myApp.www-1/lib/arm/libmyApp.so
    	#15 pc 00004a43  /data/app/no.myApp.www-1/lib/arm/libmyApp.so (DeviceAndroid::qt_metacall(QMetaObject::Call, int, void**)+30)
    	#16 pc 00189e69  /data/app/no.myApp.www-1/lib/arm/libQt5Core.so (QMetaObject::metacall(QObject*, QMetaObject::Call, int, void**)+44)
    	#17 pc 0013413f  /data/app/no.myApp.www-1/lib/arm/libQt5Qml.so
    	#18 pc 000fffcb  /data/app/no.myApp.www-1/lib/arm/libQt5Qml.so
    	#19 pc 001002a1  /data/app/no.myApp.www-1/lib/arm/libQt5Qml.so
    	#20 pc 00100533  /data/app/no.myApp.www-1/lib/arm/libQt5Qml.so (QV4::QObjectMethod::callInternal(QV4::CallData*)+574)
    	#21 pc 000d0e09  /data/app/no.myApp.www-1/lib/arm/libQt5Qml.so
    	#22 pc 00108c0f  /data/app/no.myApp.www-1/lib/arm/libQt5Qml.so (QV4::Runtime::callProperty(QV4::ExecutionEngine*, int, QV4::CallData*)+366)
    	#23 pc 00008221  <unknown>
    
    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      A qrc from 500MB ? I really doubt it, I'm even surprised that the files succeeded to compile. It looks rather like a job for Android's assets

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      P 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        A qrc from 500MB ? I really doubt it, I'm even surprised that the files succeeded to compile. It looks rather like a job for Android's assets

        P Offline
        P Offline
        Phataas
        wrote on last edited by
        #3

        @SGaist Android assets bundle the data with the app and Google has a 100MB limit of the executable (APK).

        1 Reply Last reply
        0
        • P Offline
          P Offline
          Phataas
          wrote on last edited by
          #4

          I reduced the qrc file to 420MB and it works. This is however NOT a solution, but this might mean that there is a limit on the Android OS? Or is it related to Qt?

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            The application is limited to 50MB but you can use APK expansion files

            I'd rather go with a limit on the hardware/platform.

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0
            • P Offline
              P Offline
              Phataas
              wrote on last edited by
              #6

              I am using APK expansion files! The expansion file is a Qt QRC file compiled with rcc tool...

              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