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. Android 5.5.1 QSettings not writable anymore
Forum Updated to NodeBB v4.3 + New Features

Android 5.5.1 QSettings not writable anymore

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
8 Posts 2 Posters 2.7k 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.
  • uCampaignU Offline
    uCampaignU Offline
    uCampaign
    wrote on last edited by
    #1

    Hi,

    Recompiling existing working Android app with 5.5.1 resulted in QSettings returning status() == 1 and isWritable() == 0.
    The usage is basic, QSettings s; s.setValue(); s.sync();

    Same code works fine with 5.4.2.

    iOS works fine.

    Anyone noticed the same?

    Thanks

    1 Reply Last reply
    0
    • uCampaignU Offline
      uCampaignU Offline
      uCampaign
      wrote on last edited by
      #2

      Additional info:

      The file name used by default for user settings is incorrect in 5.5.1 for Android,

      settings.fileName() reports "/.config/uCampaign/uCampaign.conf"

      while 5.4.2 settings.fileName() reports "/data/data/com.ucampaignapp/files/.config/uCampaign/uCampaign.conf"

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

        Hi,

        Did you also change version of Android in between ?

        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
        • uCampaignU Offline
          uCampaignU Offline
          uCampaign
          wrote on last edited by SGaist
          #4

          Actually yes, first symptoms appeared with Android 6 and API 22 not working, so i updated to API 23. Now with 23 it does not work on Android 4, 5 and 6.
          Could it be Android 6 problem?

          Still, QSetting file name is not correct, which may or may not related.

          I submitted QTBUG-49101.

          [edit: added link to bug report SGaist]

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

            Thanks for the report !

            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
            • uCampaignU Offline
              uCampaignU Offline
              uCampaign
              wrote on last edited by
              #6

              FYI: a workaround

              #ifdef Q_OS_ANDROID
              if (QSettings().fileName().startsWith("/.config")) {
              QSettings::setPath(QSettings::NativeFormat, QSettings::UserScope, QDir::homePath() + "/.config");
              }
              #endif

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

                Thanks !

                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
                • uCampaignU Offline
                  uCampaignU Offline
                  uCampaign
                  wrote on last edited by
                  #8

                  Well, even with this workaround it does not work, seems like the path got reset somewhere and settings are not writable.

                  Until this is fixed 5.5.1 for Android is broken and cannot be used, not sure if Qt must put a warning somewhere

                  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