Skip to content

Commit c1ef7b4

Browse files
Merge pull request #460 from juliuscanute/gradle-upgrade
Gradle & sdk update, permission fix
2 parents 4eee401 + 1f9f175 commit c1ef7b4

6 files changed

Lines changed: 17 additions & 12 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.6.2
2+
* Fixed permission error on devices running Android 7 or lower.
3+
* Updated dependencies
4+
15
## 0.6.1
26
* Fix bug which caused build to fail for iOS. (#452)
37

android/build.gradle

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ buildscript {
99
}
1010

1111
dependencies {
12-
classpath 'com.android.tools.build:gradle:7.0.2'
12+
classpath 'com.android.tools.build:gradle:7.0.3'
1313
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1414
}
1515
}
@@ -25,14 +25,15 @@ apply plugin: 'com.android.library'
2525
apply plugin: 'kotlin-android'
2626

2727
android {
28-
compileSdkVersion 30
28+
compileSdkVersion 31
2929

3030
sourceSets {
3131
main.java.srcDirs += 'src/main/kotlin'
3232
}
3333
defaultConfig {
3434
// minSdkVersion is determined by Native View.
3535
minSdkVersion 20
36+
targetSdkVersion 31
3637
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
3738
multiDexEnabled true
3839
}
@@ -48,8 +49,8 @@ android {
4849

4950
dependencies {
5051
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
51-
implementation('com.journeyapps:zxing-android-embedded:4.2.0') { transitive = false }
52-
implementation 'androidx.appcompat:appcompat:1.3.0'
53-
implementation 'com.google.zxing:core:3.3.3'
52+
implementation('com.journeyapps:zxing-android-embedded:4.3.0') { transitive = false }
53+
implementation 'androidx.appcompat:appcompat:1.3.1'
54+
implementation 'com.google.zxing:core:3.4.1'
5455
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
5556
}

android/src/main/kotlin/net/touchcapture/qr/flutterqr/QRView.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,6 @@ class QRView(private val context: Context, messenger: BinaryMessenger, private v
117117
barcodeView!!.resume()
118118
result.success(settings.requestedCameraId)
119119
}
120-
121-
122120
}
123121

124122
private fun getFlashInfo(result: MethodChannel.Result) {
@@ -293,7 +291,9 @@ class QRView(private val context: Context, messenger: BinaryMessenger, private v
293291
}
294292
}
295293
else -> {
296-
result?.error("cameraPermission", "Platform Version to low for camera permission check", null)
294+
// We should have permissions on older OS versions
295+
permissionGranted = true
296+
channel.invokeMethod("onPermissionSet", true)
297297
}
298298
}
299299
}

example/android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ buildscript {
66
}
77

88
dependencies {
9-
classpath 'com.android.tools.build:gradle:7.0.2'
9+
classpath 'com.android.tools.build:gradle:7.0.3'
1010
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1111
}
1212
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Fri Oct 08 10:14:36 CEST 2021
1+
#Tue Nov 16 20:02:48 CET 2021
22
distributionBase=GRADLE_USER_HOME
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip
44
distributionPath=wrapper/dists
55
zipStorePath=wrapper/dists
66
zipStoreBase=GRADLE_USER_HOME

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: qr_code_scanner
22
description: QR code scanner that can be embedded inside flutter. It uses zxing in Android and MTBBarcode scanner in iOS.
3-
version: 0.6.1
3+
version: 0.6.2
44
homepage: https://juliuscanute.com
55
repository: https://github.com/juliuscanute/qr_code_scanner
66

0 commit comments

Comments
 (0)