javaandroidandroid-studiokotlinandroid-permissions

Android manifest POST_NOTIFICATIONS missing import


Trying to implement the notification permission for android 13 or "Tiramisu" but failed to get the import for that permission.

Currently: targeted SDK version is 32 compile SDK version is 32

I've declared it also in manifiest as below:

 <uses-permission android:name="android.permission.POST_NOTIFICATIONS"

import i'm using:

import android.Manifest

enter image description here


Solution

  • Add this to your java/kotlin file:

    import android.Manifest
    

    Manifest:
        android {
         namespace 'com.example.myapplication'
        compileSdkVersion 33//update this
    
         defaultConfig {
            applicationId "com.example.myapplication"
            minSdk 23
            targetSdkVersion 33//update this
            versionCode 1
            versionName "1.0"
            
            testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        }