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

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


    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
    	#00 pc 00037910  /system/lib/ (tgkill+12)
    	#01 pc 00013fc1  /system/lib/ (pthread_kill+52)
    	#02 pc 00014bdf  /system/lib/ (raise+10)
    	#03 pc 00011521  /system/lib/ (__libc_android_abort+36)
    	#04 pc 0000fcac  /system/lib/ (abort+4)
    	#05 pc 00050810  /data/app/no.myApp.www-1/lib/arm/ (__gnu_cxx::__verbose_terminate_handler()+348)
    	#06 pc 0004e6e0  /data/app/no.myApp.www-1/lib/arm/ (__cxxabiv1::__terminate(void (*)())+8)
    	#07 pc 0004e780  /data/app/no.myApp.www-1/lib/arm/ (std::terminate()+12)
    	#08 pc 0004eacc  /data/app/no.myApp.www-1/lib/arm/ (__cxa_throw+156)
    	#09 pc 0004f0a8  /data/app/no.myApp.www-1/lib/arm/ (operator new(unsigned int)+108)
    	#10 pc 0004f11c  /data/app/no.myApp.www-1/lib/arm/ (operator new[](unsigned int)+4)
    	#11 pc 00123179  /data/app/no.myApp.www-1/lib/arm/
    	#12 pc 001233d7  /data/app/no.myApp.www-1/lib/arm/ (QResource::registerResource(QString const&, QString const&)+350)
    	#13 pc 000044ed  /data/app/no.myApp.www-1/lib/arm/ (DeviceAndroid::loadExpansionFile(unsigned int)+640)
    	#14 pc 00004925  /data/app/no.myApp.www-1/lib/arm/
    	#15 pc 00004a43  /data/app/no.myApp.www-1/lib/arm/ (DeviceAndroid::qt_metacall(QMetaObject::Call, int, void**)+30)
    	#16 pc 00189e69  /data/app/no.myApp.www-1/lib/arm/ (QMetaObject::metacall(QObject*, QMetaObject::Call, int, void**)+44)
    	#17 pc 0013413f  /data/app/no.myApp.www-1/lib/arm/
    	#18 pc 000fffcb  /data/app/no.myApp.www-1/lib/arm/
    	#19 pc 001002a1  /data/app/no.myApp.www-1/lib/arm/
    	#20 pc 00100533  /data/app/no.myApp.www-1/lib/arm/ (QV4::QObjectMethod::callInternal(QV4::CallData*)+574)
    	#21 pc 000d0e09  /data/app/no.myApp.www-1/lib/arm/
    	#22 pc 00108c0f  /data/app/no.myApp.www-1/lib/arm/ (QV4::Runtime::callProperty(QV4::ExecutionEngine*, int, QV4::CallData*)+366)
    	#23 pc 00008221  <unknown>

  • Lifetime Qt Champion


    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

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

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

  • Lifetime Qt Champion

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

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

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

Log in to reply