1

I added permissions to AndroidManifest.xml and I check it is upper than <application but when I build it to AVD, It doesn't have permissions.

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.gioom">

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
    <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
    <uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme"
        android:networkSecurityConfig="@xml/network_security_config">

there is only storage permission

pic of AVD

KimRuhr
  • 37
  • 8

1 Answers1

3

In newer android versions you must request certain permissions from the user at runtime in addition to declaring them in the Manifest.

See the official documentation for more info

Hope this helps.

orimen
  • 571
  • 4
  • 11
  • ```WRITE_EXTERNAL_STORATE``` was just test. I added ```INTERNET``` and ```WIFI_STATE``` request in kt, but there is only storage... It is so strange. I can't understand why is it. I check spelling too! – KimRuhr Jun 25 '20 at 11:01
  • Some permissions does not require asking the user such as INTERNET. However, when your app requires a special permission (such as LOCATION, STORAGE etc.) you have to ask the user at runtime - this started at android 6 (API 23). – orimen Jun 25 '20 at 11:33
  • Oh... Tkx It is help to me T0T – KimRuhr Jun 26 '20 at 04:29