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.
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)
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…
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…
Are there any known problems with this in the latest stable release (10.0.0.2373)? It appears to have regressed again (Android 8), the same “No implementation found…” error.
Additionally, with the arm64-v8a target on Android 8 another error:
java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "__data_start"
I’ll work on getting you a minimally reproducible example, but perhaps a notion might be to have a “known-good” Android NDK Extension example project on GitHub so that people might try to build that, making it easier to distinguish user error from regression.
hrmm that’s quite odd. I think updating llvm broke that. __data_start should point to the start of the data segment, and not be an actual token. I’ll investigate. Sorry for the convenience.
I’m afraid this has to wait until next week (or possibly this coming Friday), because Carlo, who’s area of expertise this is, is on leave past and this week. I apologize for the inconvenience; we can of course extend you evaluation period once we have a fix out.