kherud/java-llama.cpp

Please give a sample for Android

SteveWorkshop opened this issue · 3 comments

I tried the README code to import native library in my project and it failed, the prompt is Could not find method listOf() for arguments [mvn, compile] on object of type org.gradle.process.internal.DefaultExecAction_Decorated.

I'm not sure if you gave up on what you were making or if you've already managed to solve the issue, but here’s a solution.

  • Use Kotlin DSL instead of Groovy

  • If you get an error saying that CMakeLists.txt cannot be found after making changes, add -DCMAKE_SOURCE_DIR=${file("java-llama.cpp")} to the arguments

  • If you get an error saying that the data type __int64 does not exist, change it to __int64_t

  • I don't remember the exact error message, but if you get an error instructing you to add something like -fdeclspec to allow something, add -fdeclspec to cppFlags

I'm not sure if you gave up on what you were making or if you've already managed to solve the issue, but here’s a solution.

  • Use Kotlin DSL instead of Groovy
  • If you get an error saying that CMakeLists.txt cannot be found after making changes, add -DCMAKE_SOURCE_DIR=${file("java-llama.cpp")} to the arguments
  • If you get an error saying that the data type __int64 does not exist, change it to __int64_t
  • I don't remember the exact error message, but if you get an error instructing you to add something like -fdeclspec to allow something, add -fdeclspec to cppFlags

OK,I will try it when I have time, after all it's just my amateur project...