From 819ec4fe72a585b38b6ab23824eaf39fa21d49af Mon Sep 17 00:00:00 2001 From: Dhaval Patel Date: Sun, 13 Oct 2019 00:24:21 +0530 Subject: [PATCH] Fixed app crash issue due to Camera Permission Fixed ImagePicker crash issue while capturing Camera Image and Camera Permission is Defined in Manifest #34 --- imagepicker/build.gradle | 4 +- imagepicker/src/main/AndroidManifest.xml | 3 +- .../imagepicker/provider/CameraProvider.kt | 69 +++++++++++++++---- .../imagepicker/util/PermissionUtil.kt | 2 +- imagepicker/src/main/res/values/strings.xml | 6 +- sample/build.gradle | 4 +- 6 files changed, 66 insertions(+), 22 deletions(-) diff --git a/imagepicker/build.gradle b/imagepicker/build.gradle index 8434b848..76121caf 100644 --- a/imagepicker/build.gradle +++ b/imagepicker/build.gradle @@ -7,12 +7,12 @@ apply plugin: 'kotlin-android-extensions' apply from: "../ktlint.gradle" android { - compileSdkVersion 29 + compileSdkVersion 28 defaultConfig { minSdkVersion 19 - targetSdkVersion 29 + targetSdkVersion 28 versionCode 5 versionName "1.4" diff --git a/imagepicker/src/main/AndroidManifest.xml b/imagepicker/src/main/AndroidManifest.xml index d6aff572..5259c897 100644 --- a/imagepicker/src/main/AndroidManifest.xml +++ b/imagepicker/src/main/AndroidManifest.xml @@ -3,8 +3,9 @@ + - + Read External Storage permissions is needed to select Image. Please turn on requested permissions from Settings > Permissions. Camera and External Storage permissions are needed to capture image. Turning off any permission won\'t allow application run smoothly. Please turn on all requested permissions from Settings > Permissions. - Permissions.]]> + Permissions.]]> + + Permissions.]]> - Permissions.]]> + Permissions.]]> Failed to create Camera image file Failed to pick Gallery image diff --git a/sample/build.gradle b/sample/build.gradle index 551291a4..77e772a9 100644 --- a/sample/build.gradle +++ b/sample/build.gradle @@ -7,11 +7,11 @@ apply plugin: 'kotlin-android-extensions' apply from: "../ktlint.gradle" android { - compileSdkVersion 29 + compileSdkVersion 28 defaultConfig { applicationId "com.github.dhaval2404.imagepicker.sample" minSdkVersion 19 - targetSdkVersion 29 + targetSdkVersion 28 versionCode 5 versionName "1.4" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"