Open tkkcc opened 1 year ago
We don't currently have a good way for defining what api level we want to compile native code with when building with cargo
.
Some crates like the ndk
crate expose cargo features like api-level-24
, api-level-25
... and we could do something similar in android-activity but that's far from ideal because most applications should try to avoid depending on android-activity
directly if they can avoid it and instead get android-activity
via a framework like winit
or egui
.
I had been wondering if we could maybe establish an environment variable convention, since cargo doesn't really provide any general way to pass around global features that need to be honored consistently.
It would be painful to have to expose lots of android api level features via crates like Winit and Egui and then ensuring that every crate forwards those recursively from crate to crate.
More specifically here though; cargo ndk
has no understanding of Gradle or anything in build.gradle
but it does have its own -p/--platform
argument that can be used to specify the api level. This works in terms of choosing what suffix to add to the end of the clang
wrapper script, which affects the --target
argument passed to clang.
Perhaps you can try running with something like cargo ndk -p 24 build
This said though; Android 7 is very old at this point and I'm not sure what the chances are of being able to run agdk-eframe
on that old of an Android version. Maybe if you can convince wgpu to run on GLES2 then it might work though.
android7 support gles3 as i know. the problem is same on android 11 as i said.
suprisingly! after i switch to the default glow backend, android 7 and 11 emulator both works well! (except ime).
I tried cargo ndk -p 24
, it does not change __ANDROID_API__
. __ANDROID_API__
is always 10000.
trying to run agdk-eframe demo on emulator, android 7.0.
I first set
minSdk = 24
inapp/build.gradle
for android 7.0. The logcat givesSo
__system_property_read_callback
can't be used.__system_property_read_callback
is enabled in GameActivity.cpp inandroid-activity
with flag__ANDROID_API__ > 26
. From doc,__ANDROID_API__
is same as min_sdk_version, I don't know ifcargo ndk
will respect build.gradle. Also I fail to log the value of__ANDROID_API__
. I finally comment out related code. Then I got