Download ONDK, set environment variable ANDROID_NDK_HOME to the extracted directory, and use vcpkg to install the dependencies. Use /path/to/your/ondk/build/cmake/android.toolchain.cmake as the toolchain file fo
The CARGO_TARGET_${TARGET}_LINKER environment variable name needs to be all uppercase. In some older shells (for example macOS High Sierra), environment variable replacement can not be used when the variable was defined on the same line. Therefore the ANDROID_NDK variable must be defined befor...
p.s. 直接用apk安装的 rust 是aarch64-alpine-linux-musl, 它编译出来的东西默认是动态链接的,不能直接给 android 用。 mxdwtools Moe拥有者 8个月前 报错`The following warnings were emitted during compilation: warning: libz-sys@1.1.20: Compiler family detection failed due to error: ToolNotFound:...
com.robertohuertas.rusty_android_lib.* class MainActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) setSupportActionBar(toolbar) loadRustyLib() findViewById<TextView>(R.id.txt).let { ...
In some older shells (for example macOS High Sierra), environment variable replacement can not be used when the variable was defined on the same line. Therefore theANDROID_NDKvariable must be defined before it's used in thePATHvariable.
TL;DR: The code generator seems to generate code for both Vector<u8> and Vector<c_char>, but on ARM c_char is aliased to u8 (and not i8), so a lot of the definitions are duplicated. I'd be happy to fix this, but honestly, I don't even kn...
If you have installed the NDK with Android Studio to its default location, cargo ndk will automatically detect the most recent NDK version and use it. This can be overriden by specifying the path to the NDK root directory in the ANDROID_NDK_HOME environment variable....
First the Android NDK needs to be installed, either using Android Studio or directly, and the ANDROID_NDK_HOME environment variable needs to be set to the NDK installation path, e.g.:$ export ANDROID_NDK_HOME=/usr/local/share/android-ndk ...
the environment variableANDROID_NDK_TOOLCHAIN_DIR ${System.getProperty(java.io.tmpdir)}/rust-android-ndk-toolchains Note that the Java system propertyjava.io.tmpdiris not necessarily/tmp, including on macOS hosts. Each target architecture toolchain is named like$arch-$apiLevel: for example,arm-16...
Currently android-activity callsndk_context::release_android_context()after your nativeandroid_main()function returns whichshouldusually mean that restarting that Activity in the same process would be ok if the first one exited cleanly. Just trying to think of how your app might not be cleanly ex...