Open Megadash452 opened 2 weeks ago
Reopened this issue because the samples still don't work, but now for different reasons.
I had to update the gradle versions used by the plugin and the samples, and now this code in gradle-plugin/build.gradle.kts
does not work and shows this error: Unresolved reference: pluginBundle
pluginBundle {
website = "https://github.com/andrefigas/RustJNI"
vcsUrl = "https://github.com/andrefigas/RustJNI"
description = "A Gradle plugin that simplifies the creation and compilation of Rust code integrated with Android applications via JNI."
tags = listOf("rust", "jni", "android", "gradle-plugin", "native-code", "android-development", "rust-jni")
}
After removing this, I compile the plugin and it works. Then I try compiling the kotlin sample and got an error saying that it tried looking for the rust directory in ~/.gradle/<version>/app/src/main/rust
I cleaned all the project folders and without changing anything i recompiled them and the issue was gone and I haven't been able to recreate it since.
I also notice that when the plugin generates the jni code for the kotlin/java class the libname is empty: System.loadLibrary("")
Well I got the error again when compiling the kotlin sample
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:rust-jni-compile'.
> Could not find 'rust_jni.rs' file at /home/marti/.gradle/daemon/8.9/./app/src/main/rust/src/rust_jni.rs
I was able to solve all these issues but I haven't been able to push all the changes and still need to check the tests
Opening the directories
sample/kotlin
orsample/java
with Android Studio will show an error saying that the plugin (and plugin test) was not found, even after running./gradlew publishToMavenLocal
on bothgradle-plugin
andgradle-plugin-test
.Here is the error:
Building the sample projects with
./gradlew app:rust-jni-compile-test
works, so this must be something with the IDE, maybe we need to add some configuration for it to work?