Skip to content

Commit

Permalink
Fix React Native Configuration (#80)
Browse files Browse the repository at this point in the history
* fix react native configuration

* fix react native configuration

* fixed kotlin version

* Fix kotlin version setup

* Fix kotlin version setup
  • Loading branch information
jumaallan authored Dec 6, 2024
1 parent 2cfc5c6 commit b4ae365
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 11 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
18 changes: 12 additions & 6 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -14,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"
}
Expand All @@ -25,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]
Expand Down Expand Up @@ -71,6 +76,7 @@ android {
targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")

}

buildTypes {
release {
minifyEnabled false
Expand All @@ -91,7 +97,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 {
Expand All @@ -112,8 +118,8 @@ repositories {
gradlePluginPortal()
}

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 kotlin_version = rootProject.ext.has("kotlinVersion") ? rootProject.ext.get("kotlinVersion") : project.properties["SmileId_kotlinVersion"]
def smile_id_sdk_version = project.properties["SmileId_androidVersion"]

dependencies {
implementation "com.facebook.react:react-native:0.72"
Expand Down
1 change: 1 addition & 0 deletions android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 2 additions & 1 deletion example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -114,7 +115,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()) {
Expand Down
3 changes: 3 additions & 0 deletions example/android/app/src/main/assets/.gitignore
Original file line number Diff line number Diff line change
@@ -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
4 changes: 3 additions & 1 deletion example/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,22 @@ 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"
}

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"
}
Expand Down
4 changes: 2 additions & 2 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@smile_identity/react-native",
"version": "10.2.1",
"version": "10.2.2",
"description": "Official wrapper for the Smile ID <v10 android and iOS SDKs",
"main": "lib/commonjs/index",
"module": "lib/module/index",
Expand Down

0 comments on commit b4ae365

Please sign in to comment.