This PoC showcases how to reuse Rust view components created with Makepad in native Android and iOS (Kotlin and Swift) projects. For iOS this project depends on my fork of Makepad. You should not use it in production.
Makepad is a cross-platform app framework written in Rust. It allows to build complete app artifacts. At this stage it is not intended to build reusable native libraries, so I'm doing some experimentation. Other cross-platform frameworks with that feature include:
The Makepad example news_feed
is presented within a Jetpack Compose / SwiftUI view hierarchy.
recording_android.webm
recording_ios.mp4
- Make sure to have cargo make and Android NDK 25.2.9519653 installed
- Run
cargo make all
(orcargo make android
/cargo make ios
for a single platform) to build the shared Rust libraries - Open the folder
android
in Android Studio and / oriosSample
in Xcode. Those are normal native projects.
- You can't use multiple Makepad views in your native project
- When adding SVG resources, the application crashes:
-[MTLDebugRenderCommandEncoder setRenderPipelineState:]:1615: failed assertion `Set Render Pipeline State Validation For depth attachment, the renderPipelineState pixelFormat must be MTLPixelFormatInvalid, as no texture is set.
- A hacky build.rs that does not work for x86 builds