To be concise, after applying this patch, on a machine already set up Android SDK, executing flutter build apk should give you the apk file correctly.
In detail, this patch does these things:
Replace souvlaki with a dummy implementation when targeting Android. This is because media control on Android should be done through Android code, while when building current souvlaki code targeting Android, the macro cfg conflicts and build fails.
When platform is Android, in lib/main.dart don't wait for windowManager.ensureInitialized(); since window_manager does not support Android.
With above changes, the build could pass, but when libhub.so loads, it will look for libc++_shared.so , find nothing, and then stop working. Hence the commit #aa78bf1 to manually copy libc++_shared.so from NDK to android/app/src/main/jniLibs so that it will be packaged into the final apk.
To be concise, after applying this patch, on a machine already set up Android SDK, executing
flutter build apk
should give you the apk file correctly.In detail, this patch does these things:
souvlaki
with a dummy implementation when targeting Android. This is because media control on Android should be done through Android code, while when building currentsouvlaki
code targeting Android, the macro cfg conflicts and build fails.lib/main.dart
don't wait forwindowManager.ensureInitialized();
since window_manager does not support Android.With above changes, the build could pass, but when
libhub.so
loads, it will look forlibc++_shared.so
, find nothing, and then stop working. Hence the commit #aa78bf1 to manually copylibc++_shared.so
from NDK toandroid/app/src/main/jniLibs
so that it will be packaged into the final apk.There are an open issue on RustAudio: https://github.com/RustAudio/rodio/issues/404 , some "successful attempts" on rinf: https://github.com/cunarist/rinf/issues/280 , and this section of rinf FAQ . But for rune, only such modification to
build.rs
is still not packaginglibc++_shared.so
, only fixing some STL identifiers not found. Adding arguments toandroid{ defaultConfig{ externalNativeBuild { ndkBuild {
won't work, too.I'm pretty confused. But let's just manually copy them at least for now.