Solved Cannot grant permission for "android.permission.ACCESS_WIFI_STATE"
-
I've tried using
QtAndroid::requestPermissionsSync(QStringList({"android.permission.ACCESS_WIFI_STATE"}))
before any JNI calls and also including the permission in myAndroidManifest.xml
file, but without success; Art reports that my app still doesn't have permission. What can I do to ensure that my App does have that permission? -
It turns out that I had failed to copy my modified
AndroidManifest.xml
file, asqmake
had copied the default manifest without the required permission tag. Make sure that you have included an assignment toANDROID_PACKAGE_SOURCE_DIR
under theandroid
block in your qmake project file:android { QT += androidextras ANDROID_PACKAGE_SOURCE_DIR = \ $$PWD/android }
I couldn't request the permission with
QtAndroid::requestPermissionsSync
because the underlying Android API method only works for dangerous permissions:android.permission.ACCESS_WIFI_STATE
is classed as a normal permission.