Support
Quality
Security
License
Reuse
kandi has reviewed PermissionsDispatcher and discovered the below as its top functions. This is intended to give you an instant insight into PermissionsDispatcher implemented functionality, and help decide if they suit your requirements.
Fully Kotlin/Java support
Special permissions support
100% reflection-free
1. Attach annotations
@RuntimePermissions
class MainActivity : AppCompatActivity(), View.OnClickListener {
@NeedsPermission(Manifest.permission.CAMERA)
fun showCamera() {
supportFragmentManager.beginTransaction()
.replace(R.id.sample_content_fragment, CameraPreviewFragment.newInstance())
.addToBackStack("camera")
.commitAllowingStateLoss()
}
@OnShowRationale(Manifest.permission.CAMERA)
fun showRationaleForCamera(request: PermissionRequest) {
showRationaleDialog(R.string.permission_camera_rationale, request)
}
@OnPermissionDenied(Manifest.permission.CAMERA)
fun onCameraDenied() {
Toast.makeText(this, R.string.permission_camera_denied, Toast.LENGTH_SHORT).show()
}
@OnNeverAskAgain(Manifest.permission.CAMERA)
fun onCameraNeverAskAgain() {
Toast.makeText(this, R.string.permission_camera_never_askagain, Toast.LENGTH_SHORT).show()
}
}
2. Delegate to generated functions
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
findViewById(R.id.button_camera).setOnClickListener {
// NOTE: delegate the permission handling to generated function
showCameraWithPermissionCheck()
}
}
override fun onRequestPermissionsResult(requestCode: Int, permissions: Array<String>, grantResults: IntArray) {
super.onRequestPermissionsResult(requestCode, permissions, grantResults)
// NOTE: delegate the permission handling to generated function
onRequestPermissionsResult(requestCode, grantResults)
}
Installation
dependencies {
implementation "com.github.permissions-dispatcher:permissionsdispatcher:${latest.version}"
annotationProcessor "com.github.permissions-dispatcher:permissionsdispatcher-processor:${latest.version}"
}
License
Copyright 2016 Shintaro Katafuchi, Marcel Schnelle, Yoshinori Isogai
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
getOr, put() and edit() can not resolve in org.androidannotations:androidannotations
defaultConfig {
minSdkVersion 21
targetSdkVersion 29
// If you have different applicationIds for buildTypes or productFlavors uncomment this block.
javaCompileOptions {
annotationProcessorOptions {
arguments = ["resourcePackageName": android.defaultConfig.applicationId]
}
}
}
QUESTION
Program type already present: com.hlab.fabrevealmenu.model.FABMenuItem
Asked 2020-May-04 at 14:25I've been receiving the following error whenever i try to "Generate Signed Bundle / Apk" in android studio : Program type already present: com.hlab.fabrevealmenu.model.FABMenuItem
The app works perfectly when i run it with android studio on my smartphone or on the emulator.
this is my Build.gradle (Module app)
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply plugin: 'androidx.navigation.safeargs'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 29
buildToolsVersion "29.0.1"
defaultConfig {
applicationId "com.mtp.laboproject"
minSdkVersion 19
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
shrinkResources false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
release {
minifyEnabled false
shrinkResources false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
buildConfigField "String", "BASE_URL", "\"http://picking-geant.ddns.net:84/\""
}
}
dataBinding {
enabled = true
}
compileOptions {
sourceCompatibility = 1.8
targetCompatibility = 1.8
}
}
dependencies {
def cor_version = "1.3.2"
def lifecycle_version = "2.2.0-rc02"
def retrofit_version = "2.6.0"
def work_version = "2.2.0"
def anko_version = '0.10.8'
def dispatcher_version = '4.6.0'
def rxJavaVersion = '2.0.1'
implementation 'com.google.firebase:firebase-analytics:17.2.1'
implementation 'com.google.firebase:firebase-messaging:20.0.1'
implementation 'com.google.firebase:firebase-core:17.2.1'
implementation 'com.google.firebase:firebase-auth:19.2.0'
// Kotlin + coroutines + RX
implementation "androidx.work:work-runtime-ktx:$work_version"
implementation "io.reactivex.rxjava2:rxandroid:$rxJavaVersion"
implementation "io.reactivex.rxjava2:rxjava:$rxJavaVersion"
implementation 'com.android.support:multidex:1.0.3'
//bind view
implementation 'com.jakewharton:butterknife:8.8.1'
// implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.core:core-ktx:1.0.2'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation "org.jetbrains.anko:anko:$anko_version"
// ViewModel and LiveData
implementation "androidx.lifecycle:lifecycle-extensions:2.1.0"
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.1.0'
//Kodein Dependency Injection
implementation "org.kodein.di:kodein-di-generic-jvm:6.3.2"
implementation "org.kodein.di:kodein-di-framework-android-x:6.3.2"
implementation "androidx.appcompat:appcompat:1.0.2"
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
implementation "com.squareup.retrofit2:retrofit:$retrofit_version"
implementation "com.squareup.retrofit2:converter-gson:$retrofit_version"
implementation "com.squareup.retrofit2:converter-moshi:$retrofit_version"
implementation "com.jakewharton.retrofit:retrofit2-kotlin-coroutines-adapter:0.9.2"
implementation "com.jakewharton.retrofit:retrofit2-rxjava2-adapter:1.0.0"
// Json to/from Object
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'com.fasterxml.jackson.module:jackson-module-kotlin:2.8.+'
implementation 'com.squareup.okhttp3:logging-interceptor:3.11.0'
// set biometric bio
implementation 'androidx.biometric:biometric:1.0.0'
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$cor_version"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$cor_version"
// ViewModel and LiveData
implementation "androidx.lifecycle:lifecycle-extensions:$lifecycle_version"
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'com.github.bumptech.glide:glide:4.10.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.10.0'
implementation 'com.android.support:design:29.0.0'
implementation 'com.google.android.material:material:1.1.0-beta02'
implementation 'com.squareup.okhttp3:okhttp:3.10.0'
//dagger support
implementation 'com.google.dagger:dagger:2.13'
kapt 'com.google.dagger:dagger-compiler:2.13'
implementation "com.google.dagger:dagger-android-support:2.11"
implementation "com.google.dagger:dagger:2.11"
kapt "android.arch.persistence.room:compiler:1.1.1"
kapt "com.google.dagger:dagger-compiler:2.11"
implementation "org.permissionsdispatcher:permissionsdispatcher:$dispatcher_version"
kapt "org.permissionsdispatcher:permissionsdispatcher-processor:$dispatcher_version"
implementation 'com.scottyab:secure-preferences-lib:0.1.7'
implementation 'de.hdodenhof:circleimageview:3.0.1'
//ExiInterface from androidx
implementation "androidx.exifinterface:exifinterface:1.1.0"
implementation 'com.google.android.gms:play-services-maps:17.0.0'
implementation 'com.google.android.gms:play-services-location:17.0.0'
implementation 'org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.1.0'
implementation 'org.eclipse.paho:org.eclipse.paho.android.service:1.1.1'
implementation project(':fabrevealmenu')
}
apply plugin: 'com.google.gms.google-services'
And this is my Build.gradle (Module fabrevealmenu)
apply plugin: 'com.android.library'
android {
//noinspection GradleCompatible
compileSdkVersion 27
defaultConfig {
minSdkVersion 19
targetSdkVersion 26
versionCode 4
versionName "1.0.4"
vectorDrawables.useSupportLibrary = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
// implementation fileTree(include: ['*.jar'], dir: 'libs')
api 'com.android.support:appcompat-v7:27.1.1'
api 'com.android.support:recyclerview-v7:27.1.1'
api 'com.android.support:cardview-v7:27.1.1'
api 'com.android.support:design:27.1.0'
//External libs
implementation 'com.github.asyl.animation:arcanimator:1.0.0'
}
ext {
PUBLISH_GROUP_ID = 'com.hlab.fabrevealmenu'
PUBLISH_ARTIFACT_ID = 'fab-reveal-menu'
PUBLISH_VERSION = '1.0.4'
}
I should also note that i have tried some of the suggested solutions in other topics but they didn't work.
ANSWER
Answered 2020-May-04 at 14:25Problem was solved. The project isn't mine, there actually was a library that was made as a second project, and a file of it was created inside the main project. All had to do was to remove the file in main project and add "import" to second project. Thank you all
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
No vulnerabilities reported
Save this library and start creating your kit
Save this library and start creating your kit