Open adtoba opened 8 months ago
Very likely that you need to update either your Kotlin version or SDK version.
What version of the SDK are you using? What are the Gradle and Kotlin versions?
Kotlin version: 1.9.23 smile_id: ^10.0.8
I have tried a lot of things to get it to work but it didn't.
Very likely that you need to update either your Kotlin version or SDK version.
What version of the SDK are you using?
What are the Gradle and Kotlin versions?
Please try Kotlin 1.9.22. Jetpack Compose only just added support for Kotlin 1.9.23 last week in Compiler version 1.5.11 (https://developer.android.com/jetpack/androidx/releases/compose-compiler#1.5.11)
We will support Kotlin 1.9.23 in the next release
I just tried it.
This is the new error i am getting.
This version (1.5.3) of the Compose Compiler requires Kotlin version 1.9.10 but you appear to be using Kotlin version 1.9.22 which is not known to be compatible. Please consult the Compose-Kotlin compatibility map located at https://developer.android.com/jetpack/androidx/releases/compose-kotlin to choose a compatible version pair (or suppressKotlinVersionCompatibilityCheck
but don't say I didn't warn you!).
This is my app build.gradle file
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
apply plugin: 'com.android.application'
// START: FlutterFire Configuration
apply plugin: 'com.google.gms.google-services'
// END: FlutterFire Configuration
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
//apply plugin: 'com.smileidentity.smile-id-android'
def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}
android {
compileSdkVersion 34
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = '17'
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
lintOptions {
checkReleaseBuilds false
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.greach.greachapp"
minSdkVersion 21
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
multiDexEnabled true
manifestPlaceholders += [
'appAuthRedirectScheme': 'com.greach.greachapp'
]
ndk {
abiFilters 'armeabi', 'x86', 'armeabi-v7a', 'arm64-v8a', 'x86_64', 'mips', 'mips64'
}
}
signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword keystoreProperties['storePassword']
}
}
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
// signingConfig signingConfigs.debug
signingConfig signingConfigs.release
}
}
packagingOptions {
exclude 'META-INF/androidx.*'
exclude 'androidx.*'
exclude 'META-INF/DEPENDENCIES'
}
}
flutter {
source '../..'
}
dependencies {
// implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
// implementation 'com.smileidentity:smile-id-ui:0.1.45-SNAPSHOT'
// implementation 'com.smileidentity:smile-id-sdk:7.2.49-SNAPSHOT'
// implementation 'com.android.support:multidex:1.0.3'
// implementation 'com.smileidentity:smile-id-ui:<latest_version>'
// implementation 'com.smileidentity:smile-id-sdk:<latest_version>'
// implementation 'com.smileidentity:netjava:<latest_version>'// currently (0.0.8)
}
This is my android build.gradle file
buildscript {
//ext.kotlin_version = '1.6.10'
ext.kotlin_version = '1.9.22'
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.4.2'
// START: FlutterFire Configuration
classpath 'com.google.gms:google-services:4.4.0'
// END: FlutterFire Configuration
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// classpath group: 'com.smileidentity', name: 'smile-id-android', version: '1.0.1'
}
}
allprojects {
repositories {
google()
mavenCentral()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
We ship 1.5.8 with the latest version of the SDK, so it's possible some other library is overriding it to 1.5.3.
Can you try setting it explicitly in your app build.gradle in the android
block?
android {
// your existing gradle config
buildFeatures {
compose true
}
composeOptions {
kotlinCompilerExtensionVersion compose_version
kotlinCompilerVersion = "1.5.10"
}
// your existing gradle config
}
We ship 1.5.8 with the latest version of the SDK, so it's possible some other library is overriding it to 1.5.3.
Can you try setting it explicitly in your app build.gradle in the
android
block?android { // your existing gradle config buildFeatures { compose true } composeOptions { kotlinCompilerExtensionVersion compose_version kotlinCompilerVersion = "1.5.10" } // your existing gradle config }
Yes this worked. I was able to build after i did this.
Great! We've also updated our Flutter docs to hopefully make this setup process a bit clearer for others: https://docs.usesmileid.com/integration-options/mobile/flutter-v10/getting-started#android-specific-setup
We ship 1.5.8 with the latest version of the SDK, so it's possible some other library is overriding it to 1.5.3.
Can you try setting it explicitly in your app build.gradle in the
android
block?android { // your existing gradle config buildFeatures { compose true } composeOptions { kotlinCompilerExtensionVersion compose_version kotlinCompilerVersion = "1.5.10" } // your existing gradle config }
Did this but the error still persist, please is there any other way to go about this? I am on the latest version of smile_id ^10.1.7 but still get the error below
e: This version (1.5.3) of the Compose Compiler requires Kotlin version 1.9.10 but you appear to be using Kotlin version 1.9.22 which is not known to be compatible. Please consult the Compose-Kotlin compatibility map located at https://developer.android.com/jetpack/androidx/releases/compose-kotlin to choose a compatible version pair (or suppressKotlinVersionCompatibilityCheck
but don't say I didn't warn you!).
FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ':smile_id:compileDebugKotlin'.
A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction Compilation error. See log for more details
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. Get more help at https://help.gradle.org.
BUILD FAILED in 25s Error: Gradle task assembleDebug failed with exit code 1
@akwa-peter Can you share the Gradle and Kotlin versions you are using? Also, have you specified a kotlinCompilerExtensionVersion?
@akwa-peter Can you share the Gradle and Kotlin versions you are using? Also, have you specified a kotlinCompilerExtensionVersion?
Yes see my plugin kotlin version plugins { id "dev.flutter.flutter-plugin-loader" version "1.0.0" id "com.android.application" version "7.3.1" apply false id "org.jetbrains.kotlin.android" version "1.9.22" apply false id "com.google.gms.google-services" version "4.4.1" apply false //4.3.15 }
And here is my gradle version
distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-all.zip
Also see my set kotlin compiler version `buildFeatures { compose true } composeOptions { kotlinCompilerExtensionVersion "1.9.22"
kotlinCompilerVersion = "1.5.10"
}`
@akwa-peter
You are using Kotlin 1.9.22
and our sdk uses 1.9.10
. We use the kotlin compiler version 1.5.3
which is compatible with version 1.9.10
to fix your build issue, you need to specify your config like this
buildFeatures.compose = true
composeOptions {
kotlinCompilerExtensionVersion = "1.5.10"
}
this is the compatibility mapping - https://developer.android.com/jetpack/androidx/releases/compose-kotlin
You shared this in your snippet
composeOptions {
kotlinCompilerExtensionVersion "1.9.22"
kotlinCompilerVersion = "1.5.10"
}`
replace this with the code I shared
Good day. I am having some issues using smile id. Here is the error:
ERROR:C:\Users\izuag.gradle\caches\transforms-3\8ca1e8429c9b4029b8df17116a393c61\transformed\fragment-1.8.3-runtime.jar: D8: java.lang.NullPointerException ERROR:C:\Users\izuag.gradle\caches\transforms-3\3e1f61d54c961fffc81e37b38a5b3a3b\transformed\lifecycle-livedata-core-2.8.6-runtime.jar: D8: java.lang.NullPointerException ERROR:C:\Users\izuag.gradle\caches\transforms-3\5d5f7f1dcbf1288206d4d8de2e5d34c8\transformed\jetified-lottie-compose-6.5.2-runtime.jar: D8: com.android.tools.r8.internal.Hc: Sealed classes are not supported as program classes e: org.jetbrains.kotlin.backend.common.BackendException: Backend Internal error: Exception during IR lowering File being compiled: C:/Users/izuag/AppData/Local/Pub/Cache/hosted/pub.dev/smile_id-10.1.10/android/src/main/kotlin/com/smileidentity/flutter/SmileIDDocumentCaptureView.kt The root cause java.lang.RuntimeException was thrown at: org.jetbrains.kotlin.backend.jvm.codegen.FunctionCodegen.generate(FunctionCodegen.kt:51) at org.jetbrains.kotlin.backend.common.CodegenUtil.reportBackendException(CodegenUtil.kt:253) at org.jetbrains.kotlin.backend.common.CodegenUtil.reportBackendException$default(CodegenUtil.kt:237) at org.jetbrains.kotlin.backend.common.phaser.PerformByIrFilePhase.invokeSequential(performByIrFile.kt:65) at org.jetbrains.kotlin.backend.common.phaser.PerformByIrFilePhase.invoke(performByIrFile.kt:52) at org.jetbrains.kotlin.backend.common.phaser.PerformByIrFilePhase.invoke(performByIrFile.kt:38) at org.jetbrains.kotlin.backend.common.phaser.NamedCompilerPhase.phaseBody(CompilerPhase.kt:147) at org.jetbrains.kotlin.backend.common.phaser.AbstractNamedCompilerPhase.invoke(CompilerPhase.kt:94) at org.jetbrains.kotlin.backend.common.phaser.CompositePhase.invoke(PhaseBuilders.kt:29) at org.jetbrains.kotlin.backend.common.phaser.CompositePhase.invoke(PhaseBuilders.kt:16) at org.jetbrains.kotlin.backend.common.phaser.NamedCompilerPhase.phaseBody(CompilerPhase.kt:147) at org.jetbrains.kotlin.backend.common.phaser.AbstractNamedCompilerPhase.invoke(CompilerPhase.kt:94) at org.jetbrains.kotlin.backend.common.phaser.CompilerPhaseKt.invokeToplevel(CompilerPhase.kt:43) at org.jetbrains.kotlin.backend.jvm.JvmIrCodegenFactory.invokeCodegen(JvmIrCodegenFactory.kt:361) at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.runCodegen(KotlinToJVMBytecodeCompiler.kt:347) at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileModules$cli(KotlinToJVMBytecodeCompiler.kt:122) at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileModules$cli$default(KotlinToJVMBytecodeCompiler.kt:43) at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:165) at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:50) at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:104) at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:48) at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:101) at org.jetbrains.kotlin.incremental.IncrementalJvmCompilerRunner.runCompiler(IncrementalJvmCompilerRunner.kt:463) at org.jetbrains.kotlin.incremental.IncrementalJvmCompilerRunner.runCompiler(IncrementalJvmCompilerRunner.kt:62) at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.doCompile(IncrementalCompilerRunner.kt:477) at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compileImpl(IncrementalCompilerRunner.kt:400) at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compileNonIncrementally(IncrementalCompilerRunner.kt:281) at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compile(IncrementalCompilerRunner.kt:125) at org.jetbrains.kotlin.daemon.CompileServiceImplBase.execIncrementalCompiler(CompileServiceImpl.kt:657) at org.jetbrains.kotlin.daemon.CompileServiceImplBase.access$execIncrementalCompiler(CompileServiceImpl.kt:105) at org.jetbrains.kotlin.daemon.CompileServiceImpl.compile(CompileServiceImpl.kt:1624) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:568) at java.rmi/sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:360) at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:200) at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:197) at java.base/java.security.AccessController.doPrivileged(AccessController.java:712) at java.rmi/sun.rmi.transport.Transport.serviceCall(Transport.java:196) at java.rmi/sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:587) at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:828) at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:705) at java.base/java.security.AccessController.doPrivileged(AccessController.java:399) at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:704) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at java.base/java.lang.Thread.run(Thread.java:842) Caused by: java.lang.RuntimeException: Exception while generating code for:
It's quiet long and I cannot send everything
My gradle file
plugins { id "com.android.application" // START: FlutterFire Configuration id 'com.google.gms.google-services' // END: FlutterFire Configuration id "kotlin-android" id "dev.flutter.flutter-gradle-plugin" }
def localProperties = new Properties() def localPropertiesFile = rootProject.file("local.properties") if (localPropertiesFile.exists()) { localPropertiesFile.withReader("UTF-8") { reader -> localProperties.load(reader) } }
def flutterVersionCode = localProperties.getProperty("flutter.versionCode") if (flutterVersionCode == null) { flutterVersionCode = "1" }
def flutterVersionName = localProperties.getProperty("flutter.versionName") if (flutterVersionName == null) { flutterVersionName = "1.0" }
android { namespace = "com.example.feteflex" compileSdk = 34 ndkVersion = flutter.ndkVersion
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = '17'
}
buildFeatures {
compose true
}
composeOptions {
kotlinCompilerVersion = "1.5.10"
}
defaultConfig {
applicationId = "com.example.feteflex"
minSdk = 24
targetSdk 34
targetSdk = flutter.targetSdkVersion
versionCode = flutterVersionCode.toInteger()
versionName = flutterVersionName
}
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig = signingConfigs.debug
}
}
}
flutter { source = "../.." }
dependencies { implementation(platform("org.jetbrains.kotlin:kotlin-bom:1.6.0")) }
buildscript { ext.kotlin_version = '1.9.22' repositories { google() mavenCentral() }
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects { repositories { google() mavenCentral() } }
rootProject.buildDir = "../build" subprojects { project.buildDir = "${rootProject.buildDir}/${project.name}" } subprojects { project.evaluationDependsOn(":app") }
tasks.register("clean", Delete) { delete rootProject.buildDir }
I'm using smile_id: ^10.0.8
cc: @olalekan-agbaje
I have integrated the package into my application and it works well on ios.
However i have not been able to get it to work for android. I get this error whenever i try to run the app.