ivnsch / rust_android_ios Goto Github PK
View Code? Open in Web Editor NEWAndroid / iOS app with shared Rust logic
Android / iOS app with shared Rust logic
Configure iOS Github action (Unit Tests).
Hi I have some questions regarding for the development of Android using the crate
:
ld: library not found for -lSystem
Workaround is to add this block to ios_app/build-rust-xcode.sh
# From https://github.com/TimNN/cargo-lipo/issues/41#issuecomment-774793892
if [[ -n "${DEVELOPER_SDK_DIR:-}" ]]; then
# Assume we're in Xcode, which means we're probably cross-compiling.
# In this case, we need to add an extra library search path for build scripts and proc-macros,
# which run on the host instead of the target.
# (macOS Big Sur does not have linkable libraries in /usr/lib/.)
export LIBRARY_PATH="${DEVELOPER_SDK_DIR}/MacOSX.sdk/usr/lib:${LIBRARY_PATH:-}"
fi
Due to rust-lang/rust#85806, this is broken by the last Android NDK (23). Symptom is failed link, unable to find library -lgcc
.
Workaround is simple enough, downgrade to NDK22, e.g.
export NDK_HOME=${ANDROID_SDK_ROOT}/ndk/22.1.7171670
Might want to make a note in the README?
I've been designing a Rust library for usage with Flutter. I see that you're doing Kotlin/Java <-> Rust here, but you mention Flutter.
Is there a plan to make a template for Flutter? Because there are 2 methods to consider: FFI vs Plugin call. Since plugin calls are very slow, FFI should be prefered, but what to do when Rust needs JNI objects? You can't pass them through Flutter's FFI
I am working on an Android app (Flutter) in which all the UI is handled by Flutter, and all the backend/logical part needs to be handled by the Rust layer. I want to access all the Android SDK classes inside the Rust library e.g UsbManager, UsbDevice, BroadcastReceiver, Intent classes and other classes/services provided by the Android SDK.
Here is a use case -
In order to achieve the USB_DEVICE_ATTACHED event, we have to register it using the BroadcastReceiver, and once the event occurs, we can get the call in onReceive() of our class, which is a subclass of BroadcastReceiver. Since BroadcastReceiver is an Android Component, how can i have this receiver in Rust library?
Thanks in advance...
Hey!
Awesome project! I'm trying to run the iOS app (haven't tried Android yet) and I'm having some issues. Is there anything not in the README that's needed?
I'm running on stable.
When I run the iOS app in XCode I get
+ RUSTFLAGS='-Z embed-bitcode'
+ cargo +ios-arm64 build --target aarch64-apple-ios --release --lib
error: no such subcommand: `+ios-arm64`
+ cargo build --target=x86_64-apple-ios --release
Compiling log v0.4.8
Compiling libc v0.2.60
Compiling core-foundation-sys v0.6.2
Compiling cfg-if v0.1.9
error[E0463]: can't find crate for `core`
|
= note: the `x86_64-apple-ios` target may not be installed
error: aborting due to previous error
For more information about this error, try `rustc --explain E0463`.
error: could not compile `cfg-if`
To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: linking with `cc` failed: exit code: 1
I have installed x86_64-apple-ios
and aarch64-apple-ios
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.