Open mzdk100 opened 6 months ago
Then I guessed that the MainActivity.kt file was not compiled, so I modified the build.gradle file:
plugins {
id "com.android.application"
id "org.mozilla.rust-android-gradle.rust-android"
id "org.jetbrains.kotlin.android"
}
...
Add the line id "org.jetbrains.kotlin.android"
to the file, and then run the above error to disappear, but encounter the following error:
AndroidRuntime rs.tts D Shutting down VM
AndroidRuntime rs.tts E FATAL EXCEPTION: main
Process: rs.tts, PID: 32745
java.lang.UnsatisfiedLinkError: dlopen failed: library "libhello_world.so" not found
at java.lang.Runtime.loadLibrary0(Runtime.java:1077)
at java.lang.Runtime.loadLibrary0(Runtime.java:998)
at java.lang.System.loadLibrary(System.java:1661)
at rs.tts.MainActivity.<clinit>(MainActivity.kt:8)
at java.lang.Class.newInstance(Native Method)
at android.app.AppComponentFactory.instantiateActivity(AppComponentFactory.java:95)
at androidx.core.app.CoreComponentFactory.instantiateActivity(CoreComponentFactory.java:45)
at android.app.Instrumentation.newActivity(Instrumentation.java:1359)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3791)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4049)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:101)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2443)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:211)
at android.os.Looper.loop(Looper.java:300)
at android.app.ActivityThread.main(ActivityThread.java:8348)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:582)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1028)
Process rs.tts I Process is going to kill itself!
java.lang.Exception
at android.os.Process.killProcess(Process.java:1330)
at com.android.internal.os.RuntimeInit$KillApplicationHandler.uncaughtException(RuntimeInit.java:195)
at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1073)
at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1068)
at java.lang.Thread.dispatchUncaughtException(Thread.java:2306)
This time I checked tts-rs/examples/android/app/build/rustJniLibs
and found that this folder is empty. What should I do? Can we use cargo-apk to build it? Because I think cargo-app is better to use.
I cloned the latest tts-rs and opened tts rs/examples/android using IntelliJ IDEA. After clicking "Run", an error occurred: