googlesamples / easypermissions

Simplify Android M system permissions
https://firebaseopensource.com/projects/googlesamples/easypermissions/
Apache License 2.0
9.86k stars 1.46k forks source link

requestPermissions method doesn't show RationaleDialog androidx #279

Closed ngallazzi closed 5 years ago

ngallazzi commented 5 years ago

Basic Information

Device type: Xiaomi Redmi 5 OS version: 8.1 EasyPermissions version: 3.0.0

Describe the problem

Permission dialog doesn't open on permission request

Code and logs

 private var perms = arrayOf(Manifest.permission.ACCESS_FINE_LOCATION)
  EasyPermissions.requestPermissions(this@MainActivity, "Please enable location permissions",
                RC_LOCATION, *perms)

Gradle:

`apply plugin: 'com.android.application'

apply plugin: 'kotlin-android'

apply plugin: 'kotlin-android-extensions' apply plugin: 'kotlin-kapt'

android { compileSdkVersion 28 defaultConfig { applicationId "it.zehus.bitridewalbikesampleapp" minSdkVersion 21 targetSdkVersion 28 versionCode 1 versionName "1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } compileOptions { sourceCompatibility 1.8 targetCompatibility 1.8 } }

dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation 'androidx.appcompat:appcompat:1.0.2'

implementation files('libs/bikeaccesssdk-v1.3.aar')
// Room for request caching
implementation 'android.arch.persistence.room:runtime:1.1.1'
kapt 'android.arch.persistence.room:compiler:1.1.1'
// Polidea for bluetooth
implementation "com.polidea.rxandroidble2:rxandroidble:1.8.1"
// Coroutines for suspend functions
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.1.1'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.1.1'
implementation 'com.jakewharton.retrofit:retrofit2-kotlin-coroutines-adapter:0.9.2'
// Reflection
implementation "org.jetbrains.kotlin:kotlin-reflect:1.3.21"
// Retrofit - Http calls
implementation 'com.squareup.retrofit2:retrofit:2.5.0'
// Logging interceptor - Http calls logging
implementation 'com.squareup.okhttp3:logging-interceptor:3.12.1'
// Moshi - Json converter
implementation 'com.squareup.retrofit2:converter-moshi:2.5.0'

implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'pub.devrel:easypermissions:3.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.0-alpha4'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0-alpha4'

} `

agoodcoolman commented 1 year ago

How resolve this problem?