Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can not find Symbol Manifest.permission.WRITE_EXTERNAL_STORAGE on v23

I am compile code with following build.gradle file

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.1"

    defaultConfig {

        applicationId "com.example"
        minSdkVersion 15
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

For accessing saving photo into SDCARD i have opened permission Dialog box for V23

like below screenshot

enter image description here

But I am getting following error that

Can not find Symbol Manifest.permission.WRITE_EXTERNAL_STORAGE

I have put sdkVersion to 23 but why i am still getting this error

like image 928
Siddhpura Amit Avatar asked Nov 02 '15 07:11

Siddhpura Amit


People also ask

What is Call_phone permission?

permission. CALL_PHONE. directly call phone numbers. Allows the app to call phone numbers without your intervention.


3 Answers

Finally I found that Menifest file is autogenerated by Android Studio

In AndroideMenifest i have written following code for ParsePushNotification

 <!--
      IMPORTANT: Change "com.parse.starter.permission.C2D_MESSAGE" in the lines below
      to match your app's package name + ".permission.C2D_MESSAGE".
    -->
    <permission android:protectionLevel="signature"
        android:name="com.example.permission.C2D_MESSAGE" />
    <uses-permission android:name="com.example.permission.C2D_MESSAGE" />

and below menifest file is generated

enter image description here

So when i have written code below it's works

android.Manifest.permission.WRITE_EXTERNAL_STORAGE

instead of

Manifest.permission.WRITE_EXTERNAL_STORAGE

like image 115
Siddhpura Amit Avatar answered Nov 05 '22 11:11

Siddhpura Amit


Only write Android before manifest class. Change:

Manifest.permission.WRITE_CALENDAR

to:

android.Manifest.permission.WRITE_CALENDAR

like image 26
Anand Raj Mehta Avatar answered Nov 05 '22 13:11

Anand Raj Mehta


I think you can use Manifest class from android in android.Manifest.permission or android.Manifest.permission_group. For detail permission types you can read from this Manifest.permission, see this

int permissionCheck = ContextCompat.checkSelfPermission(thisActivity,
    android.Manifest.permission.WRITE_CALENDAR);
like image 40
icaksama Avatar answered Nov 05 '22 11:11

icaksama