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. Include rcc file in Android version of application
QtWS25 Last Chance

Include rcc file in Android version of application

Scheduled Pinned Locked Moved Solved Mobile and Embedded
7 Posts 2 Posters 2.3k 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.
  • md2012M Offline
    md2012M Offline
    md2012
    wrote on last edited by A Former User
    #1

    Hello dear programmers .
    well as the topic says i have a program with large resources wich made me to use rcc files instead of qrc.
    i read this article
    http://doc.qt.io/qt-5/portingtoandroid.html
    and i know the qrc is a multiplatform solution for this kind of situation but i get error while compiling my qrc into the main application
    ":-1: error: [qrc_images.obj] Error 1"
    which i believe it's because of the large size of the qrc file.(60mb)
    well first is there any way to use the rcc file instead of qrc.
    if not then must be something im doing wrong.
    any idea?

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

      Hi,

      rcc is the tools that converts your .qrc file in code. Do you mean that you have a .qrc file that weighs 60MB or that you have may files to include that makes that size ?

      In any case, you can generate an external binary resource .

      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
      • md2012M Offline
        md2012M Offline
        md2012
        wrote on last edited by
        #3

        @SGaist
        Well i have a windows version of my software that uses the rcc file already.

        QResource::registerResource("./bin/resources.rcc");
        

        in my windows version ,files in the rcc resource load with no problem but
        in android version my files which are images won't load.

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

          Check that you are deploying the file correctly with your application.

          Also, I'd recommend generating a full path to your resource file rather that a relative like you are doing currently. That will ensure that wherever you start your application from it uses the right folder.

          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
          • md2012M Offline
            md2012M Offline
            md2012
            wrote on last edited by
            #5

            @SGaist
            dont know how to use the full address ,when i use this :

            qDebug()<<QResource::registerResource("f:/Users/MeHrAnM.D/Desktop/Tarh bartar v0.9beta Data V0.01/bin/resources.rcc");
            

            still get the false output.
            last time for thr windows version i had the same problem with registering the rcc file ,
            i used this command:

            qDebug()<<QDir::currentPath();
            

            and located the folder it was pointing and copied the rcc there.
            now when i use that command i get the
            "/data/data/org.qtproject.example.tarh_bartar/files"
            which there is no place like this in my PC.

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

              Don't hardcode the path in your code. Use QCoreApplication:: applicationDirPath.

              QDir::currentPath won't necessarily return the application executable path.

              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
              1
              • md2012M Offline
                md2012M Offline
                md2012
                wrote on last edited by md2012
                #7

                well i gave up on using rcc file in my project .
                i used exact copy of my windows version and compiled it for android and the rcc wasn't loaded.
                instead i used multiple qrc files.you can use up to 20mb qrc files.

                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