kyonifer / koma

A scientific computing library for Kotlin. https://kyonifer.github.io/koma
Other
270 stars 23 forks source link

Adding koma to android project after repo shutdown. #111

Open Karcsii opened 1 year ago

Karcsii commented 1 year ago

I need an Android library for calculating matrix exponentials and products. I tied using koma but could not add it to my build gradle. I have tried both the fixes in #110 and #108 but no luck. Here is my project's build.gradle:

buildscript {
    ext.kotlin_version = '1.3.10'
    repositories {
        google()
        mavenCentral()
        maven { url = uri("https://plugins.gradle.org/m2/") }
    }
    dependencies {
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10"
        classpath "com.android.tools.build:gradle:7.0.4"

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

My module's build.gradle:

plugins {
    id 'com.android.application'
    id "io.github.0ffz.github-packages"
}

apply plugin: 'kotlin-android'

android {
    compileSdk 33

    defaultConfig {
        applicationId "com.example.hellokotlin"
        minSdk 28
        targetSdk 33
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

dependencies {

    implementation 'androidx.appcompat:appcompat:1.6.1'
    implementation 'com.google.android.material:material:1.6.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
    implementation files('libs\\core.jar')
    testImplementation 'junit:junit:4.+'
    androidTestImplementation 'androidx.test.ext:junit:1.1.5'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
    implementation 'androidx.core:core-ktx:1.5.0'
    implementation 'org.jetbrains.kotlin:kotlin-stdlib:1.6.0'
    implementation "com.kyonifer:koma-core-ejml:0.12.1"
    implementation "com.kyonifer:koma-core-api-jvm:0.12.1"

}

and my settings.gradle:

dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        google()
        mavenCentral()
        maven { githubPackage("kyonifer")(this) }
        maven { url = uri("https://jitpack.io")  }
    }
}
rootProject.name = "hellokotlin"
include ':app'

Here's the error I am getting with this config: image I have tried a bunch of other things too, but they threw different errors, hopefully someone can point me in the right direction.

vietnt-uet commented 1 month ago

@Karcsii Did you make it run on Android, I face the similar issue, it would be great if you can share your approach to fix it.