I am having issue when integrating the OpenCV to the jetpack compose android studio. It shows error
Execution failed for task ‘:opencv:compileDebugKotlin’.
A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
Currently using “org.jetbrains.kotlin.android” version “2.0.21”
This is the OpenCV gradle I have made the java version into 17 and minSDk and targetSdk the same as the app gradle
plugins {
alias(libs.plugins.kotlin.android)
}
apply plugin: 'com.android.library'
apply plugin: 'maven-publish'
try {
apply plugin: 'kotlin-android'
println "Configure OpenCV with Kotlin"
} catch (Exception e) {
println "Configure OpenCV without Kotlin"
}
def openCVersionName = "4.11.0"
def openCVersionCode = ((4 * 100 + 11) * 100 + 0) * 10 + 0
println "OpenCV: " +openCVersionName + " " + project.buildscript.sourceFile
android {
namespace 'org.opencv'
compileSdkVersion 34
defaultConfig {
minSdkVersion 24
targetSdkVersion 34
versionCode openCVersionCode
versionName openCVersionName
externalNativeBuild {
cmake {
arguments "-DANDROID_STL=c++_shared"
targets "opencv_jni_shared"
}
}
}
android {
buildFeatures {
buildConfig true
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = "17"
}
}