java.lang.reflect.InvocationTargetException

tip

Android SDK 23 introduced a new way to handle permissions, so as a temporary workaround you can set it to build for SDK below 23. As a permanent solution you have to ask user during runtime for permissions with checkSelfPermission() or requestPermissions()

tip

You need the permission android.permission.READ_EXTERNAL_STORAGE. Write on the Android Manifest

tip

MANAGE_USERS has a protection level of signature|system, so your application must be signed with the platform key. Take a look on this https://goo.gl/nXsTvH for more information about it.

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

  • UserManager getUserCount() (Jelly Bean)
    via Stack Overflow by Kedi
    ,
  • Dealing with Download Listener in Android
    via Stack Overflow by Alok Kumar
    ,
    • java.lang.reflect.InvocationTargetException at java.lang.reflect.Method.invoke(Native Method) at com.mady.wifi.api.WifiHotSpots.setHotSpot(WifiHotSpots.java:505) at de.martinreinhardt.cordova.plugins.hotspot.HotSpotPlugin.createHotspot(HotSpotPlugin.java:611) at de.martinreinhardt.cordova.plugins.hotspot.HotSpotPlugin$4.run(HotSpotPlugin.java:123) at de.martinreinhardt.cordova.plugins.hotspot.HotSpotPlugin$29.run(HotSpotPlugin.java:855) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) at java.lang.Thread.run(Thread.java:818) Caused by: java.lang.SecurityException: com.ionicframework.reliancesmarthome307271 was not granted this permission: android.permission.WRITE_SETTINGS. at android.os.Parcel.readException(Parcel.java:1620) at android.os.Parcel.readException(Parcel.java:1573) at android.net.wifi.IWifiManager$Stub$Proxy.setWifiApEnabled(IWifiManager.java:1964) at android.net.wifi.WifiManager.setWifiApEnabled(WifiManager.java:2192)

    Users with the same issue

    filipebatista
    21 times, last one,
    Hiren Amaliyar
    8 times, last one,
    Aravind
    86 times, last one,
    Indri Yunita
    199 times, last one,
    Unknown User
    4 times, last one,
    229 more bugmates