Open puterproblems opened 4 weeks ago
That's amazing! Thanks for going down the rabbit hole :) Excited to see where Tauri takes mobile support, since it's fresh out of the oven with v2. Definitely gives a lot to think about in terms of compatibility/feature parity and how much of the codebase could be shared for a mobile version. I imagine some of the playback/metadata code can be reused as-is, while the UI would need an entirely separate layer for mobile to match OS look and feel.
I'm curious to see playback working as well, perhaps I can include a test mode that plays a bundled mp3.
I've been learning a lot about tauri from this adventure. Musicat now "runs" on Android, as in the UI renders and can be interacted with, however a non-starter that prevents this from being functional is tauri's lack of support for folder selection on mobile (see https://v2.tauri.app/plugin/dialog/#build-a-file-selector-dialog). As such, I don't know if playback works.
It was quite an journey, mostly due to the complexities of compiling so many different binaries for Android. Notably, reqwest's usage of openssl-sys as seen:
Turns out the "rustls-tls" feature of reqwest just works around this problem by not using openssl (see https://docs.rs/reqwest/latest/reqwest/#optional-features).
Secondly, cpal's usage of oboe was missing parts of the cpp standard library as seen:
cpal = { version = "0.15.3", default-features = false, features = ["oboe-shared-stdcxx"] }
These were the most frustrating as the error messages were most cryptic. (the second one was especially annoying as it was only see when running the app on an Android emulator).
Some additional miscellaneous issues include:
Some additional notes for getting up and running for Android:
export PATH="$PATH:$NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/"
or equivalent for your operating system.npm run tauri android build
npm run tauri android dev
is supposed to launch it, see if this works for youIf it doesn't (it only worked for me once), there are a few extra steps:
keytool -genkey -v -keystore key.keystore -alias key -keyalg RSA -validity 10000
(you don't have to fill any info except password likedemodemo
apksigner sign --ks key.keystore --out signed-app.apk src-tauri/gen/android/app/build/outputs/apk/universal/release/app-universal-release-unsigned.apk
adb install signed-app.apk
It's not exactly a simple process yet, but tauri still seems like the best solution for an easy to iterate cross-platform application. The complexities of rust building and linking for all the different platforms doesn't make it any easier (though it can make apps faster). I'll reference this in a pull request with the changes where we can discuss the feasibility of this (or feel free to disregard it, as it does create significant maintenance burden). I'm mostly doing this in preparation for creating my own app larger app with tauri and this has been a fairly interesting way to learn about the framework and maybe pre-solve some of the challenges I'll face.
Anyways, sorry for this beefy issue, if I had more time I'd make it shorter. FYI I'll probably just leave this issue be for a while to work on other things.