From 46aacdb3a11e70561a1f516d7fe4d4ebccbf16a8 Mon Sep 17 00:00:00 2001 From: Juma Allan Date: Fri, 6 Dec 2024 12:33:28 +0300 Subject: [PATCH 1/5] fix react native configuration --- android/build.gradle | 3 +-- example/android/app/src/main/assets/.gitignore | 3 +++ example/android/build.gradle | 1 - 3 files changed, 4 insertions(+), 3 deletions(-) create mode 100644 example/android/app/src/main/assets/.gitignore diff --git a/android/build.gradle b/android/build.gradle index dc9e8f0..719d1c9 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -3,7 +3,6 @@ import com.android.Version buildscript { // Buildscript is evaluated before everything else so we can't use getExtOrDefault def kotlin_version = rootProject.ext.has("kotlinVersion") ? rootProject.ext.get("kotlinVersion") : project.properties["SmileId_kotlinVersion"] - def smile_id_sdk_version = rootProject.ext.has("androidVersion") ? rootProject.ext.get("androidVersion") : project.properties["SmileId_androidVersion"] repositories { google() @@ -113,7 +112,7 @@ repositories { } def kotlin_version = rootProject.ext.has("kotlinVersion") ? rootProject.ext.get("kotlinVersion") : getExtOrDefault("kotlinVersion") -def smile_id_sdk_version = rootProject.ext.has("androidVersion") ? rootProject.ext.get("androidVersion") : getExtOrDefault("androidVersion") +def smile_id_sdk_version = project.properties["SmileId_androidVersion"] dependencies { implementation "com.facebook.react:react-native:0.72" diff --git a/example/android/app/src/main/assets/.gitignore b/example/android/app/src/main/assets/.gitignore new file mode 100644 index 0000000..6c73564 --- /dev/null +++ b/example/android/app/src/main/assets/.gitignore @@ -0,0 +1,3 @@ +# This .gitignore file is not technically necessary, but it is retained here in order for the assets +# directory to be included in git, as it would otherwise be empty +smile_config.json diff --git a/example/android/build.gradle b/example/android/build.gradle index 5b49718..e667978 100644 --- a/example/android/build.gradle +++ b/example/android/build.gradle @@ -7,7 +7,6 @@ buildscript { compileSdkVersion = 35 targetSdkVersion = 35 kotlinVersion = "2.0.0" - kotlin_version = "2.0.0" // We use NDK 23 which has both M1 support and is the side-by-side NDK version from AGP. ndkVersion = "26.1.10909125" From 2cd6336ac7c6236e6235ee066b7357d63594e502 Mon Sep 17 00:00:00 2001 From: Juma Allan Date: Fri, 6 Dec 2024 12:40:58 +0300 Subject: [PATCH 2/5] fix react native configuration --- android/build.gradle | 4 ++-- android/gradle.properties | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index 719d1c9..3094dcc 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -90,7 +90,7 @@ android { } composeOptions { - kotlinCompilerExtensionVersion rootProject.ext.has("kotlinCompilerExtensionVersion") ? rootProject.ext.get("kotlinCompilerExtensionVersion") : '1.5.11' + kotlinCompilerExtensionVersion rootProject.ext.has("kotlinCompilerExtensionVersion") ? rootProject.ext.get("kotlinCompilerExtensionVersion") : project.properties["SmileId_kotlinCompilerExtensionVersion"] } compileOptions { @@ -111,7 +111,7 @@ repositories { gradlePluginPortal() } -def kotlin_version = rootProject.ext.has("kotlinVersion") ? rootProject.ext.get("kotlinVersion") : getExtOrDefault("kotlinVersion") +def kotlin_version = rootProject.ext.has("kotlinVersion") ? rootProject.ext.get("kotlinVersion") : project.properties["SmileId_kotlinVersion"] def smile_id_sdk_version = project.properties["SmileId_androidVersion"] dependencies { diff --git a/android/gradle.properties b/android/gradle.properties index 2570246..60bccda 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -4,3 +4,4 @@ SmileId_targetSdkVersion=34 SmileId_compileSdkVersion=34 SmileId_ndkversion=21.4.7075529 SmileId_androidVersion=10.3.7 +SmileId_kotlinCompilerExtensionVersion=1.5.11 From 860a8a84e8720701ad3cfbff6a90a027b28527de Mon Sep 17 00:00:00 2001 From: Juma Allan Date: Fri, 6 Dec 2024 12:57:49 +0300 Subject: [PATCH 3/5] fixed kotlin version --- example/android/app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index 0a174a1..97b3c68 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -114,7 +114,7 @@ android { dependencies { // The version of react-native is set by the React Native Gradle Plugin implementation("com.facebook.react:react-android") - implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" + implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion" implementation("androidx.compose.runtime:runtime:1.7.5") if (hermesEnabled.toBoolean()) { From 1dcf4ce834ded1bae294c715ef34235aca15b5be Mon Sep 17 00:00:00 2001 From: Juma Allan Date: Fri, 6 Dec 2024 14:25:52 +0300 Subject: [PATCH 4/5] Fix kotlin version setup --- CHANGELOG.md | 3 +++ android/build.gradle | 11 +++++++++-- example/ios/Podfile.lock | 4 ++-- package.json | 2 +- 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bf85f4f..dc6a19d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Release Notes +## 10.2.2 +* Fixed setting `kotlinVersion` and `kotlinCompilerExtensionVersion` + ## 10.2.1 * Allow skipApiSubmission which will capture Enrollment, Authentication, Doc V and Enhanced DocV without submitting to SmileID and will return captured images file paths * Bump android to 10.3.7 (https://github.com/smileidentity/android/releases/tag/v10.3.7) diff --git a/android/build.gradle b/android/build.gradle index 3094dcc..b6a0756 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -13,7 +13,9 @@ buildscript { dependencies { classpath "com.android.tools.build:gradle:8.3.2" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath "org.jetbrains.kotlin:compose-compiler-gradle-plugin:$kotlin_version" + if (kotlinVersion?.startsWith("2")) { + classpath "org.jetbrains.kotlin:compose-compiler-gradle-plugin:$kotlin_version" + } classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version" classpath "org.jlleitschuh.gradle:ktlint-gradle:12.1.1" } @@ -24,12 +26,16 @@ def reactNativeArchitectures() { return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"] } +def kotlinVersion = rootProject.ext.has("kotlinVersion") ? rootProject.ext.get("kotlinVersion") : project.properties["SmileId_kotlinVersion"] + apply plugin: "com.android.library" apply plugin: "kotlin-android" apply plugin: 'kotlin-kapt' apply plugin: "org.jlleitschuh.gradle.ktlint" apply plugin: "org.jetbrains.kotlin.plugin.serialization" -apply plugin: "org.jetbrains.kotlin.plugin.compose" +if (kotlinVersion?.startsWith("2")) { + apply plugin: "org.jetbrains.kotlin.plugin.compose" +} def getExtOrDefault(name) { return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties["SmileId_" + name] @@ -70,6 +76,7 @@ android { targetSdkVersion getExtOrIntegerDefault("targetSdkVersion") } + buildTypes { release { minifyEnabled false diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index 7716fa8..2bce1dc 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -943,7 +943,7 @@ PODS: - React-debug - react-native-safe-area-context (4.14.0): - React-Core - - react-native-smile-id (10.2.1): + - react-native-smile-id (10.2.2): - DoubleConversion - glog - hermes-engine @@ -1444,7 +1444,7 @@ SPEC CHECKSUMS: React-logger: 29fa3e048f5f67fe396bc08af7606426d9bd7b5d React-Mapbuffer: bf56147c9775491e53122a94c423ac201417e326 react-native-safe-area-context: 4532f1a0c5d34a46b9324ccaaedcb5582a302b7d - react-native-smile-id: 532b565ae067ba715dfb06588ebd1d9aaa3eec30 + react-native-smile-id: 51ea0d04401552e49a59558ca6eb1b199cc3f16d React-nativeconfig: 9f223cd321823afdecf59ed00861ab2d69ee0fc1 React-NativeModulesApple: ff7efaff7098639db5631236cfd91d60abff04c0 React-perflogger: 32ed45d9cee02cf6639acae34251590dccd30994 diff --git a/package.json b/package.json index 6bcf6f6..e15adae 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@smile_identity/react-native", - "version": "10.2.1", + "version": "10.2.2", "description": "Official wrapper for the Smile ID Date: Fri, 6 Dec 2024 14:28:02 +0300 Subject: [PATCH 5/5] Fix kotlin version setup --- example/android/app/build.gradle | 1 + example/android/build.gradle | 3 +++ 2 files changed, 4 insertions(+) diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index 97b3c68..93e5476 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -2,6 +2,7 @@ apply plugin: "com.android.application" apply plugin: "com.facebook.react" apply plugin: "kotlin-android" apply plugin: "org.jlleitschuh.gradle.ktlint" +// only needed if we are using kotlin 2.0.0 or later apply plugin: "org.jetbrains.kotlin.plugin.compose" /** * This is the configuration block to customize your React Native Android app. diff --git a/example/android/build.gradle b/example/android/build.gradle index e667978..27df5fa 100644 --- a/example/android/build.gradle +++ b/example/android/build.gradle @@ -11,15 +11,18 @@ buildscript { // We use NDK 23 which has both M1 support and is the side-by-side NDK version from AGP. ndkVersion = "26.1.10909125" } + repositories { google() mavenCentral() gradlePluginPortal() } + dependencies { classpath "com.facebook.react:react-native-gradle-plugin" classpath 'com.android.tools.build:gradle:8.6.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion" + // only needed if we are using kotlin 2.0.0 or later classpath "org.jetbrains.kotlin:compose-compiler-gradle-plugin:$kotlinVersion" classpath "org.jlleitschuh.gradle:ktlint-gradle:12.1.1" }