Is it possible to use it in a Android project? #1

Open
opened 2024-10-28 13:11:20 +01:00 by wiedisoft · 5 comments
wiedisoft commented 2024-10-28 13:11:20 +01:00 (Migrated from github.com)

Hi,

your library works fine on my Linux machine and I'd tried to use it in a Android project.
Here I get an error like: No implementation found for int de.rasmusantons.cubiomes.Cubiomes.getGeneratorSize()
I think it's because it's not compiled for the Android architecture.

Any idea to use it in such a project?

Thanks
Robin

Hi, your library works fine on my Linux machine and I'd tried to use it in a Android project. Here I get an error like: `No implementation found for int de.rasmusantons.cubiomes.Cubiomes.getGeneratorSize()` I think it's because it's not compiled for the Android architecture. Any idea to use it in such a project? Thanks Robin
RasmusAntons commented 2024-10-28 23:48:42 +01:00 (Migrated from github.com)

I assume android could load the linux binaries but they need to be compiled for arm. Maybe it would work to run the current gradle task on something like a raspberry pi? Ideally it should cross compile for arm, I can try to do that but I'm not sure when I have time.

I assume android could load the linux binaries but they need to be compiled for arm. Maybe it would work to run the current gradle task on something like a raspberry pi? Ideally it should cross compile for arm, I can try to do that but I'm not sure when I have time.
RasmusAntons commented 2024-10-31 00:39:42 +01:00 (Migrated from github.com)

I think you were right about having to compiler it for specifically for android. I've played around a bit but didn't get it to work yet.

I added an aarch64 target to gradle which works on my raspberry pi but not on android. For some reason android studio removes all .so files, so I had to rename them in the jar. Then it complained about the libc, so I compiled it again with the android ndk compiler. Now it gives me an error about not finding "sincos".

I think you were right about having to compiler it for specifically for android. I've played around a bit but didn't get it to work yet. I added an aarch64 target to gradle which works on my raspberry pi but not on android. For some reason android studio removes all .so files, so I had to rename them in the jar. Then it complained about the libc, so I compiled it again with the android ndk compiler. Now it gives me an error about not finding "sincos".
wiedisoft commented 2024-10-31 07:48:09 +01:00 (Migrated from github.com)

Oh, is sincos a function of your library? Maybe a missing or wrong header file?

Oh, is sincos a function of your library? Maybe a missing or wrong header file?
RasmusAntons commented 2024-11-01 00:09:51 +01:00 (Migrated from github.com)

I'm not sure where sincos is used, what's weird is that the same .so file works in a normal executable but not when loaded with System.load().
image

I'm not sure where sincos is used, what's weird is that the same .so file works in a normal executable but not when loaded with System.load(). ![image](https://github.com/user-attachments/assets/1de09bd7-cdb6-4f37-97ef-9ef8ba62ecfd)
wiedisoft commented 2024-11-01 07:07:48 +01:00 (Migrated from github.com)

sincos ist defined in math.h
I think there ist a problem with the JNI or function Implementation, but it's really weird, why it only doesn't work in aarch64

sincos ist defined in math.h I think there ist a problem with the JNI or function Implementation, but it's really weird, why it only doesn't work in aarch64
Commenting is not possible because the repository is archived.
No milestone
No project
No assignees
1 participant
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
owl/cubiomes-java#1
No description provided.