Unsolved Android 5.5.1 QSettings not writable anymore
-
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
-
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"
-
Hi,
Did you also change version of Android in between ?
-
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]
-
Thanks for the report !
-
FYI: a workaround
#ifdef Q_OS_ANDROID
if (QSettings().fileName().startsWith("/.config")) {
QSettings::setPath(QSettings::NativeFormat, QSettings::UserScope, QDir::homePath() + "/.config");
}
#endif -
Thanks !
-
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