From e39e60d889834346008dd5fb327d96b3ecaf2a89 Mon Sep 17 00:00:00 2001 From: Robin Farmer Date: Wed, 19 Oct 2022 15:22:48 +0200 Subject: [PATCH] Upgrade compile and target SDK Android. --- CHANGELOG.md | 1 + android/build.gradle | 16 ++++++++++++++-- example/android/app/build.gradle | 4 ++-- example/lib/main.dart | 8 +------- 4 files changed, 18 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 60a48fc..9d3e4ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ - Bump iOS to version 0.5.4 - Bump Android to version 2.1.9 +- Bump Android compile and target SDK to 33. ## 0.0.8 diff --git a/android/build.gradle b/android/build.gradle index b59c956..1c59353 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,6 +1,16 @@ group 'com.klippa.scanner.klippa_scanner_sdk' version '1.0-SNAPSHOT' +def DEFAULT_COMPILE_SDK_VERSION = 33 +def DEFAULT_BUILD_TOOLS_VERSION = '30.0.3' +def DEFAULT_MIN_SDK_VERSION = 21 +def DEFAULT_TARGET_SDK_VERSION = 33 + +def safeExtGet(prop, fallback) { + rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback +} + + buildscript { ext.kotlin_version = '1.6.10' repositories { @@ -39,13 +49,15 @@ apply plugin: 'com.android.library' apply plugin: 'kotlin-android' android { - compileSdkVersion 29 + compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION) + buildToolsVersion safeExtGet('buildToolsVersion', DEFAULT_BUILD_TOOLS_VERSION) sourceSets { main.java.srcDirs += 'src/main/kotlin' } defaultConfig { - minSdkVersion 21 + minSdkVersion safeExtGet('minSdkVersion', DEFAULT_MIN_SDK_VERSION) + targetSdkVersion safeExtGet('targetSdkVersion', DEFAULT_TARGET_SDK_VERSION) } lintOptions { disable 'InvalidPackage' diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index c96908e..a172fd7 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -26,7 +26,7 @@ apply plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { - compileSdkVersion 31 + compileSdkVersion 33 sourceSets { main.java.srcDirs += 'src/main/kotlin' @@ -41,7 +41,7 @@ android { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "com.klippa.scanner.examplekotlin" minSdkVersion 21 - targetSdkVersion 31 + targetSdkVersion 33 versionCode flutterVersionCode.toInteger() versionName flutterVersionName } diff --git a/example/lib/main.dart b/example/lib/main.dart index 5d17b72..68dc2ff 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -26,14 +26,8 @@ class _MyAppState extends State { void _startSession() async { String sessionResultText = 'Unknown'; var config = CameraConfig(); - - config.model.fileName = "model"; - config.model.modelLabels = "labelmap"; + // setup your scanner config.storeImagesToCameraRol = true; - config.defaultColor = DefaultColor.original; - config.imageColorOriginalText = "original"; - config.imageColorGrayscaleText = "grayscale"; - config.imageColorEnhancedText = "enhanced"; try { var result = await KlippaScannerSdk.startSession(config, license); sessionResultText = 'Finished';