Writing Android NDK Code with Elements


(marc hoffman) #21

I was hoping to see the full solution. How does the Android SDK project use this, via project references? does the binary end jp in the /JNI/<architecture> subfolder of the Android project and does it get packaged up into the .apk correctly? Can I see the (verbose) build log?

There’s many variables here, and it’s hard to diagnose without seeing the full picture. the @JNIExport itself looks fine as far as I can tell.


(Andrew Colburn) #22

The binary lies in jniLibs/armeabi-v7a and ends up nicely packed into .apk
I attached my dummy Android Studio project for you to see the whole picture.
NDKLib.zip (1.3 MB)


(marc hoffman) #23

Ah, the SDK project isn’t built in Elements, I see. All looks good as far as I can tell, I’ll need to have one f my colleagues to have a look at a lower level at why the method might not be exported correctly, then…


(Andrew Colburn) #25

I also tried creating and building Android project with Elements. It didn’t work either.


(marc hoffman) #26

Same error? that’d point to indeed there ing an issue with there export (or it’s name), then.


(Andrew Colburn) #27

Yes, the same “No implementation found…” error.


(Carlo Kok) #28

Hi,

this looks like a recent regression in one of the underlying libraries we use. i’ll try to get a fix in for this early next week.


(RemObjects) #29

Thanks, logged as bugs://80124


(Andrew Colburn) #30

One more thing.
Not sure if it’s relevant, but 10 lines of code results in ~2.4Mb *.so library, which is kinda a lot.


(marc hoffman) #31

that’s probably with Debug symbols, and optimization off, right?

also keep in mind that there are certain base libraries (some optional, like Elements RTL, some not like the core Island RTL and the GC) that add to the snake size, but are of course a one-time “cost” that seems large for 10 lines, but relativates itself as the project grows…


(Andrew Colburn) #32

Yeah, optimizations are off, and it’s 0.5Mb less when it’s on.
Thanks for the explanation Marc.
Looking forward to that fix next week.


(RemObjects) #33

bugs://80124 got closed with status fixed.


(Carlo Kok) #34

This is fixed for the next build. Do you have access to the betas?


(Andrew Colburn) #35

No, but I just figured out that the build with version 10.0.0.2265 works fine. Thanks