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. Cannot grant permission for "android.permission.ACCESS_WIFI_STATE"
Forum Updated to NodeBB v4.3 + New Features

Cannot grant permission for "android.permission.ACCESS_WIFI_STATE"

Scheduled Pinned Locked Moved Solved Mobile and Embedded
2 Posts 1 Posters 350 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.
  • B Offline
    B Offline
    ben.cottrell
    wrote on last edited by
    #1

    I've tried using QtAndroid::requestPermissionsSync(QStringList({"android.permission.ACCESS_WIFI_STATE"})) before any JNI calls and also including the permission in my AndroidManifest.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?

    1 Reply Last reply
    0
    • B Offline
      B Offline
      ben.cottrell
      wrote on last edited by
      #2

      It turns out that I had failed to copy my modified AndroidManifest.xml file, as qmake had copied the default manifest without the required permission tag. Make sure that you have included an assignment to ANDROID_PACKAGE_SOURCE_DIR under the android 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.

      1 Reply Last reply
      3

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved