Giter Club home page Giter Club logo

cargo-mobile2's Introduction

cargo-mobile2

The answer to "how do I use Rust on iOS and Android?"

cargo-mobile takes care of generating Xcode and Android Studio project files, building and running on device, generating project boilerplate, and a few other things!

This project is a fork of cargo-mobile. Tauri uses it as a library dependency instead of using its CLI directly. For more information, please visit Tauri's mobile guide.

In the meantime, cargo-mobile2 contains the template of wry, please follow wry's instruction if you want to use with it.

Installation

The build will probably take a bit, so feel free to go get a snack or something.

cargo install --git https://github.com/tauri-apps/cargo-mobile2

cargo-mobile2 is currently supported on macOS, Linux and Windows. Note that it's not possible to target iOS on platforms other than macOS! You'll still get to target Android either way.

You'll need to have Xcode and the Android SDK/NDK installed. Some of this will ideally be automated in the future, or at least we'll provide a helpful guide and diagnostics.

Whenever you want to update:

cargo mobile update

Usage

To start a new project, all you need to do is make a directory with a cute name, cd into it, and then run this command:

cargo mobile init

After some straightforward prompts, you'll be asked to select a template pack. Template packs are used to generate project boilerplate, i.e. using the wry template pack gives you a wry project that runs out-of-the-box on desktop and mobile.

name info
wry Minimal wry project
egui Full egui + winit + wgpu example based on agdk-egui example

Template pack contribution is welcomed

Note

For all the templates available now, currently bevy templates do not work and will encounter compile error if you try to build the project.

Once you've generated your project, you can run cargo run as usual to run your app on desktop. However, now you can also do cargo apple run and cargo android run to run on connected iOS and Android devices respectively!

If you prefer to work in the usual IDEs, you can use cargo apple open and cargo android open to open your project in Xcode and Android Studio respectively.

For more commands, run cargo mobile, cargo apple, or cargo android to see help information.

Android

cargo android run will build, install and run the app and follows device logs emitted by the app.

By default, warn and error logs are displayed. Additional logging of increasing verbosity can be shown by use of the -v or -vv options. These also provide more verbose logging for the build and install steps.

For fine-grained control of logging, use the --filter (or -f) option, which takes an Android log level, such as debug. This option overrides the default device logging level set by -v or -vv.

If using the android_logger crate to handle Rust log messages, trace logs from Rust are mapped to verbose logs in Android.

cargo-mobile2's People

Contributors

amrbashir avatar arthurkvalladares avatar cactice avatar crabnejonas avatar cxgreat2014 avatar expectocode avatar francesca64 avatar github-actions[bot] avatar inokawa avatar jhutchins avatar jorge-menjivar avatar kazatsuyu avatar keiya01 avatar louix avatar lucasfernog avatar msiglreith avatar mtak- avatar mworleybr avatar nyanspaghetti avatar pewsheen avatar renovate[bot] avatar sanjeevprasad avatar simonhyll avatar spensbot avatar sunng87 avatar trindadegm avatar tylerjmclean avatar wusyong avatar yuhr avatar zeerooth avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cargo-mobile2's Issues

No development teams detected

I've peeked through the code but the check for development teams goes through the certificates on my machine?

In my case it can't find anything:

Detected development teams:
  -- none --
  Enter an index for a team above, or enter a team ID manually.

To manually enter this it's also not entirely clear where I could find this ID. developer.apple.com does not really list something like this.

Unable to get IOS working on Mac M1

Been trying for a good day but not able to get things to build, the following is my setup:

M1, MacOs 12.6, Xcode 14.2 (I even purchased an dev account so I could fill in the dev team section!!)

Here are the commands I ran

> cargo install --git https://github.com/tauri-apps/tauri-mobile
> cargo mobile init
## install the wry template

Then to get things actually running, I've tried both of these:

> cargo apple build
> cargo build --target aarch64-apple-ios

The first fails with ios versions being too low at 9.0, I up those to 11.0 then the next error is:

ld: warning: directory not found for option '-L/Users/cmdv/Code/Beou/BeouApp/gen/apple/Sources/aarch64-apple-ios/debug'
ld: library not found for -lbeou_app

Then the second

the trait bound `Cow<'_, [u8]>: From<()>` is not satisfied
   --> src/lib.rs:123:72

If I simply cargo build then that works and I see an application window with a webpage!

sorry I'm new to Rust, I've come over from Haskell but really wanted to try out making an IOS/Android app in Rust rather than using a javascript framework

Rerunning `cargo mobile init` causes error: "gen/apple/assets: No such file or directory"

When I rerun cargo mobile init, it fails every other time with the following error.

ln: /Users/elliotwaite/code/tmp/tauri-test-drive/gen/apple/assets: No such file or directory
error: Asset dir couldn't be symlinked into Xcode project
    Failed to create a symbolic link from "../../assets" to directory "/Users/elliotwaite/code/tmp/tauri-test-drive/gen/apple" (file and directory clobbering enabled): `ln` command failed: Command "ln -n -s -f
    ../../assets /Users/elliotwaite/code/tmp/tauri-test-drive/gen/apple/assets" didn't complete successfully, exiting with code 1.

It seems like rerunning the command causes the gen/apple directory to be deleted, but then rerunning it again recreates that directory, making it succeed again.

cargo mobile init error: "Failed to install Rust Xcode plugin"

When I run cargo mobile init, it fails to install the Rust Xcode plugin with the following message:

...
Installing `rust-xcode-plugin`...
Updating `rust-xcode-plugin` repo...
remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
fatal: ambiguous argument 'origin/dev': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
action request: Failed to install Rust Xcode plugin; this component is optional, so init will continue anyway, but Xcode debugging won't work until this is resolved!
    Failed to reset repo: Command "git -C /Users/elliotwaite/.tauri-mobile/checkouts/rust-xcode-plugin reset --hard origin/dev" didn't complete successfully, exiting with code 128.
...

The part of the error message that says ambiguous argument 'origin/dev' seems to related to the fact that the tauri-apps/rust-xcode-plugin repo doesn't have a dev branch.

Changing the git command from this:

git -C /Users/elliotwaite/.tauri-mobile/checkouts/rust-xcode-plugin reset --hard origin/dev

to this:

git -C /Users/elliotwaite/.tauri-mobile/checkouts/rust-xcode-plugin reset --hard origin/master

seemed to make that git command work, but I wasn't sure how to update this repo to use that command instead (I'm new to Rust and this repo).

wry project not available

Hi everyone!

In the README file, it's explained that we can use the wry template.
However after a cargo mobile update and a cargo mobile init, the template isn't available:

✦ ➜ cargo mobile init
Project name (tauri-app): 
Stylized name (Tauri App): 
Domain (users.noreply.github.com): 
Detected template packs:
  [0] bevy
  [1] bevy-demo
  [2] wgpu
  [3] winit
  Enter an index for a template pack above.

lockfile not up to date

Describe the bug
The lockfile has not been updated before the release

Steps To Reproduce
cargo build --frozen

Expected behavior
the lockfile is up to date

Screenshots
If applicable, add screenshots to help explain your problem.

Platform and Versions (please complete the following information):
Host OS:
Target OS:
Rustc:
cargo mobile doctor:
(if you build with specific commit, please list it as well)

Would you want to assign yourself to resolve this bug?

  • Yes
  • No

Additional context
Add any other context about the problem here.

Tauri template not shown

Sorry but noob here. Like the guide I installed everything but I only get the following output.

Detected template packs:
  [0] bevy
  [1] bevy-demo
  [2] wgpu
  [3] winit
  [4] wry
  Enter an index for a template pack above.

`cargo mobile init` is not working, return env problem

Bug
cargo mobile init isn't working, I am currently on Garuda linux(a arch based linux distro).
I have installed required thing given on tauri mobile website and also installed Android Studio and all mentioned sdk and ndk,
And also set environment variable as you can check 👇

Screenshot_20230702_061426

and here what i get when i run cargo mobile init 👇 (this is my second try, it didn't ask for project name etc in second time)

Screenshot_20230702_062336

[android] vendored openssl-sys build fails

Describe the bug

Hi, it seems when building with the vendored Openssl, it makes the build fail on android.

tauri = { version = "2.0.0-alpha.8", features = ["native-tls-vendored"] }

I bootstrapped a simple tauri mobile project example to reproduce the issue.

Steps To Reproduce

install latest tauri-cli alpha cargo install tauri-cli --version "2.0.0-alpha.8"

  1. clone the https://github.com/doums/tauri_poc
  2. npm i
  3. cd src-tauri
  4. cargo clean
  5. rm -rf gen
  6. cargo tauri android init
  7. cargo tauri android dev

Expected behavior
It should build successfully and launch the app

Platform and Versions (please complete the following information):

[✔] Environment
    - OS: Arch Linux Unknown X64
    ✔ webkit2gtk-4.1: 2.40.0
    ✔ rsvg2: 2.56.0
    ✔ rustc: 1.69.0 (84c898d65 2023-04-16)
    ✔ Cargo: 1.69.0 (6e9a83356 2023-04-12)
    ✔ rustup: 1.25.2 (17db695f1 2023-02-01)
    ✔ Rust toolchain: stable-x86_64-unknown-linux-gnu (environment override by RUSTUP_TOOLCHAIN)
    - node: 18.13.0
    - yarn: 1.22.19
    - npm: 8.19.3

[-] Packages
    - tauri [RUST]: 2.0.0-alpha.8
    - tauri-build [RUST]: 2.0.0-alpha.4
    - wry [RUST]: 0.27.3
    - tao [RUST]: 0.18.3
    - @tauri-apps/api [NPM]: 2.0.0-alpha.3
    - @tauri-apps/cli [NPM]: 2.0.0-alpha.8

[-] App
    - build-type: bundle
    - CSP: unset
    - distDir: ../dist
    - devPath: http://localhost:3000/
    - framework: React
    - bundler: Vite   

stack trace (shortened)

›  cargo tauri android dev
        Info Using 192.168.1.20 to access the development server.
        Info Detected connected device: main (sdk_gphone_x86_64) with target "x86_64-linux-android"
     Running BeforeDevCommand (`npm run dev`)

> [email protected] dev
> vite


  VITE v4.3.0  ready in 403 ms

  ➜  Local:   http://localhost:3000/
  ➜  Network: http://192.168.1.20:3000/
        Info detected host target triple "x86_64-unknown-linux-gnu"
    Blocking waiting for file lock on build directory
   Compiling openssl-sys v0.9.86
   Compiling wry v0.27.3
   Compiling tauri-runtime-wry v0.13.0-alpha.4
error: failed to run custom build command for `openssl-sys v0.9.86`

Caused by:
  process didn't exit successfully: `/home/pierre/Documents/nym/mobpoc/src-tauri/target/debug/build/openssl-sys-f5281a0aa60159a7/build-script-main` (exit status: 101)
  --- stdout
  cargo:rerun-if-env-changed=X86_64_LINUX_ANDROID_OPENSSL_NO_VENDOR
  X86_64_LINUX_ANDROID_OPENSSL_NO_VENDOR unset
  cargo:rerun-if-env-changed=OPENSSL_NO_VENDOR
  OPENSSL_NO_VENDOR unset
  cargo:rerun-if-env-changed=CC_x86_64-linux-android
  CC_x86_64-linux-android = None
  cargo:rerun-if-env-changed=CC_x86_64_linux_android
  CC_x86_64_linux_android = None
  cargo:rerun-if-env-changed=TARGET_CC
  TARGET_CC = Some("/home/pierre/.local/share/android/sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/linux-x86_64/bin/x86_64-linux-android24-clang")
  cargo:rerun-if-env-changed=CFLAGS_x86_64-linux-android
  CFLAGS_x86_64-linux-android = None
  cargo:rerun-if-env-changed=CFLAGS_x86_64_linux_android
  CFLAGS_x86_64_linux_android = None
  cargo:rerun-if-env-changed=TARGET_CFLAGS
  TARGET_CFLAGS = None
  cargo:rerun-if-env-changed=CFLAGS
  CFLAGS = None
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some("true")
  cargo:rerun-if-env-changed=AR_x86_64-linux-android
  AR_x86_64-linux-android = None
  cargo:rerun-if-env-changed=AR_x86_64_linux_android
  AR_x86_64_linux_android = None
  cargo:rerun-if-env-changed=TARGET_AR
  TARGET_AR = Some("/home/pierre/.local/share/android/sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ar")
  cargo:rerun-if-env-changed=ARFLAGS_x86_64-linux-android
  ARFLAGS_x86_64-linux-android = None
  cargo:rerun-if-env-changed=ARFLAGS_x86_64_linux_android
  ARFLAGS_x86_64_linux_android = None
  cargo:rerun-if-env-changed=TARGET_ARFLAGS
  TARGET_ARFLAGS = None
  cargo:rerun-if-env-changed=ARFLAGS
  ARFLAGS = None
  cargo:rerun-if-env-changed=RANLIB_x86_64-linux-android
  RANLIB_x86_64-linux-android = None
  cargo:rerun-if-env-changed=RANLIB_x86_64_linux_android
  RANLIB_x86_64_linux_android = None
  cargo:rerun-if-env-changed=TARGET_RANLIB
  TARGET_RANLIB = None
  cargo:rerun-if-env-changed=RANLIB
  RANLIB = None
  cargo:rerun-if-env-changed=RANLIBFLAGS_x86_64-linux-android
  RANLIBFLAGS_x86_64-linux-android = None
  cargo:rerun-if-env-changed=RANLIBFLAGS_x86_64_linux_android
  RANLIBFLAGS_x86_64_linux_android = None
  cargo:rerun-if-env-changed=TARGET_RANLIBFLAGS
  TARGET_RANLIBFLAGS = None
  cargo:rerun-if-env-changed=RANLIBFLAGS
  RANLIBFLAGS = None
  running cd "/home/pierre/Documents/nym/mobpoc/src-tauri/target/x86_64-linux-android/debug/build/openssl-sys-9a70a20413f09e7c/out/openssl-build/build/src" && AR="/home/
pierre/.local/share/android/sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ar" CC="/home/pierre/.local/share/android/sdk/ndk/25.1.8937393/toolchains
/llvm/prebuilt/linux-x86_64/bin/x86_64-linux-android24-clang" RANLIB="x86_64-linux-android-ranlib" "perl" "./Configure" "--prefix=/home/pierre/Documents/nym/mobpoc/src-t
auri/target/x86_64-linux-android/debug/build/openssl-sys-9a70a20413f09e7c/out/openssl-build/install" "--openssldir=/usr/local/ssl" "no-dso" "no-shared" "no-ssl3" "no-uni
t-test" "no-comp" "no-zlib" "no-zlib-dynamic" "no-md2" "no-rc5" "no-weak-ssl-ciphers" "no-camellia" "no-idea" "no-seed" "no-stdio" "linux-x86_64" "-O2" "-DANDROID" "-ffu
nction-sections" "-fdata-sections" "-fPIC" "-gdwarf-2" "-fno-omit-frame-pointer"
  Configuring OpenSSL version 1.1.1t (0x1010114fL) for linux-x86_64
  Using os-specific seed configuration
  Creating configdata.pm
  Creating Makefile

  **********************************************************************
  ***                                                                ***
  ***   OpenSSL has been successfully configured                     ***
  ***                                                                ***
  ***   If you encounter a problem while building, please open an    ***
  ***   issue on GitHub <https://github.com/openssl/openssl/issues>  ***
  ***   and include the output from the following command:           ***
  ***                                                                ***
  ***       perl configdata.pm --dump                                ***
  ***                                                                ***
  ***   (If you are new to OpenSSL, you might want to consult the    ***
  ***   'Troubleshooting' section in the INSTALL file first)         ***
  ***                                                                ***
  **********************************************************************
  running cd "/home/pierre/Documents/nym/mobpoc/src-tauri/target/x86_64-linux-android/debug/build/openssl-sys-9a70a20413f09e7c/out/openssl-build/build/src" && "make" "de
pend"
  install ./include/openssl/x509v3err.h -> /home/pierre/Documents/nym/mobpoc/src-tauri/target/x86_64-linux-android/debug/build/openssl-sys-9a70a20413f09e7c/out/openssl-b
uild/install/include/openssl/x509v3err.h
  install libcrypto.a -> /home/pierre/Documents/nym/mobpoc/src-tauri/target/x86_64-linux-android/debug/build/openssl-sys-9a70a20413f09e7c/out/openssl-build/install/lib/l
ibcrypto.a

  --- stderr
  crypto/x86_64cpuid.s:3:1: warning: DWARF2 only supports one section per compilation unit
  .section        .init
  ^
  /home/pierre/.local/share/android/sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ar: warning: creating libcrypto.a
  /bin/sh: line 1: x86_64-linux-android-ranlib: command not found
  /home/pierre/.local/share/android/sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ar: warning: creating libssl.a
  /bin/sh: line 1: x86_64-linux-android-ranlib: command not found
  /bin/sh: line 5: x86_64-linux-android-ranlib: command not found
  make: *** [Makefile:313: install_dev] Error 127
  thread 'main' panicked at '


  Error installing OpenSSL:
      Command: cd "/home/pierre/Documents/nym/mobpoc/src-tauri/target/x86_64-linux-android/debug/build/openssl-sys-9a70a20413f09e7c/out/openssl-build/build/src" && "make
" "install_dev"
      Exit status: exit status: 2


      ', /home/pierre/.cargo/registry/src/github.com-1ecc6299db9ec823/openssl-src-111.25.3+1.1.1t/src/lib.rs:506:13
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
       Error `Failed to run `cargo build`: Command "cargo build --package app --manifest-path /home/pierre/Documents/nym/mobpoc/src-tauri/Cargo.toml --target x86_64-linu
x-android --color always" didn't complete successfully, exiting with code 101.

Failed to generate Android cargo config with arm-linux-androideabi-ar

Hey guys, when I run cargo mobile init I get the following error:

Generating Android Studio project... error: Failed to generate Android cargo config Missing tool ar; tried at "/Users/paul/Library/Android/sdk/ndk/25.0.8775105/toolchains/llvm/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-ar".

I installed NDK 25.0.8775105 via Android Studio on my mac but it seems GNU ar is removed from the newer NDK versions?
https://stackoverflow.com/questions/73105626/arm-linux-androideabi-ar-command-not-found-in-ndk

Using version 21.4.7075529 worked for me, so maybe this information is helpful.

rustup could not choose a version of cargo to run

Hi there,
I am facing an error such as that rustup could not choose a toolchain on both dev and build commands.
I ran rustup default stable-msvc several times and I even tried reinstalling rust.

Untitled

Untitled

cannot locate symbol "SSL_do_handshake" with successful build for android.

Describe the bug
The tauri mobile application builds successfully but when trying to open it gets stuck, and also then gives the following error I think to do with openssl.

Steps To Reproduce
Set up as tauri mobile app for android with vite-react.

  • Dependencies
[dependencies]
tauri = { version = "2.0.0-alpha.8", features = ["shell-open"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
tiny-bip39 = "1.0.0"
rand = "0.8.5"
  • Install openssl locally and fill the env variables as listed here

-run cargo tauri android dev to build.

Expected behavior
Opens the app successfully on android emulator.

Error

Performing Streamed Install
Success
Starting: Intent { cmp=com.tauri.availx/.MainActivity }
--------- beginning of main
04-24 16:46:41.131 14368 14368 I om.tauri.availx: Late-enabling -Xcheck:jni
04-24 16:46:41.289 14368 14368 W ziparchive: Unable to open '/data/app/~~NDuPBEDP_Uu2k1ji2kkQJw==/com.tauri.availx-mjsz4usMCkvP_SjhGvGvFA==/base.dm': No such file or directory
04-24 16:46:41.289 14368 14368 W ziparchive: Unable to open '/data/app/~~NDuPBEDP_Uu2k1ji2kkQJw==/com.tauri.availx-mjsz4usMCkvP_SjhGvGvFA==/base.dm': No such file or directory
--------- beginning of crash
04-24 16:46:41.388 14368 14368 E AndroidRuntime: FATAL EXCEPTION: main
04-24 16:46:41.388 14368 14368 E AndroidRuntime: Process: com.tauri.availx, PID: 14368
04-24 16:46:41.388 14368 14368 E AndroidRuntime: java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "SSL_do_handshake" referenced by "/data/app/~~NDuPBEDP_Uu2k1ji2kkQJw==/com.tauri.availx-mjsz4usMCkvP_SjhGvGvFA==/base.apk!/lib/arm64-v8a/libavailx_lib.so"...
04-24 16:46:41.388 14368 14368 E AndroidRuntime: 	at java.lang.Runtime.loadLibrary0(Runtime.java:1077)
04-24 16:46:41.388 14368 14368 E AndroidRuntime: 	at java.lang.Runtime.loadLibrary0(Runtime.java:998)
04-24 16:46:41.388 14368 14368 E AndroidRuntime: 	at java.lang.System.loadLibrary(System.java:1661)
04-24 16:46:41.388 14368 14368 E AndroidRuntime: 	at com.tauri.availx.TauriActivity.<clinit>(TauriActivity.kt:113)
04-24 16:46:41.388 14368 14368 E AndroidRuntime: 	at java.lang.Class.newInstance(Native Method)
04-24 16:46:41.388 14368 14368 E AndroidRuntime: 	at android.app.AppComponentFactory.instantiateActivity(AppComponentFactory.java:95)
04-24 16:46:41.388 14368 14368 E AndroidRuntime: 	at androidx.core.app.CoreComponentFactory.instantiateActivity(CoreComponentFactory.java:45)
04-24 16:46:41.388 14368 14368 E AndroidRuntime: 	at android.app.Instrumentation.newActivity(Instrumentation.java:1339)
04-24 16:46:41.388 14368 14368 E AndroidRuntime: 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3538)
04-24 16:46:41.388 14368 14368 E AndroidRuntime: 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3782)
04-24 16:46:41.388 14368 14368 E AndroidRuntime: 	at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:101)
04-24 16:46:41.388 14368 14368 E AndroidRuntime: 	at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
04-24 16:46:41.388 14368 14368 E AndroidRuntime: 	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
04-24 16:46:41.388 14368 14368 E AndroidRuntime: 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2307)
04-24 16:46:41.388 14368 14368 E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:106)
04-24 16:46:41.388 14368 14368 E AndroidRuntime: 	at android.os.Looper.loopOnce(Looper.java:201)
04-24 16:46:41.388 14368 14368 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:288)
04-24 16:46:41.388 14368 14368 E AndroidRuntime: 	at android.app.ActivityThread.main(ActivityThread.java:7872)
04-24 16:46:41.388 14368 14368 E AndroidRuntime: 	at java.lang.reflect.Method.invoke(Native Method)
04-24 16:46:41.388 14368 14368 E AndroidRuntime: 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
04-24 16:46:41.388 14368 14368 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
        Info Watching /Users/zack/SVC/Learn/tauri_try/availx/src-tauri for changes...

Platform and Versions :
Host OS: MacOs Ventura 13.2.1
Target OS: aarch64-linux-android
Rustc: 1.68.2
Cargo: 1.68.2

Android app crashes every 2nd time

Hello,

I have this issue and reported it on upstream by accident - BrainiumLLC/cargo-mobile#111 with the following additional output on the console:

Starting: Intent { cmp=io.usagi.hello2/.MainActivity }
--------- beginning of system
--------- beginning of kernel
--------- beginning of crash
--------- beginning of main
logcat: Unexpected EOF!

This means that either the device shut down, logd crashed, or this instance of logcat was unable to read log
messages as quickly as they were being produced.

If you have enabled significant logging, look into using the -G option to increase log buffer sizes.
error: Failed to log output
    Command "/home/shiro/Android/Sdk/platform-tools/adb -s 3ce6526f logcat -v color -s hello2:W" didn't complete successfully, exiting with code 1.

There's a logcat on the linked issue.

I opened the issue in upstream by accident, even though I'm using the wry template from this repo (sorry for the confusion). My colleague also ran into the same crash on a completely different android device and PC and we're completely blocked.

Thanks for the awesome work on the project!

WASM trunk not working android(blank screen, 100%)

It is spamming

29581 29581 E Tauri/Console: File: https://tauri.localhost/ - Line 544 - Msg: WebSocket connection to 'wss://tauri.localhost/_trunk/ws' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED

and looks like this
image

main function missing

Just dropping my stack trace here when I run the following command.

$ cargo mobile update
> ...
> ...
> ...
> error[E0601]: `main` function not found in crate `cargo_mobile`
>    --> src/bin/cargo-mobile.rs:223:2
>     |
> 223 | }
>     |  ^ consider adding a `main` function to `src/bin/cargo-mobile.rs`
> For more information about this error, try `rustc --explain E0601`.
> error: could not compile `tauri-mobile` due to previous error
> error: failed to compile `tauri-mobile v0.2.0 (/Users/<username>/.tauri-mobile/checkouts/tauri-mobile)`, intermediate artifacts can be found at `/Users/<username>/.tauri-mobile/checkouts/tauri-mobile/target`
> error: Failed to update `tauri-mobile`
>     Failed to install new version of `tauri-mobile`: Command "cargo install --force --path /Users/<username>/.tauri-mobile/checkouts/tauri-mobile --no-default-features --features " didn't complete
>     successfully, exiting with code 101.

I'm using an ARM-based MacBook Pro M1. And Rust 1.65.0

$ rustc --version                                                                                                                                                                       
> rustc 1.65.0 (897e37553 2022-11-02)

Failed to assemble APK program not found

cargo android run
[2023-05-05T01:14:58Z DEBUG tauri_mobile::util::cli::interface] raw args: [
        "C:\\Users\\dhorner\\.cargo\\bin\\cargo-android.exe",
        "run",
    ]
[2023-05-05T01:14:58Z INFO  tauri_mobile::config::raw] looking for config file at "\\\\?\\C:\\working\\whosball\\mobile.toml"
[2023-05-05T01:14:58Z INFO  tauri_mobile::config::raw] found config file at "\\\\?\\C:\\working\\whosball\\mobile.toml"
[2023-05-05T01:14:58Z INFO  tauri_mobile::templating] checking for template pack "wry" at "C:\\Users\\dhorner\\.cargo\\.tauri-mobile\\templates/apps\\wry.toml"
[2023-05-05T01:14:58Z INFO  tauri_mobile::templating] checking for template pack "wry" at "C:\\Users\\dhorner\\.cargo\\.tauri-mobile\\templates/apps\\wry"
[2023-05-05T01:14:58Z INFO  tauri_mobile::templating] found template pack "wry" at "C:\\Users\\dhorner\\.cargo\\.tauri-mobile\\templates/apps\\wry"
 (moto g stylus 5G (2022)) with target "aarch64-linux-android"
[2023-05-05T01:14:59Z INFO  tauri_mobile::util::cli::interface] exiting with RunFailed(
        ApkError(
            AssembleFailed(
                Error {
                    kind: NotFound,
                    message: "program not found",
                },
            ),
        ),
    )
error: Failed to assemble APK
    program not found

rustup shows the toolchain installed.

installed targets for active toolchain
--------------------------------------

aarch64-linux-android
armv7-linux-androideabi
i686-linux-android
x86_64-linux-android
x86_64-pc-windows-msvc

I know it's not flutter development but doctor has useful info.

flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.3.10, on Microsoft Windows [Version 10.0.19044.2846], locale en-US)
[√] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
[√] Chrome - develop for the web
[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.4.3)
[√] Android Studio (version 2021.3)
[√] VS Code, 64-bit edition (version 1.74.2)
[√] Connected device (4 available)
[√] HTTP Host Availability

• No issues found!

any help would be greatly appreciated.

Failed to run xcodegen

Hi,

I'm trying out a new project and hitting this:

Apple dependencies are up to date
Installing `rust-xcode-plugin`...
Updating `rust-xcode-plugin` repo...
remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
fatal: ambiguous argument 'origin/dev': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
`sudo` is required to add new languages to Xcode
cp: /Library/Developer/SharedFrameworks/SourceModel.framework/Versions/A/Resources/LanguageSpecifications/Rust.xclangspec: No such file or directory
cp: /Library/Developer/SharedFrameworks/SourceModel.framework/Versions/A/Resources/LanguageMetadata/Xcode.SourceCodeLanguage.Rust.plist: No such file or directory
victory: `rust-xcode-plugin` installed successfully!
    Please restart Xcode and click "Load Bundle" when an alert shows about
    `Rust.ideplugin`
ln: /private/tmp/testbevy/gen/apple/assets: No such file or directory
Generating Xcode project...
error: Failed to run `xcodegen`
    Failed to spawn child process for command "xcodegen generate --spec
    /private/tmp/testbevy/gen/apple/project.yml": No such file or directory (os
    error 2)

Xcode 14.2
macOS 13.2
M1

Update README to reflect our changes

We have forked cargo-mobile and maintain this for a while. But we never update the README so users might get confuse on where to start.
We should add this note to README. The note itself is also outdated a bit.
Besides, we should also update wry's README to redirect mobile instructions to here.

"dyld: Library not loaded" when running on physical iOS device.

Hello!

The Problem

When trying to run the wry template on a physical device, it can't find the .dylib file.

The full error code:
dyld[88994]: Library not loaded: /Users/me/Coding/Projects/RustXCodeTesting/target/aarch64-apple-ios/debug/deps/librust_x_code_testing.dylib Referenced from: <C7021B88-EDB8-3613-AFC6-31082A638B50> /private/var/containers/Bundle/Application/04200ED3-4C04-433B-ABB4-9617DF041E6A/rust-x-code-testing.app/rust-x-code-testing Reason: tried: '/usr/lib/system/introspection/librust_x_code_testing.dylib' (errno=2, not in dyld cache), '/Users/me/Coding/Projects/RustXCodeTesting/target/aarch64-apple-ios/debug/deps/librust_x_code_testing.dylib' (errno=2), '/private/preboot/Cryptexes/OS/Users/me/Coding/Projects/RustXCodeTesting/target/aarch64-apple-ios/debug/deps/librust_x_code_testing.dylib' (errno=2), '/Users/me/Coding/Projects/RustXCodeTesting/target/aarch64-apple-ios/debug/deps/librust_x_code_testing.dylib' (errno=2), '/usr/local/lib/librust_x_code_testing.dylib' (errno=2), '/usr/lib/librust_x_code_testing.dylib' (errno=2, not in dyld cache) Library not loaded: /Users/me/Coding/Projects/RustXCodeTesting/target/aarch64-apple-ios/debug/deps/librust_x_code_testing.dylib Referenced from: <C7021B88-EDB8-3613-AFC6-31082A638B50> /private/var/containers/Bundle/Application/04200ED3-4C04-433B-ABB4-9617DF041E6A/rust-x-code-testing.app/rust-x-code-testing Reason: tried: '/usr/lib/system/introspection/librust_x_code_testing.dylib' (errno=2, not in dyld cache), '/Users/me/Coding/Projects/RustXCodeTesting/target/aarch64-apple-ios/debug/deps/librust_x_code_testing.dylib' (errno=2), '/private/preboot/Cryptexes/OS/Users/me/Coding/Projects/RustXCodeTesting/target/aarch64-apple-ios/debug/deps/librust_x_code_testing.dylib' (errno=2), '/Users/me/Coding/Projects/RustXCodeTesting/target/aarch64-apple-ios/debug/deps/librust_x_code_testing.dylib' (errno=2), '/usr/local/lib/librust_x_code_testing.dylib' (errno=2), '/usr/lib/librust_x_code_testing.dylib' (errno=2, not in dyld cache) dyld config: DYLD_LIBRARY_PATH=/usr/lib/system/introspection DYLD_INSERT_LIBRARIES=/usr/lib/libBacktraceRecording.dylib:/usr/lib/libMainThreadChecker.dylib:/usr/lib/libRPAC.dylib:/System/Library/PrivateFrameworks/GPUToolsCapture.framework/GPUToolsCapture:/Developer/Library/PrivateFrameworks/DTDDISupport.framework/libViewDebuggerSupport.dylib

Reproducing the Issue

Setup:
Xcode 14.2
Running on M1 Max
Physical Device is iPhone 14 Pro on iOS 16.2

  1. Create project from wry template
  2. Fix linker issue by compiling rust targets manually as mentioned in #81
  3. Fix search path location from #79

From here, compiling, running, and GUI debugging rust on the iOS Simulator work. Compiling will work for a physical device, however it will crash with the error above.

What I've Tried

I noticed a closed 'Library not loaded' issue #50 , however the fix stated has already been merged - so I'm assuming this is something different?

As a side note, I've also tried doing the process on my own without 'tauri-mobile'. I was able to link the .a files in a XCFramework and access them via the c bridging header in the simulator and physical device, however I'm unsure how to get GUI debugging to work.

Any help is greatly appreciated! I've been stuck on this for a few days now.

Rotating display on Android results in crash/freeze

Describe the bug
Creating a new project with any of the templates results in either a crash when rotating display in the case of Wry; or freezes in the case of egui, on my Pixel 7 running Android 13. The app can be started in any orientation.
This is after following the prerequisites guide for Tauri mobile. Was able to create a regular tauri app and run that on Android without this issue.

From logcat it seems related to the Android Context, as at least with the crash there is a panick at 'assertion failed: previous.is_none()' in ndk-context lib.rs, but I know very little about Android development.

Steps To Reproduce
install prerequisites as per Tauri guide
cargo install --git https://github.com/tauri-apps/tauri-mobile
cargo mobile init
- select Wry template
cargo android run
change orientation of device after launch

Platform and Versions:
Host OS: Windows 11
Target OS: Android 13 on a Pixel 7
Rustc: stable msvc 1.70
cargo-mobile v0.5.1
• Contains commits up to "fix(linux): fix command detection (#174)\n"
• SDK v26.1.1
• NDK v25.2.9519653

cargo apple build fails since it cannot find built static libraries

When running the build for any iOS device, including *-apple-ios-sim targets, the compiled static libraries are compiled to $CARGO_MANIFEST_DIR/target, which if you then run cargo apple build results in XCode not being able to find your compiled static library since it's expecting it to be in $CARGO_MANIFEST_DIR/gen/apple/Sources.

Simply copying the compiled target-arch folder, e.g aarch64-apple-ios from target/aarch64-apple-ios to gen/apple/Sources/aarch64-apple-ios will let XCode compile correctly and then you can run cargo apple archive to generate an installer to publish on your dev devices (Or run cargo apple dev to run it in the iOS sim device instead of).

Sym linking the folder from target to gen/apple/Sources didn't seem to work either, so it seems like you either need to copy the generated target arch folder each time you want to build, or override the generated cargo build output directory with CARGO_TARGET_DIR=gen/apple/Sources cargo build --target *-apple-ios[-sim].

Would be nice to have this automatically copied across or set as the build output directory when running cargo apple build.

Note: This only affects cargo apple build, building from XCode, e.g to run on iOS sim, will look in the target folder, which is confusing.

Can't run example: The system cannot find the file specified

Describe the bug
The instructions to run on android lead to an error:

 (RT1) with target "aarch64-linux-android"

FAILURE: Build failed with an exception.

* What went wrong:
java.io.IOException: The system cannot find the file specified

* Try:
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Exception is:
org.gradle.api.UncheckedIOException: java.io.IOException: The system cannot find the file specified
        at org.gradle.internal.FileUtils.canonicalize(FileUtils.java:204)
        at org.gradle.initialization.layout.BuildLayoutFactory.layout(BuildLayoutFactory.java:89)
        at org.gradle.initialization.layout.BuildLayoutFactory.getLayoutFor(BuildLayoutFactory.java:77)
        at org.gradle.initialization.layout.BuildLayoutFactory.getLayoutFor(BuildLayoutFactory.java:40)
        at org.gradle.launcher.cli.converter.LayoutToPropertiesConverter.configureFromBuildDir(LayoutToPropertiesConverter.java:89)   
        at org.gradle.launcher.cli.converter.LayoutToPropertiesConverter.convert(LayoutToPropertiesConverter.java:67)
        at org.gradle.launcher.cli.DefaultCommandLineActionFactory$WithLogging.execute(DefaultCommandLineActionFactory.java:223)      
        at org.gradle.launcher.Main.doAction(Main.java:35)
        at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:50)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:60)
        at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:37)
        at org.gradle.launcher.GradleMain.main(GradleMain.java:31)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:35)
        at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:108)
        at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:63)
Caused by: java.io.IOException: The system cannot find the file specified
        at java.base/java.io.WinNTFileSystem.canonicalize0(Native Method)
        at java.base/java.io.WinNTFileSystem.canonicalize(WinNTFileSystem.java:438)
        at java.base/java.io.File.getCanonicalPath(File.java:618)
        at java.base/java.io.File.getCanonicalFile(File.java:643)
        at org.gradle.internal.FileUtils.canonicalize(FileUtils.java:202)
        ... 22 more


* Get more help at https://help.gradle.org
error: Failed to assemble APK
    command ["\\\\?\\C:\\Users\\frank\\repos\\unovica_tauri\\gen\\android\\unovica_tauri\\gradlew.bat", "--project-dir",
    "\\\\?\\C:\\Users\\frank\\repos\\unovica_tauri\\gen\\android\\unovica_tauri"] exited with code 1
PS C:\Users\frank\repos\unovica_tauri> cargo android run --info
error: Found argument '--info' which wasn't expected, or isn't valid in this context

USAGE:
    cargo android run [FLAGS] [OPTIONS]

For more information try --help

Also, cargo mobile update fails with access denied (failed to move C:\Users\frank\.cargo\bin\cargo-installuKcWEH\cargo-mobile.exe to C:\Users\frank\.cargo\bin\cargo-mobile.exe), even in administrator mode.

Steps To Reproduce
mkdir unovica_tauri
cd unovica_tauri
cargo mobile init
cargo mobile run

(cargo mobile build succeeds but doesn't actually produce an APK)

Expected behavior
Instructions to run the example should work.

Platform and Versions (please complete the following information):

Host OS: Windows 11 (developer mode)
Target OS: Android AARCH64
Rustc: 1.72.0 (5680fa18f 2023-08-23)
cargo mobile doctor:
[✔] cargo-mobile v0.2.5
• Contains commits up to "Update build.gradle.kts.hbs to fix Kotlin incorrect version usage (#122)"
• Installed at "C:\Users\frank\.tauri-mobile"
• Windows 11 v10.0
• rustc v1.72.0 (5680fa18f 2023-8-23)

[✔] Android developer tools
• SDK v26.1.1 installed at "C:\Users\frank\AppData\Local\Android\Sdk"
• NDK v25.2.9519653 installed at "C:\Users\frank\AppData\Local\Android\Sdk\ndk\25.2.9519653"

[✔] Connected devices
(RT1)RT1
(if you build with specific commit, please list it as well)

Would you want to assign yourself to resolve this bug?

  • Yes
  • No

Equi template fails on macos and ios

Describe the bug
Equi example fails on all devices I have access to. Macos and ios.

Macos fails with

error[E0603]: function `main` is private
   --> gen/bin/desktop.rs:3:18
    |
3   |     mobile_equi::main();
    |                  ^^^^ private function
    |
note: the function `main` is defined here
   --> /Users/awk21/Projects/Coding/Rust/mobile_equi/src/lib.rs:160:1
    |
160 | fn main() {
    | ^^^^^^^^^

For more information about this error, try `rustc --explain E0603`.
error: could not compile `mobile-equi` due to previous error

and ios with

Undefined symbols for architecture arm64:
  "_start_app", referenced from:
      _main in main.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
note: Building targets in dependency order
note: Run script build phase 'Build Rust Code' will be run during every build because the option to run the script phase "Based on dependency analysis" is unchecked. (in target 'mobile-equi_iOS' from project 'mobile-equi')
** BUILD FAILED **

error: Failed to build via `xcodebuild`
    command ["xcodebuild"] exited with code 65

The first error is easy to fix with the addition of a pub but the latter needed more work

Steps To Reproduce
Create a equi tempalte and try to run or archive it with apple

Expected behavior
No errors

Platform and Versions (please complete the following information):
Host OS: Macos
Target OS: Macos and ios
Rustc: rustc 1.69.0 (84c898d65 2023-04-16)
cargo mobile doctor:

[✔] cargo-mobile v0.5.0
• Contains commits up to "Add egui example (#164)\n"
• Installed at "~/.cargo/.tauri-mobile"
• macOS v12.5 (21G72)
• rustc v1.69.0 (84c898d65 2023-4-16)

[✔] Apple developer tools
• Xcode v14.2
• Active developer dir: "/Applications/Xcode.app/Contents/Developer"
• ios-deploy v1.12.2
• XcodeGen v2.35.0
✗ xcode-rust-plugin plugin absent
✗ xcode-rust-plugin lang spec absent
✗ xcode-rust-plugin lang metadata absent
• xcode-rust-plugin is up-to-date
✗ xcode-rust-plugin doesn't support Xcode UUID "C91F3560-00E7-4749-8E3F-4D83B1496051"
• Development team: Andrew King (N7VJA8E4L8)

[!] Android developer tools
✗ Have you installed the Android SDK? The ANDROID_HOME environment variable isn't set, and is required: environment variable not found

[!] Connected devices
✗ Failed to get iOS device list: Failed to request device list from ios-deploy: command ["ios-deploy", "--detect", "--timeout", "1", "--json", "--no-wifi"] exited with code
253

Would you want to assign yourself to resolve this bug?

  • Yes
  • No

Additional context
See comments on #164 too

`dyld library not loaded` when run on actual device after Xcode 14

After Xcode 14 when you run on actual device with cargo apple run or just with Xcode.
The app will crash with error of dyld library not loaded.
This is probably related to this SO issue.
As a work around, we can just build staticlib when compiling the target. But this bring noticeable delay when startup.
To really solve the issue, we need to make sure .dylib is located in the package with .a

Could not compile oboe

Execuse me. When I run "cargo android build", the error shows:

error: attribute must be applied to a static variable
--> /Users/yizhou/.cargo/registry/src/github.com-1ecc6299db9ec823/oboe-0.3.1/src/audio_stream.rs:625:5
|
625 | #[used]
| ^^^^^^^

error: could not compile oboe due to previous error

warning: build failed, waiting for other jobs to finish...
error: Failed to compile lib
Failed to run cargo build`: Command "cargo build --package tsheghon --manifest-path
/Users/yizhou/tsheghon/Cargo.toml --target aarch64-linux-android --color always" didn't complete
successfully, exiting with code 101.
In which "yizhou" is my username in macos, and "tsheghon" is the project name.

Should I change my toolchain for fix? Thank you.

`cargo mobile init` on windows passes UNC path to git -C

Hello

Running cargo mobile init passes a canonicalized UNC path on windows which is rejected by Git.
With mingw bash: (a similar error occurs when using cmd.exe and powershell).

$ cargo mobile init
Project name (wrp): hello
Stylized name (Hello): Hello
Domain (example.com): neurosrg.com
Detected template packs:
  [0] bevy
  [1] bevy-demo
  [2] wgpu
  [3] winit
  [4] wry
  Enter an index for a template pack above.
Template pack (0): 4
Generating base project...
fatal: cannot change to '\?D:devtutorial3wrp': No such file or directory
error: Failed to initialize git
    Command "git -C \\\\?\\D:\\dev\\tutorial3\\wrp init" didn't complete successfully, exiting with
    code 128.

This is most likely caused by this issue:
rust-lang/rust#42869

I think just removing the call to canonicalize here should fix the issue on windows:
https://github.com/tauri-apps/tauri-mobile/blob/0b10eec445391f459af694ae6646f9dda6c60fc1/src/config/mod.rs#L132

Do not populate home in the install process

Is your feature request related to a problem? Please describe.
The current installation process populates the home directory of the user.
When packaging this for linux distributions, relying on the home directory of the user is not always possible (it's non deterministic and so can produce errors).
Currently packaging this for nixos, I'm thinking of including the templates in the resulting package. The problem is that cargo mobile will always look in the home directory for the templates.

Describe the solution you'd like
Would it be possible to customise that directory with an environment variable (that defaults to home for example).
I could then make sure the binary built always has that directory pointing at the templates I would include with the package itself.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Would you want to assign yourself to implement this feature?

  • Yes
  • No

Additional context
Add any other context or screenshots about the feature request here.

the cargo.lock needs updating on the latest release (0.5.0)

Describe the bug
if you try to build from source, cargo wants to update the lockfile, it needs updating

Steps To Reproduce
cargo build in the root of the repo, that should update the lockfile

Expected behavior
cargo.lock corresponds to the released version

Screenshots
If applicable, add screenshots to help explain your problem.

Platform and Versions (please complete the following information):
Host OS:
Target OS:
Rustc:
cargo mobile doctor:
(if you build with specific commit, please list it as well)

Would you want to assign yourself to resolve this bug?

  • Yes
  • No

Additional context
Add any other context about the problem here.

Can't run with genymotion android 7.0

for genymotion android 7.0, adb shell dumpsys bluetooth_manager gives Can't find service: bluetooth_manager.

Thus cargo android run gives

Can't find service: bluetooth_manager
error: Failed to get device name
    Name regex didn't match anything.

I thought bluetooth_manager is not a necessity for an android device

Variable "android-app-dependencies-platform" not found in strict mode

Describe the bug
When I run cargo mobile init I get following error:

error: Android template processing failed
    Failed to render template at "/home/ks/.cargo/.tauri-mobile/templates/platforms/android-studio/app/build.gradle.kts.hbs": Failed to render template: Error rendering
    "Unnamed template" line 53, col 5: Variable "android-app-dependencies-platform" not found in strict mode.

And then using cargo android run and cargo android open I see following errors respectively:

error: Failed to assemble APK
    No such file or directory (os error 2)
    
    ...
    
    error: Failed to open project in Android Studio
    Launch failed: No such file or directory (os error 2)

Steps To Reproduce

  1. Install Android Studio Giraffe in /opt/android-studio
  2. Follow this tutorial for Linux (Ubuntu): https://github.com/tauri-apps/wry/blob/dev/MOBILE.md

Expected behavior
Application is initialized correctly

Screenshots
image

Platform and Versions (please complete the following information):
Host OS: Ubuntu 22.04
Target OS: Android 10.0
Rustc: 1.70.0
cargo mobile doctor:
(if you build with specific commit, please list it as well)

Failed to install CodeLLDB extension

cargo mobile init gives

Generating base project...
error: Failed to install CodeLLDB extension
    No such file or directory (os error 2)

I don't use vscode, seems related to it.

OpenSSL compilation for target *-apple-ios-sim fails

Attempts to compile any rust source that uses libssl-dev or openssl-dev sources fail by default when running cargo build --target *-apple-ios-sim since pkg-config seems to not know how to cross-compile openssl for different platforms.

There's a fix, and it's by setting the OPENSSL_DIR environment path to where your openssl install with dev files is located, for me, on my mac, with openssl installed with brew install openssl@3, is installed to /opt/homebrew/opt/openssl@3.

Running the cargo build command as such OPENSSL_DIR=/opt/homebrew/opt/openssl@3 cargo build --target *-apple-ios-sim now builds fine, and produces a static library that runs on iOS sim devices.

Not sure if this is a fix to put in the source code, or if it's a user config that should be defined, but leaving this info here for anyone else that runs into this problem.

Build release on Android not working

I'm sorry if this is an inappropriate question, but is it possible for now to build a release android .apk? When i use cargo tauri android dev, project works fine on emulators. When I start building the application with the regular command cargo tauri android build, it builds it smoothly into .aab and .apk formats, but without a signed certificate. I decided to manually sign it using the command jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore my-release-key.keystore app-universal-release-unsigned.apk app. When installing the application on the emulator, it throws an error The APK failed to install. Error: INSTALL_FAILED_INVALID_APK: Failed to extract native libraries, res=-2 and also doesn't install on other devices.
image
I tried unpacking the .apk from .aab using the command java -jar "bundletool-all-1.14.0.jar" build-apks --mode="universal" --bundle="app-universal-release.aab" --output="release.apks" and sign it again. Now the application installs, but instantly stops working on all devices.

Now I try to creating a new project in Android Studio and follow the instructions from /wry/blob/dev/MOBILE.md and wry/README.md entirely, but I don't quite understand at the end of the repository description how to correctly configure the environment variables that specifically concern WRY and which Kotlin files are needed. Thank you so much, i would be grateful for any answer and help regarding this matter ❤

egui template fail on emulator

Describe the bug
egui template quit after open on emulator. wry template works.

Platform and Versions (please complete the following information):
Host OS: archlinux
Target OS: genymotion android 11.0
Rustc: 1.70.0
cargo mobile doctor:

[!] cargo-mobile v0.5.1
    • Contains commits up to "fix(linux): fix command detection (#174)\n"
    • Installed at "~/.cargo/.tauri-mobile"
    ✗ Failed to get OS info: Failed to find `VERSION` in "/etc/os-release": "NAME=\"Arch Linux\"\nPRETTY_NAME=\"Arch
      Linux\"\nID=arch\nBUILD_ID=rolling\nANSI_COLOR=\"38;2;23;147;209\"\nHOME_URL=\"https://archlinux.org/\"\nDOCUMENTATION_URL=\"https://wiki.archlinux.org/\"\nSUPPORT_
      URL=\"https://bbs.archlinux.org/\"\nBUG_REPORT_URL=\"https://bugs.archlinux.org/\"\nPRIVACY_POLICY_URL=\"https://terms.archlinux.org/docs/privacy-policy/\"\nLOGO=ar
      chlinux-logo\n"
    • rustc v1.70.0 (90c541806 2023-5-31)

[✔] Android developer tools
    • SDK v26.1.1 installed at "~/Android/Sdk"
    • NDK v25.2.9519653 installed at "~/Android/Sdk/ndk/25.2.9519653"
Can't find service: bluetooth_manager
Can't find service: bluetooth_manager

logcat

--------- beginning of main
06-12 00:20:19.147  2736  2736 I abb     : StartCommandInProcess(73657474696e67730067657400656e61 settings.get.ena [truncated])
06-12 00:20:19.149  2736  2740 I abb     : oneway function results will be dropped but finished with status OK and parcel size 4
06-12 00:20:19.150  2736  2736 I abb     : StartCommandInProcess(7061636b61676500696e7374616c6c00 package.install. [truncated])
--------- beginning of kernel
06-12 00:20:19.700     0     0 W perfetto: enabled ftrace
06-12 00:20:19.903     0     0 W audit   : audit_lost=2640 audit_rate_limit=5 audit_backlog_limit=64
06-12 00:20:19.903     0     0 E audit   : rate limit exceeded
06-12 00:20:20.132     0     0 D logd    : logdr: UID=10138 GID=10138 PID=4366 n tail=50 logMask=8 pid=4321 start=0ns timeout=0ns
06-12 00:20:20.133     0     0 D logd    : logdr: UID=10138 GID=10138 PID=4366 n tail=50 logMask=1 pid=4321 start=0ns timeout=0ns
06-12 00:20:20.233     0     0 D logd    : logdr: UID=10138 GID=10138 PID=4366 n tail=0 logMask=8 pid=4321 start=0ns timeout=0ns
06-12 00:20:20.233     0     0 D logd    : logdr: UID=10138 GID=10138 PID=4366 n tail=0 logMask=1 pid=4321 start=0ns timeout=0ns
06-12 00:20:20.244     0     0 I init    : Untracked pid 4366 exited with status 0
06-12 00:20:20.245     0     0 I init    : Untracked pid 4368 exited with status 0
06-12 00:20:20.248     0     0 E binder_alloc: 4321: binder_alloc_buf, no vma
06-12 00:20:20.248     0     0 I binder  : 706:3641 transaction failed 29189/-3, size 4-0 line 3137
06-12 00:20:20.249     0     0 I binder  : send failed reply for transaction 186272 to 4321:4321
06-12 00:20:20.252     0     0 I binder  : undelivered TRANSACTION_COMPLETE
06-12 00:20:20.252     0     0 I binder  : undelivered TRANSACTION_ERROR: 29189
06-12 00:20:20.252     0     0 I binder  : undelivered transaction 186283, process died.
--------- beginning of system
06-12 00:20:21.729   706   783 W RuleEvaluation: Integrity rule files are not available.
06-12 00:20:21.730   706   745 I PackageManager: Integrity check passed for file:///data/app/vmdl142365545.tmp
06-12 00:20:21.732   706   732 I ActivityManager: Force stopping ai.tetras.tarui_mobile_agdk appid=10138 user=-1: installPackageLI
06-12 00:20:21.733   706   745 I PackageManager: Update package ai.tetras.tarui_mobile_agdk code path from /data/app/~~RvNt_jAjTz3knjlBlKYVIQ==/ai.tetras.tarui_mobile_agdk-ekZhl0mnp4E8lwcOzFVBmQ== to /data/app/~~k0gpNIUBF_GRrk_L7FZUHQ==/ai.tetras.tarui_mobile_agdk-WVTc6RNP9gDR4LxCf92zcQ==; Retain data and using new
06-12 00:20:21.733   706   745 I PackageManager: Update package ai.tetras.tarui_mobile_agdk resource path from /data/app/~~RvNt_jAjTz3knjlBlKYVIQ==/ai.tetras.tarui_mobile_agdk-ekZhl0mnp4E8lwcOzFVBmQ== to /data/app/~~k0gpNIUBF_GRrk_L7FZUHQ==/ai.tetras.tarui_mobile_agdk-WVTc6RNP9gDR4LxCf92zcQ==; Retain data and using new
06-12 00:20:21.733   706   745 I AppsFilter: interaction: PackageSetting{4225fd6 org.bevyengine.example/10131} -> PackageSetting{71e6df6 ai.tetras.tarui_mobile_agdk/10138} BLOCKED
06-12 00:20:21.733   706   745 I AppsFilter: interaction: PackageSetting{5082144 co.realfit.agdkeframe/10135} -> PackageSetting{71e6df6 ai.tetras.tarui_mobile_agdk/10138} BLOCKED
06-12 00:20:21.733   706   745 D CompatibilityChangeReporter: Compat change id reported: 135549675; UID 10138; state: ENABLED
06-12 00:20:21.783   706   745 D PackageManager: Instant App installer not found with android.intent.action.INSTALL_INSTANT_APP_PACKAGE
06-12 00:20:21.783   706   745 D PackageManager: Clear ephemeral installer activity
06-12 00:20:21.786   706   745 I AppsFilter: interaction: PackageSetting{4225fd6 org.bevyengine.example/10131} -> PackageSetting{f90b206 ai.tetras.tarui_mobile_agdk/10138} BLOCKED
06-12 00:20:21.786   706   745 I AppsFilter: interaction: PackageSetting{5082144 co.realfit.agdkeframe/10135} -> PackageSetting{f90b206 ai.tetras.tarui_mobile_agdk/10138} BLOCKED
06-12 00:20:21.787   488   488 E installd: Couldn't opendir /data/app/vmdl142365545.tmp: No such file or directory
06-12 00:20:21.787   488   488 E installd: Failed to delete /data/app/vmdl142365545.tmp: No such file or directory
06-12 00:20:21.788  2736  2740 I abb     : oneway function results will be dropped but finished with status OK and parcel size 4
06-12 00:20:21.788   706   745 I ActivityManager: Force stopping ai.tetras.tarui_mobile_agdk appid=10138 user=0: pkg removed
06-12 00:20:21.792  1688  1688 I MediaProvider: Invalidating LocalCallingIdentity cache for package ai.tetras.tarui_mobile_agdk. Reason: package android.intent.action.PACKAGE_REMOVED
06-12 00:20:21.793   706   732 W BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.PACKAGE_REMOVED dat=package:ai.tetras.tarui_mobile_agdk flg=0x4000010 (has extras) } to com.android.gallery3d/.app.PackagesMonitor
06-12 00:20:21.793   706   732 W BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.PACKAGE_REMOVED dat=package:ai.tetras.tarui_mobile_agdk flg=0x4000010 (has extras) } to com.genymotion.superuser/com.koushikdutta.superuser.PackageChangeReceiver
06-12 00:20:21.794   706   774 I InputReader: Reconfiguring input devices, changes=KEYBOARD_LAYOUTS | 
06-12 00:20:21.798  1688  1688 I MediaProvider: Invalidating LocalCallingIdentity cache for package ai.tetras.tarui_mobile_agdk. Reason: package android.intent.action.PACKAGE_ADDED
06-12 00:20:21.799   706   706 I Telecom : DefaultDialerCache: Refreshing default dialer for user 0: now com.android.dialer: DDC.oR@AIo
06-12 00:20:21.800   706   774 I InputReader: Reconfiguring input devices, changes=KEYBOARD_LAYOUTS | 
06-12 00:20:21.800   706   732 W BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.PACKAGE_ADDED dat=package:ai.tetras.tarui_mobile_agdk flg=0x4000010 (has extras) } to com.android.packageinstaller/.PackageInstalledReceiver
06-12 00:20:21.800   706   732 W BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.PACKAGE_ADDED dat=package:ai.tetras.tarui_mobile_agdk flg=0x4000010 (has extras) } to com.android.gallery3d/.app.PackagesMonitor
06-12 00:20:21.800   706   732 W BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.PACKAGE_ADDED dat=package:ai.tetras.tarui_mobile_agdk flg=0x4000010 (has extras) } to com.genymotion.superuser/com.koushikdutta.superuser.PackageChangeReceiver
06-12 00:20:21.807   706   706 V BackupManagerConstants: getFullBackupIntervalMilliseconds(...) returns 86400000
06-12 00:20:21.807   706   706 V BackupManagerConstants: getFullBackupRequiredNetworkType(...) returns 2
06-12 00:20:21.807   706   706 V BackupManagerConstants: getFullBackupRequireCharging(...) returns true
06-12 00:20:21.807  2192  2775 I PermissionControllerServiceImpl: Updating user sensitive for uid 10138
06-12 00:20:21.810   706   726 D EventSequenceValidator: inc AccIntentStartedEvents to 2
06-12 00:20:21.810   706  1302 I ActivityTaskManager: START u0 {flg=0x10000000 cmp=ai.tetras.tarui_mobile_agdk/android.app.NativeActivity} from uid 0
06-12 00:20:21.818  4311  4313 I cmd     : oneway function results will be dropped but finished with status OK and parcel size 4
06-12 00:20:21.818   481   481 I perfetto: ing_service_impl.cc:758 Configured tracing session 16, #sources:1, duration:5000 ms, #buffers:1, total buffer size:4096 KB, total sessions:1, uid:1071 session name: ""
06-12 00:20:21.818   480   480 I perfetto: probes_producer.cc:230  Ftrace setup (target_buf=16)
06-12 00:20:21.830   480   480 I perfetto: ftrace_procfs.cc:176    enabled ftrace
06-12 00:20:21.833  1105  1105 D CarrierSvcBindHelper: No carrier app for: 0
06-12 00:20:21.834   706   726 D CompatibilityChangeReporter: Compat change id reported: 135634846; UID 10138; state: DISABLED
06-12 00:20:21.834  1105  1105 D CarrierSvcBindHelper: No carrier app for: 0
06-12 00:20:21.835   706   733 D CompatibilityChangeReporter: Compat change id reported: 143937733; UID 10138; state: ENABLED
06-12 00:20:21.835   422   605 D gralloc_ranchu: gralloc_alloc: Creating ashmem region of size 3690496
06-12 00:20:21.836  1548  1563 W d.process.acor: Reducing the number of considered missed Gc histogram windows from 190 to 100
06-12 00:20:21.837   706   731 W VoiceInteractionManager: no available voice recognition services found for user 0
06-12 00:20:21.837   410   410 D Zygote  : Forked child process 4321
06-12 00:20:21.838   706   774 I InputReader: Reconfiguring input devices, changes=KEYBOARD_LAYOUTS | 
06-12 00:20:21.839  4321  4321 I Zygote  : seccomp disabled by setenforce 0
06-12 00:20:21.839   422   605 E [email protected]: open_verbose:32: Could not open '/dev/goldfish_pipe': No such file or directory
06-12 00:20:21.840  1105  1105 D CarrierConfigLoader: mHandler: 9 phoneId: 0
06-12 00:20:21.841   706   733 I ActivityManager: Start proc 4321:ai.tetras.tarui_mobile_agdk/u0a138 for pre-top-activity {ai.tetras.tarui_mobile_agdk/android.app.NativeActivity}
06-12 00:20:21.841  4321  4321 I rui_mobile_agd: Late-enabling -Xcheck:jni
06-12 00:20:21.864  4321  4321 I rui_mobile_agd: Unquickening 12 vdex files!
06-12 00:20:21.865  4321  4321 W rui_mobile_agd: Unexpected CPU variant for X86 using defaults: x86_64
06-12 00:20:21.868   563   645 I adbd    : jdwp connection from 4321
06-12 00:20:21.898  4319  4319 D AndroidRuntime: >>>>>> START com.android.internal.os.RuntimeInit uid 0 <<<<<<
06-12 00:20:21.900  4319  4319 I AndroidRuntime: Using default boot image
06-12 00:20:21.900  4319  4319 I AndroidRuntime: Leaving lock profiling enabled
06-12 00:20:21.901   422   605 D gralloc_ranchu: gralloc_alloc: Creating ashmem region of size 3690496
06-12 00:20:21.902  4319  4319 I app_process: Core platform API reporting enabled, enforcing=false
06-12 00:20:21.906   422   605 E [email protected]: open_verbose:32: Could not open '/dev/goldfish_pipe': No such file or directory
06-12 00:20:21.943  4319  4319 D app_process: Time zone APEX ICU file found: /apex/com.android.tzdata/etc/icu/icu_tzdata.dat
06-12 00:20:21.943  4319  4319 D app_process: I18n APEX ICU file found: /apex/com.android.i18n/etc/icu/icudt66l.dat
06-12 00:20:21.945  4319  4319 W app_process: Unexpected CPU variant for X86 using defaults: x86_64
06-12 00:20:21.945  4319  4319 I app_process: The ClassLoaderContext is a special shared library.
06-12 00:20:21.952  4319  4319 W app_process: JNI RegisterNativeMethods: attempt to register 0 native methods for android.media.AudioAttributes
06-12 00:20:21.955  4319  4319 D AndroidRuntime: Calling main entry com.android.commands.input.Input
06-12 00:20:21.956  4319  4319 D AndroidRuntime: Shutting down VM
06-12 00:20:21.996  4321  4321 D NetworkSecurityConfig: No Network Security Config specified, using platform default
06-12 00:20:21.996  4321  4321 D NetworkSecurityConfig: No Network Security Config specified, using platform default
06-12 00:20:22.012  4321  4321 I RenderThread: type=1400 audit(0.0:2938): avc: denied { read } for name="libandroidemu.so" dev="sda4" ino=4484 scontext=u:r:untrusted_app:s0:c138,c256,c512,c768 tcontext=u:object_r:vendor_file:s0 tclass=file permissive=1 app=ai.tetras.tarui_mobile_agdk
06-12 00:20:22.012  4321  4321 I RenderThread: type=1400 audit(0.0:2939): avc: denied { open } for path="/system/vendor/lib64/libandroidemu.so" dev="sda4" ino=4484 scontext=u:r:untrusted_app:s0:c138,c256,c512,c768 tcontext=u:object_r:vendor_file:s0 tclass=file permissive=1 app=ai.tetras.tarui_mobile_agdk
06-12 00:20:22.012  4321  4321 I RenderThread: type=1400 audit(0.0:2940): avc: denied { getattr } for path="/system/vendor/lib64/libandroidemu.so" dev="sda4" ino=4484 scontext=u:r:untrusted_app:s0:c138,c256,c512,c768 tcontext=u:object_r:vendor_file:s0 tclass=file permissive=1 app=ai.tetras.tarui_mobile_agdk
06-12 00:20:22.012  4321  4321 I RenderThread: type=1400 audit(0.0:2941): avc: denied { execute } for path="/system/vendor/lib64/libandroidemu.so" dev="sda4" ino=4484 scontext=u:r:untrusted_app:s0:c138,c256,c512,c768 tcontext=u:object_r:vendor_file:s0 tclass=file permissive=1 app=ai.tetras.tarui_mobile_agdk
06-12 00:20:22.018  4321  4360 D libEGL  : loaded /vendor/lib64/egl/libEGL_emulation.so
06-12 00:20:22.019  4321  4360 D libEGL  : loaded /vendor/lib64/egl/libGLESv1_CM_emulation.so
06-12 00:20:22.020  4321  4360 D libEGL  : loaded /vendor/lib64/egl/libGLESv2_emulation.so
06-12 00:20:22.028  4321  4321 I Thread-2: type=1400 audit(0.0:2942): avc: denied { open } for path="/dev/__properties__/u:object_r:adbd_prop:s0" dev="tmpfs" ino=10299 scontext=u:r:untrusted_app:s0:c138,c256,c512,c768 tcontext=u:object_r:adbd_prop:s0 tclass=file permissive=1 app=ai.tetras.tarui_mobile_agdk
06-12 00:20:22.031  4321  4362 D vulkan  : searching for layers in '/data/app/~~k0gpNIUBF_GRrk_L7FZUHQ==/ai.tetras.tarui_mobile_agdk-WVTc6RNP9gDR4LxCf92zcQ==/lib/x86_64'
06-12 00:20:22.031  4321  4362 D vulkan  : searching for layers in '/data/app/~~k0gpNIUBF_GRrk_L7FZUHQ==/ai.tetras.tarui_mobile_agdk-WVTc6RNP9gDR4LxCf92zcQ==/base.apk!/lib/x86_64'
06-12 00:20:22.031  4321  4362 W wgpu_hal::vulkan::ins..: Unable to find layer: VK_LAYER_KHRONOS_validation
06-12 00:20:22.038  4321  4362 D HostConnection: HostConnection::get() New Host Connection established 0x707e31c70a50, pid 4321, tid 4362
06-12 00:20:22.039   259  4363 D local_opengl: Sending id 64 to host
06-12 00:20:22.039  4321  4362 D HostConnection: HostComposition ext ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_async_unmap_buffer ANDROID_EMU_sync_buffer_data GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_async_frame_commands ANDROID_EMU_gles_max_version_3_1 
06-12 00:20:22.039  4321  4362 E rui_mobile_agd: open_verbose:32: Could not open '/dev/goldfish_pipe': No such file or directory
06-12 00:20:22.039  4321  4362 W rui_mobile_agd: Process pipe failed
06-12 00:20:22.042  4321  4362 W wgpu_hal::gles::egl: 	EGL surface: -srgb
06-12 00:20:22.042  4321  4362 W wgpu_hal::gles::egl: EGL says it can present to the window but not natively
06-12 00:20:22.042  4321  4362 W wgpu_hal::gles::egl: 	EGL context: -robust access
06-12 00:20:22.043  4321  4362 D EGL_emulation: eglCreateContext: 0x707e21c98650: maj 3 min 1 rcv 4
06-12 00:20:22.071  4321  4362 E rui_mobile_agd: open_verbose:32: Could not open '/dev/goldfish_pipe': No such file or directory
06-12 00:20:22.072  4321  4362 W winit::platform_impl:..: TODO: forward onStart notification to application
06-12 00:20:22.096  4321  4362 D EGL_emulation: eglMakeCurrent: 0x707e21c98650: ver 3 1 (tinfo 0x707dc1cba1c0) (first time)
06-12 00:20:22.097   706   731 D ArtManagerInternalImpl: /data/misc/iorapd/ai.tetras.tarui_mobile_agdk/1/android.app.NativeActivity/compiled_traces/compiled_trace.pb doesn't exist
06-12 00:20:22.098   706   726 D EventSequenceValidator: dec AccIntentStartedEvents to 1
06-12 00:20:22.099   706   731 I ActivityTaskManager: Displayed ai.tetras.tarui_mobile_agdk/android.app.NativeActivity: +286ms
06-12 00:20:22.173  4321  4361 I RustStdoutStderr: thread '<unnamed>' panicked at 'Error in Surface::configure: Validation Error
06-12 00:20:22.173  4321  4361 I RustStdoutStderr: 
06-12 00:20:22.173  4321  4361 I RustStdoutStderr: Caused by:
06-12 00:20:22.173  4321  4361 I RustStdoutStderr:     Requested usage is not supported
06-12 00:20:22.173  4321  4361 I RustStdoutStderr: ', /home/bilabila/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-0.16.1/src/backend/direct.rs:734:18
06-12 00:20:22.173  4321  4361 I RustStdoutStderr: note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
06-12 00:20:22.186  4321  4362 W libEGL  : eglTerminate() called w/ 1 objects remaining
06-12 00:20:22.187  4321  4361 I RustStdoutStderr: attempt to unwind out of `rust` with err: Any { .. }
--------- beginning of crash
06-12 00:20:22.187  4321  4362 F libc    : Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 4362 (Thread-2), pid 4321 (rui_mobile_agdk)
06-12 00:20:22.202  4366  4366 I crash_dump64: obtaining output fd from tombstoned, type: kDebuggerdTombstone
06-12 00:20:22.202   254   254 I tombstoned: received crash request for pid 4362
06-12 00:20:22.202  4366  4366 I crash_dump64: performing dump of process 4321 (target tid = 4362)
06-12 00:20:22.205  4366  4366 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
06-12 00:20:22.205  4366  4366 F DEBUG   : Build fingerprint: 'google/vbox86p/vbox86p:11/RQ1A.210105.003/590:userdebug/test-keys,patch-1'
06-12 00:20:22.205  4366  4366 F DEBUG   : Revision: '0'
06-12 00:20:22.205  4366  4366 F DEBUG   : ABI: 'x86_64'
06-12 00:20:22.205  4366  4366 F DEBUG   : Timestamp: 2023-06-12 00:20:22+0800
06-12 00:20:22.205  4366  4366 F DEBUG   : pid: 4321, tid: 4362, name: Thread-2  >>> ai.tetras.tarui_mobile_agdk <<<
06-12 00:20:22.205  4366  4366 F DEBUG   : uid: 10138
06-12 00:20:22.205  4366  4366 F DEBUG   : signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr --------
06-12 00:20:22.205  4366  4366 F DEBUG   :     rax 0000000000000000  rbx 00000000000010e1  rcx 0000708033be27b8  rdx 0000000000000006
06-12 00:20:22.205  4366  4366 F DEBUG   :     r8  0000000000000000  r9  0000000000000000  r10 0000707d48e5c530  r11 0000000000000246
06-12 00:20:22.205  4366  4366 F DEBUG   :     r12 0000707d48e5cd68  r13 0000707d48e5cd88  r14 0000707d48e5c528  r15 000000000000110a
06-12 00:20:22.205  4366  4366 F DEBUG   :     rdi 00000000000010e1  rsi 000000000000110a
06-12 00:20:22.205  4366  4366 F DEBUG   :     rbp 00000000000010e1  rsp 0000707d48e5c518  rip 0000708033be27b8
06-12 00:20:22.208  4366  4366 F DEBUG   : backtrace:
06-12 00:20:22.208  4366  4366 F DEBUG   :       #00 pc 000000000005a7b8  /apex/com.android.runtime/lib64/bionic/libc.so (syscall+24) (BuildId: db32cd2178a34227ed4c260caa84a601)
06-12 00:20:22.208  4366  4366 F DEBUG   :       #01 pc 000000000005d722  /apex/com.android.runtime/lib64/bionic/libc.so (abort+194) (BuildId: db32cd2178a34227ed4c260caa84a601)
06-12 00:20:22.208  4366  4366 F DEBUG   :       #02 pc 000000000135e206  /data/app/~~k0gpNIUBF_GRrk_L7FZUHQ==/ai.tetras.tarui_mobile_agdk-WVTc6RNP9gDR4LxCf92zcQ==/base.apk (offset 0x39d000) (std::sys::unix::abort_internal::h04f748c02eac719a+6)
06-12 00:20:22.208  4366  4366 F DEBUG   :       #03 pc 0000000001359416  /data/app/~~k0gpNIUBF_GRrk_L7FZUHQ==/ai.tetras.tarui_mobile_agdk-WVTc6RNP9gDR4LxCf92zcQ==/base.apk (offset 0x39d000) (std::process::abort::ha5c4c1d1bf520f28+6)
06-12 00:20:22.208  4366  4366 F DEBUG   :       #04 pc 00000000006767f5  /data/app/~~k0gpNIUBF_GRrk_L7FZUHQ==/ai.tetras.tarui_mobile_agdk-WVTc6RNP9gDR4LxCf92zcQ==/base.apk (offset 0x39d000) (tarui_mobile_agdk::stop_unwind::h3b1dbad83ddd218a+309)
06-12 00:20:22.208  4366  4366 F DEBUG   :       #05 pc 0000000000683089  /data/app/~~k0gpNIUBF_GRrk_L7FZUHQ==/ai.tetras.tarui_mobile_agdk-WVTc6RNP9gDR4LxCf92zcQ==/base.apk (offset 0x39d000) (android_main+473)
06-12 00:20:22.208  4366  4366 F DEBUG   :       #06 pc 0000000001322f79  /data/app/~~k0gpNIUBF_GRrk_L7FZUHQ==/ai.tetras.tarui_mobile_agdk-WVTc6RNP9gDR4LxCf92zcQ==/base.apk (offset 0x39d000) (android_activity::native_activity::glue::ANativeActivity_onCreate::_$u7b$$u7b$closure$u7d$$u7d$::he86afd8a8cbc90bf+889)
06-12 00:20:22.208  4366  4366 F DEBUG   :       #07 pc 0000000001327d32  /data/app/~~k0gpNIUBF_GRrk_L7FZUHQ==/ai.tetras.tarui_mobile_agdk-WVTc6RNP9gDR4LxCf92zcQ==/base.apk (offset 0x39d000) (std::sys_common::backtrace::__rust_begin_short_backtrace::h1062931ce84f7041+18)
06-12 00:20:22.208  4366  4366 F DEBUG   :       #08 pc 000000000132b3c3  /data/app/~~k0gpNIUBF_GRrk_L7FZUHQ==/ai.tetras.tarui_mobile_agdk-WVTc6RNP9gDR4LxCf92zcQ==/base.apk (offset 0x39d000) (std::thread::Builder::spawn_unchecked_::_$u7b$$u7b$closure$u7d$$u7d$::_$u7b$$u7b$closure$u7d$$u7d$::h82be939a8fc798ab+19)
06-12 00:20:22.208  4366  4366 F DEBUG   :       #09 pc 0000000001327ce3  /data/app/~~k0gpNIUBF_GRrk_L7FZUHQ==/ai.tetras.tarui_mobile_agdk-WVTc6RNP9gDR4LxCf92zcQ==/base.apk (offset 0x39d000) (_$LT$core..panic..unwind_safe..AssertUnwindSafe$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$$LP$$RP$$GT$$GT$::call_once::h3cefdac8528cb90c+19)
06-12 00:20:22.208  4366  4366 F DEBUG   :       #10 pc 0000000001327fa6  /data/app/~~k0gpNIUBF_GRrk_L7FZUHQ==/ai.tetras.tarui_mobile_agdk-WVTc6RNP9gDR4LxCf92zcQ==/base.apk (offset 0x39d000) (std::panicking::try::do_call::h707d5fd8ba535a7a+54)
06-12 00:20:22.208  4366  4366 F DEBUG   :       #11 pc 0000000001328d5a  /data/app/~~k0gpNIUBF_GRrk_L7FZUHQ==/ai.tetras.tarui_mobile_agdk-WVTc6RNP9gDR4LxCf92zcQ==/base.apk (offset 0x39d000) (__rust_try+26)
06-12 00:20:22.208  4366  4366 F DEBUG   :       #12 pc 0000000001327e1d  /data/app/~~k0gpNIUBF_GRrk_L7FZUHQ==/ai.tetras.tarui_mobile_agdk-WVTc6RNP9gDR4LxCf92zcQ==/base.apk (offset 0x39d000) (std::panicking::try::h059921945ff18897+77)
06-12 00:20:22.208  4366  4366 F DEBUG   :       #13 pc 0000000001327d86  /data/app/~~k0gpNIUBF_GRrk_L7FZUHQ==/ai.tetras.tarui_mobile_agdk-WVTc6RNP9gDR4LxCf92zcQ==/base.apk (offset 0x39d000) (std::panic::catch_unwind::h93636d2d79e2d585+22)
06-12 00:20:22.208  4366  4366 F DEBUG   :       #14 pc 000000000132b177  /data/app/~~k0gpNIUBF_GRrk_L7FZUHQ==/ai.tetras.tarui_mobile_agdk-WVTc6RNP9gDR4LxCf92zcQ==/base.apk (offset 0x39d000) (std::thread::Builder::spawn_unchecked_::_$u7b$$u7b$closure$u7d$$u7d$::hc056fa85d260da2d+503)
06-12 00:20:22.208  4366  4366 F DEBUG   :       #15 pc 000000000132591e  /data/app/~~k0gpNIUBF_GRrk_L7FZUHQ==/ai.tetras.tarui_mobile_agdk-WVTc6RNP9gDR4LxCf92zcQ==/base.apk (offset 0x39d000) (core::ops::function::FnOnce::call_once$u7b$$u7b$vtable.shim$u7d$$u7d$::haa953a7f77751909+14)
06-12 00:20:22.208  4366  4366 F DEBUG   :       #16 pc 000000000135df15  /data/app/~~k0gpNIUBF_GRrk_L7FZUHQ==/ai.tetras.tarui_mobile_agdk-WVTc6RNP9gDR4LxCf92zcQ==/base.apk (offset 0x39d000) (std::sys::unix::thread::Thread::new::thread_start::hca5e2a9d8f8e2382+21)
06-12 00:20:22.209  4366  4366 F DEBUG   :       #17 pc 00000000000c853a  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+58) (BuildId: db32cd2178a34227ed4c260caa84a601)
06-12 00:20:22.209  4366  4366 F DEBUG   :       #18 pc 000000000005f5d7  /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+55) (BuildId: db32cd2178a34227ed4c260caa84a601)
06-12 00:20:22.365   254   254 E tombstoned: Tombstone written to: /data/tombstones/tombstone_14
06-12 00:20:22.366   706   739 I BootReceiver: Copying /data/tombstones/tombstone_14 to DropBox (SYSTEM_TOMBSTONE)
06-12 00:20:22.367   706   739 I DropBoxManagerService: add tag=SYSTEM_TOMBSTONE isTagEnabled=true flags=0x2
06-12 00:20:22.368   706  4373 W ActivityTaskManager:   Force finishing activity ai.tetras.tarui_mobile_agdk/android.app.NativeActivity
06-12 00:20:22.369   422   605 D gralloc_ranchu: gralloc_alloc: Creating ashmem region of size 3690496
06-12 00:20:22.370   706  4374 I DropBoxManagerService: add tag=data_app_native_crash isTagEnabled=true flags=0x2
06-12 00:20:22.372   422   605 E [email protected]: open_verbose:32: Could not open '/dev/goldfish_pipe': No such file or directory
06-12 00:20:22.380   706  2942 D HostConnection: HostConnection::get() New Host Connection established 0x707e31c756d0, pid 706, tid 2942
06-12 00:20:22.381   259  4377 D local_opengl: Sending id 65 to host
06-12 00:20:22.381   706  2942 D HostConnection: HostComposition ext ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_async_unmap_buffer ANDROID_EMU_sync_buffer_data GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_async_frame_commands ANDROID_EMU_gles_max_version_3_1 
06-12 00:20:22.382   706   773 W InputDispatcher: channel '6031a90 ai.tetras.tarui_mobile_agdk/android.app.NativeActivity (server)' ~ Consumer closed input channel or an error occurred.  events=0x9
06-12 00:20:22.382   706   773 E InputDispatcher: channel '6031a90 ai.tetras.tarui_mobile_agdk/android.app.NativeActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
06-12 00:20:22.382   706  3614 I WindowManager: WIN DEATH: Window{6031a90 u0 ai.tetras.tarui_mobile_agdk/android.app.NativeActivity}
06-12 00:20:22.382   706  3641 I ActivityManager: Process ai.tetras.tarui_mobile_agdk (pid 4321) has died: fg  TOP 
06-12 00:20:22.382   706  3614 W InputDispatcher: Attempted to unregister already unregistered input channel '6031a90 ai.tetras.tarui_mobile_agdk/android.app.NativeActivity (server)'
06-12 00:20:22.383   706  2942 W OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
06-12 00:20:22.388   706  4373 W ActivityManager: Ignoring remove of inactive process: ProcessRecord{1f06a56 0:ai.tetras.tarui_mobile_agdk/u0a138}
06-12 00:20:22.388   706  2942 D EGL_emulation: eglCreateContext: 0x707e21d0b140: maj 3 min 1 rcv 4
06-12 00:20:22.389   706   726 W ActivityManager: setHasOverlayUi called on unknown pid: 4321
06-12 00:20:22.395   410   410 I Zygote  : Process 4321 exited due to signal 6 (Aborted)
06-12 00:20:22.401   422   605 D gralloc_ranchu: gralloc_alloc: Creating ashmem region of size 3690496
06-12 00:20:22.415   706  2942 E system_server: open_verbose:32: Could not open '/dev/goldfish_pipe': No such file or directory
06-12 00:20:22.417   422   605 E [email protected]: open_verbose:32: Could not open '/dev/goldfish_pipe': No such file or directory
06-12 00:20:22.418   706  2942 D EGL_emulation: eglMakeCurrent: 0x707e21d0b140: ver 3 1 (tinfo 0x707dc1ce60e0) (first time)
06-12 00:20:22.420   422   605 D gralloc_ranchu: gralloc_alloc: Creating ashmem region of size 3690496
06-12 00:20:22.422   422   605 E [email protected]: open_verbose:32: Could not open '/dev/goldfish_pipe': No such file or directory
06-12 00:20:22.422   422   605 D gralloc_ranchu: gralloc_alloc: Creating ashmem region of size 3690496
06-12 00:20:22.426   706   734 I libprocessgroup: Successfully killed process cgroup uid 10138 pid 4321 in 43ms
06-12 00:20:22.427   422   605 E [email protected]: open_verbose:32: Could not open '/dev/goldfish_pipe': No such file or directory
06-12 00:20:23.516   494   494 I storaged: type=1400 audit(0.0:3368): avc: denied { search } for name="block" dev="sysfs" ino=8805 scontext=u:r:storaged:s0 tcontext=u:object_r:sysfs_devices_block:s0 tclass=dir permissive=1
06-12 00:20:23.516   494   494 I storaged: type=1400 audit(0.0:3369): avc: denied { read } for name="stat" dev="sysfs" ino=8819 scontext=u:r:storaged:s0 tcontext=u:object_r:sysfs_devices_block:s0 tclass=file permissive=1
06-12 00:20:23.516   494   494 I storaged: type=1400 audit(0.0:3370): avc: denied { open } for path="/sys/devices/pci0000:00/0000:00:01.1/ata1/host0/target0:0:0/0:0:0:0/block/sda/stat" dev="sysfs" ino=8819 scontext=u:r:storaged:s0 tcontext=u:object_r:sysfs_devices_block:s0 tclass=file permissive=1
06-12 00:20:23.516   494   494 I storaged: type=1400 audit(0.0:3371): avc: denied { getattr } for path="/sys/devices/pci0000:00/0000:00:01.1/ata1/host0/target0:0:0/0:0:0:0/block/sda/stat" dev="sysfs" ino=8819 scontext=u:r:storaged:s0 tcontext=u:object_r:sysfs_devices_block:s0 tclass=file permissive=1
06-12 00:20:24.696     0     0 W perfetto: disabled ftrace
06-12 00:20:26.825   480   480 I perfetto: probes_producer.cc:329  Producer stop (id=16)
06-12 00:20:26.826   480   480 I perfetto: ftrace_procfs.cc:183    disabled ftrace
06-12 00:20:26.828   481   481 I perfetto: ng_service_impl.cc:1948 Tracing session 16 ended, total sessions:0
06-12 00:20:26.862   489  4315 I iorapd  : Perfetto TraceBuffer saved to file: /data/misc/iorapd/ai.tetras.tarui_mobile_agdk/1/android.app.NativeActivity/raw_traces/1686500426861733718.perfetto_trace.pb
06-12 00:20:54.327     0     0 D logd    : logdr: UID=0 GID=0 PID=4406 n tail=0 logMask=99 pid=0 start=0ns timeout=0ns

cargo mobile init didn't created gradle file ?

Hi,

I went step by step

cargo install  ...taurimobile
cargo mobile init
cargo android run

But I have no gradlew file here, so cargo android run is not working

error: Failed to assemble APK
Command "C:\Users\erikp\Desktop\tauriandroid\tmp\gen\android\test\gradlew.bat --project-dir
C:\Users\erikp\Desktop\tauriandroid\tmp\gen\android\test assembleArm64Debug --warn" didn't complete
successfully, exiting with code 1.

image

Failed to run on android emulator, linking with cc failed.


error: linking with `cc` failed: exit status: 1
  |
  = note: "cc" "-Wl,--version-script=/tmp/rustceeZOPz/list" "/tmp/rustceeZOPz/symbols.o" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/tauri_mobile.15q1xdnggrh9js5o.rcgu.o" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/tauri_mobile.16mdoygis1lesfqd.rcgu.o" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/tauri_mobile.1aas8q3r1v4zf4uy.rcgu.o" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/tauri_mobile.1dug9901wjih8sd0.rcgu.o" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/tauri_mobile.1ei8frx2699mxh8w.rcgu.o" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/tauri_mobile.1mamws1nh29wwbuc.rcgu.o" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/tauri_mobile.1nxhlstogb37m74f.rcgu.o" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/tauri_mobile.1pg748ovnjyr5m7h.rcgu.o" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/tauri_mobile.1qam05nu50vc0o79.rcgu.o" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/tauri_mobile.203lhnzb29xdnxq0.rcgu.o" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/tauri_mobile.2cdf2peickovcui8.rcgu.o" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/tauri_mobile.2edikthbjr4k81w1.rcgu.o" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/tauri_mobile.2fty3gbkekr8zg97.rcgu.o" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/tauri_mobile.2ivr6ywx3qzdl69v.rcgu.o" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/tauri_mobile.2kcr70e2lvkayokc.rcgu.o" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/tauri_mobile.2m2g0wc9dep44ejd.rcgu.o" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/tauri_mobile.2my88hesc8ro4xxv.rcgu.o" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/tauri_mobile.2qrx6dsz1zi15zdj.rcgu.o" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/tauri_mobile.2x1mhshkokf3u2b8.rcgu.o" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/tauri_mobile.2xg18wv181jdovw4.rcgu.o" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/tauri_mobile.31c2vbr59pcjlfxu.rcgu.o" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/tauri_mobile.328i8mac9ysrjvm0.rcgu.o" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/tauri_mobile.33v8s7cvorn3zw21.rcgu.o" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/tauri_mobile.38llzuraidr8cj6k.rcgu.o" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/tauri_mobile.3dsi6anjp77wa4ao.rcgu.o" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/tauri_mobile.3f9sv6x1sfkhj85d.rcgu.o" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/tauri_mobile.3m7n3rqvjxygh7ju.rcgu.o" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/tauri_mobile.3o1umzldxngqaeyb.rcgu.o" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/tauri_mobile.3ouv33c4sstxa94p.rcgu.o" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/tauri_mobile.3vq9oci08chuc7lj.rcgu.o" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/tauri_mobile.3vudlmppqmwrfjcu.rcgu.o" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/tauri_mobile.3yt4o4w8hm53e2z5.rcgu.o" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/tauri_mobile.41xlsz4u8vz215cq.rcgu.o" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/tauri_mobile.46bb25yaf4loewj2.rcgu.o" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/tauri_mobile.47kzdspaitt0y5vg.rcgu.o" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/tauri_mobile.4a5yzkmr1ao7crh2.rcgu.o" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/tauri_mobile.4axn8gale2whzp5p.rcgu.o" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/tauri_mobile.4cw9s1589jwcaev7.rcgu.o" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/tauri_mobile.4dexzcqkm7ozz5rf.rcgu.o" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/tauri_mobile.4dm6pa6cf08ra7b.rcgu.o" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/tauri_mobile.4fzf3ikh3ow0acab.rcgu.o" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/tauri_mobile.4m8jpfr1j0y1lu5u.rcgu.o" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/tauri_mobile.4thl9wxfhfti4cdm.rcgu.o" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/tauri_mobile.5esfaeir0rn1mkck.rcgu.o" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/tauri_mobile.jkdtr70s87iz4l4.rcgu.o" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/tauri_mobile.ku2zysmmy49sng0.rcgu.o" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/tauri_mobile.n7c9z1lxrj6p6qg.rcgu.o" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/tauri_mobile.otjpvpm19kbzi98.rcgu.o" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/tauri_mobile.q6r45gwibsppast.rcgu.o" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/tauri_mobile.qdm6wvqkv9i3od6.rcgu.o" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/tauri_mobile.s4ixik4qd9n3mxh.rcgu.o" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/tauri_mobile.tp55xovcmbdv6mf.rcgu.o" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/tauri_mobile.9yf0n1zscc11ucf.rcgu.o" "-Wl,--as-needed" "-L" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps" "-L" "/Users/r/Desktop/projects/tauri-mobile/target/debug/deps" "-L" "/Users/r/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-linux-android/lib" "-Wl,-Bstatic" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/libandroid_logger-b5505ceab106c185.rlib" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/libenv_logger-0ae816d49fe730ad.rlib" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/libregex-0a0579982ca20c46.rlib" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/libaho_corasick-fb1745b545201357.rlib" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/libregex_syntax-6ff834b1dfa70250.rlib" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/libandroid_log_sys-d5c8487045cb17ce.rlib" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/libwry-facc1904a48c77a0.rlib" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/libbase64-5d6cebe24616a254.rlib" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/libsha2-63f432523767d18c.rlib" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/libdigest-63b7f5f690119ea7.rlib" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/libblock_buffer-76ba8d60b5d18f08.rlib" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/libcrypto_common-8ea9bffe458d8a10.rlib" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/libgeneric_array-4e6f7285b8e9d3de.rlib" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/libtypenum-81c25c3f9f534858.rlib" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/libkuchiki-516699ea0ee88b91.rlib" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/libselectors-0d341de1d234ecfb.rlib" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/libthin_slice-7151a395aeb8d4de.rlib" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/libservo_arc-028e2efbdc12d56d.rlib" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/libstable_deref_trait-82ddb7f8a1674c15.rlib" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/libnodrop-f4998cc7f0eaf0b9.rlib" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/libfxhash-c9d7bc71b0ca696f.rlib" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/libbyteorder-c2237a0781d8cc59.rlib" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/libcssparser-c187ae240b863c35.rlib" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/libitoa-baa1c4879afac0b8.rlib" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/libdtoa_short-a0cf303b2c948891.rlib" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/libdtoa-d9a8917f531e9f87.rlib" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/libmatches-ba36f78b47642f31.rlib" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/libhtml5ever-8f30f730088d125a.rlib" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/libmarkup5ever-d2a32d980a85d477.rlib" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/libstring_cache-5e251f678bf22106.rlib" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/libprecomputed_hash-3ed5ece5e9f54a7b.rlib" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/libphf_shared-6a3c4d0bc2a03ce7.rlib" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/libparking_lot-bc1134733b6fa210.rlib" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/libparking_lot_core-b2eda92a084c0390.rlib" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/libsmallvec-75e1687f43b00fd0.rlib" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/liblock_api-5200d01707be97da.rlib" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/libscopeguard-14afc4f8813f03cd.rlib" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/libphf-7d7cdbe7f716c2ae.rlib" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/libphf_shared-aba4fd5ddb7d02d1.rlib" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/libsiphasher-4f5e3d5090065c3b.rlib" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/libtendril-a9c177d048b51934.rlib" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/libutf8-2bfd7ebdb562e85f.rlib" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/libfutf-dd268696b19fb0a9.rlib" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/libdebug_unreachable-e8fa000898bba615.rlib" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/libmac-62ff71d93b8df5c7.rlib" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/libcrossbeam_channel-28c5a06a830d3a30.rlib" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/libcrossbeam_utils-daffa5c8476ced78.rlib" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/libhttp-9440dc089bdc2192.rlib" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/libfnv-45a9d674e28a24ef.rlib" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/libtao-b95493d90655990d.rlib" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/libndk_context-cd0853d670441006.rlib" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/liblibc-621165966a748957.rlib" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/libonce_cell-b1de1540bef9a853.rlib" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/libjni-0ebdbb9264a927c4.rlib" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/libcesu8-f73b2b06913e17ab.rlib" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/libcombine-e6ff6be9a69a344f.rlib" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/libmemchr-b7aa9c4a153bde1c.rlib" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/libbytes-56eccd572d4bbf47.rlib" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/libndk-bd101bf119074228.rlib" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/libndk_sys-9d0dc8b02829c73e.rlib" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/libjni_sys-595ddf81ba61e25c.rlib" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/libnum_enum-bb76b77a3e25e017.rlib" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/libraw_window_handle-eda0533bc9da4ffb.rlib" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/libinstant-05e219e18790e0ca.rlib" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/libbitflags-b46b0bbd28df5557.rlib" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/liblazy_static-42068b8755250741.rlib" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/liburl-d5b0014d9415085c.rlib" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/libidna-a7ade363800d0f91.rlib" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/libunicode_normalization-a3e43e3810d9fe12.rlib" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/libtinyvec-467d079993162cf5.rlib" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/libtinyvec_macros-9c4db2b2c24237ba.rlib" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/libunicode_bidi-bcc01b962d5d9c63.rlib" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/libform_urlencoded-4036d02e57479a0e.rlib" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/libpercent_encoding-c9c4fcc45a728db6.rlib" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/libserde_json-3b9bf5d7e14636bf.rlib" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/libryu-2a8f20530e1ebf98.rlib" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/libitoa-a4d490a9395b55dd.rlib" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/libthiserror-dde673aa1df3bea1.rlib" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/libserde-0f305a9d31235ca2.rlib" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/libanyhow-320cff63d54fab2c.rlib" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/liblog-cf48e0d9f01970d3.rlib" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/libcfg_if-2ce1dc82cc6e261b.rlib" "/Users/r/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-linux-android/lib/libstd-836aa825e952fb4d.rlib" "/Users/r/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-linux-android/lib/libpanic_unwind-7974078da156c70e.rlib" "/Users/r/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-linux-android/lib/libobject-280f36369587709d.rlib" "/Users/r/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-linux-android/lib/libmemchr-1c42f883482b22e2.rlib" "/Users/r/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-linux-android/lib/libaddr2line-9f90386a9bd74f11.rlib" "/Users/r/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-linux-android/lib/libgimli-7ad41c57dc967d7e.rlib" "/Users/r/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-linux-android/lib/librustc_demangle-17d65a8756292a3a.rlib" "/Users/r/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-linux-android/lib/libstd_detect-4c2968c54456d8b9.rlib" "/Users/r/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-linux-android/lib/libhashbrown-c37de69224549d4d.rlib" "/Users/r/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-linux-android/lib/libminiz_oxide-6cbad0d4d5516633.rlib" "/Users/r/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-linux-android/lib/libadler-d065f80daad00afd.rlib" "/Users/r/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-linux-android/lib/librustc_std_workspace_alloc-ad388382bb396f15.rlib" "/Users/r/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-linux-android/lib/libunwind-9c9b3d96363ab23e.rlib" "/Users/r/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-linux-android/lib/libcfg_if-3a2d32e4cfda71d6.rlib" "/Users/r/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-linux-android/lib/liblibc-64d16db683fa9f30.rlib" "/Users/r/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-linux-android/lib/liballoc-104a9562377a1486.rlib" "/Users/r/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-linux-android/lib/librustc_std_workspace_core-ed9a701e38dc6d7b.rlib" "/Users/r/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-linux-android/lib/libcore-3da6e6e8c6106424.rlib" "/Users/r/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-linux-android/lib/libcompiler_builtins-60bcd280e935af09.rlib" "-Wl,-Bdynamic" "-llog" "-landroid" "-ldl" "-llog" "-lgcc" "-ldl" "-lm" "-lc" "-Wl,--eh-frame-hdr" "-Wl,-znoexecstack" "-L" "/Users/r/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/aarch64-linux-android/lib" "-o" "/Users/r/Desktop/projects/tauri-mobile/target/aarch64-linux-android/debug/deps/libtauri_mobile.so" "-Wl,--gc-sections" "-shared" "-Wl,-zrelro,-znow" "-nodefaultlibs"
  = note: ld: unknown option: --version-script=/tmp/rustceeZOPz/list
          clang: error: linker command failed with exit code 1 (use -v to see invocation)



warning: `tauri-mobile` (lib) generated 4 warnings
error: could not compile `tauri-mobile` due to previous error; 4 warnings emitted
error: Failed to compile lib
    `Failed to run `cargo build`: Command "cargo build --package tauri-mobile --manifest-path /Users/r/Desktop/projects/tauri-mobile/Cargo.toml --target aarch64-linux-android --color
    always" didn't complete successfully, exiting with code 101.

release builds don't work?

Are tauri-mobile release builds supported atm? I have built a small sample app, with I think a rather basic configuration.

  • cart tauri android build --debug DOES create a valid apk, that runs on my phone
  • cargo tauri android dev also works as expected.

Running cargo tauri android build successfully creates an .apk, but when I try to install it in my phone, it gives an error:

Screenshot_20230112-125921

Never worked with Android apps before, so there might be some kind of gotcha I'm missing, like if I have to sign a release app or something to run it, but the error of "package appears to be invalid" just seemed odd to me.

There is more information on the dev setup process I used in the sample app readme.

Edit: Oh hmmm I just remembered that the phone I'm running on is a Pixel 5a running CalyxOS. So maybe that has something to do with it? I can try making an emulator work. I just got confused because the debug build worked, and I'm not sure what is different there.

Build had some warnings, but it did complete:

Execution optimizations have been disabled for task ':app:buildKotlinToolingMetadata' to ensure correctness due to the following reasons:
  - Gradle detected a problem with the following location: '/Users/ben/Desktop/tauri-deno-mobile-sample/src-tauri/gen/android/app/app/build/kotlinToolingMetadata'. Reason: Task ':app:rustBuildArm64Release' uses this output of task ':app:buildKotlinToolingMetadata' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.4/userguide/validation_problems.html#implicit_dependency for more details about this problem.
  - Gradle detected a problem with the following location: '/Users/ben/Desktop/tauri-deno-mobile-sample/src-tauri/gen/android/app/app/build/kotlinToolingMetadata'. Reason: Task ':app:rustBuildArmRelease' uses this output of task ':app:buildKotlinToolingMetadata' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.4/userguide/validation_problems.html#implicit_dependency for more details about this problem.
  - Gradle detected a problem with the following location: '/Users/ben/Desktop/tauri-deno-mobile-sample/src-tauri/gen/android/app/app/build/kotlinToolingMetadata'. Reason: Task ':app:rustBuildX86Release' uses this output of task ':app:buildKotlinToolingMetadata' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.4/userguide/validation_problems.html#implicit_dependency for more details about this problem.
  - Gradle detected a problem with the following location: '/Users/ben/Desktop/tauri-deno-mobile-sample/src-tauri/gen/android/app/app/build/kotlinToolingMetadata'. Reason: Task ':app:rustBuildX86_64Release' uses this output of task ':app:buildKotlinToolingMetadata' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.4/userguide/validation_problems.html#implicit_dependency for more details about this problem.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.4/userguide/command_line_interface.html#sec:command_line_warnings

Execution optimizations have been disabled for 1 invalid unit(s) of work during this build to ensure correctness.
Please consult deprecation warnings for more details.
    Finished 1 APK at:
        /Users/ben/Desktop/tauri-deno-mobile-sample/src-tauri/gen/android/app/app/build/outputs/apk/universal/release/app-universal-release-unsigned.apk

    Finished 1 AAB at:
        /Users/ben/Desktop/tauri-deno-mobile-sample/src-tauri/gen/android/app/app/build/outputs/bundle/universalRelease/app-universal-release.aab

Cargo mobile init appears to be stuck in iOS toolchain installation step

Hi,

my plan was to try out the example app for iOS. I followed the instructions in the readme.

The first try of tauri mobile init failed due to missing XCode (I recently updated to MacOS 13.3 which apparently rendered the old XCode version unusable). After updating XCode I tried it again, but now it is stuck at

malte@mm tauri-mobile-test % cargo mobile init     
Generating base project...
Installing iOS toolchains...
info: component 'rust-std' for target 'aarch64-apple-ios' is up to date
info: component 'rust-std' for target 'aarch64-apple-ios-sim' is up to date
info: component 'rust-std' for target 'x86_64-apple-ios' is up to date

When running cargo mobile doctor I get the following:

malte@mm tauri-mobile-test % cargo mobile doctor

[✔] cargo-mobile v0.3.0
    • Contains commits up to "Publish New Versions (#123)"
    • Installed at "~/.tauri-mobile"
    • macOS v13.3 (22E252)
    • rustc v1.68.2 (9eb3afe9e 2023-3-27)

[!] Apple developer tools
    • Xcode v14.3
    • Active developer dir: "/Applications/Xcode.app/Contents/Developer"
    • ios-deploy v1.12.1
    • XcodeGen v2.34.0
    ✗ xcode-rust-plugin plugin absent
    ✗ xcode-rust-plugin lang spec absent
    ✗ xcode-rust-plugin lang metadata absent
    ✗ xcode-rust-plugin is outdated
    ✗ Failed to check xcode-rust-plugin UUID status: Failed to read plist at
      "/Users/malte/.tauri-mobile/checkouts/rust-xcode-plugin/Plug-ins/Rust.ideplugin/Contents/Info.plist": No such file or directory (os error 2)

[!] Android developer tools
    ✗ Have you installed the Android SDK? The `ANDROID_HOME` environment variable isn't set, and is required: environment variable not found

[✔] Connected devices
    • No connected devices were found

I tried to fix the dev tools problems by manually cloning xcode-rust-plugin and copying the files to the XCode folders, but cargo mobile init still does not go further than before.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • chore(deps): update rust crate dunce to v1.0.5
  • chore(deps): update rust crate embed-resource to v2.4.3
  • fix(deps): update rust crate env_logger to v0.11.5
  • fix(deps): update rust crate which to v6.0.2
  • fix(deps): update rust crate core-foundation to 0.10
  • chore(deps): update actions/checkout action to v4
  • 🔐 Create all rate-limited PRs at once 🔐

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

cargo
Cargo.toml
  • handlebars 6.0
  • serde_json 1.0
  • colored 2.1
  • deunicode 1.4
  • dunce 1.0
  • english-numbers 0.3
  • env_logger 0.11
  • heck 0.5
  • home 0.5
  • ignore 0.4
  • java-properties 2.0
  • log 0.4
  • once-cell-regex 0.2
  • path_abs 0.5
  • serde 1.0
  • structopt 0.3
  • textwrap 0.16
  • thiserror 1.0
  • toml 0.8
  • duct 0.13
  • which 6.0
  • os_pipe 1
  • rstest 0.19
  • home 0.5
  • dunce 1.0
  • handlebars 6.0
  • log 0.4
  • serde 1.0
  • serde_json 1.0
  • thiserror 1.0
  • core-foundation 0.9
  • x509-certificate 0.23
  • os_info 3
  • ureq 2.9
  • freedesktop_entry_parser 1.3
  • libc 0.2
  • windows 0.57
  • embed-resource 2.4
github-actions
.github/workflows/ci.yml
  • actions/checkout v2
  • hecrj/setup-rust-action v1
  • actions/checkout v2
  • hecrj/setup-rust-action v1
.github/workflows/covector-status.yml
  • actions/checkout v2
.github/workflows/covector-version-or-publish.yml
  • actions/checkout v2
  • tauri-apps/create-pull-request v3
.github/workflows/ignore.yml
gradle-wrapper
templates/platforms/android-studio/gradle/wrapper/gradle-wrapper.properties
  • gradle 8.7

  • Check this box to trigger a request for Renovate to run again on this repository

Cannot find system openSSL libs

The dev server does not run and also it does not detect OPENSSL_ environment variables. I tried at first without the OPENSSL_ environmental variable but I get the exact same error. I tried setting the variables as from searching the issue online, I thought it might help.

I use arch and my terminal is fish.

set -gx OPENSSL_LIB_DIR /usr/lib/openssl-1.1/
set -gx OPENSSL_INCLUDE_DIR /usr/include/openssl-1.1/
cargo tauri android dev

Output:

Running BeforeDevCommand (`pnpm dev`)

> [email protected] dev /home/john/Desktop/tauri_mobile
> vite dev

Warn Waiting for your frontend dev server to start on http://localhost:1420/...


VITE v3.2.4  ready in 3266 ms

➜  Local:   http://localhost:1420/
➜  Network: use --host to expose
Info detected host target triple "x86_64-unknown-linux-gnu"
Detected connected device: realme 9 Pro+ (RMX3392) with target "aarch64-linux-android"
<-------------> 0% EXECUTING [2s]
Compiling openssl-sys v0.9.77]
Compiling num_enum_derive v0.5.7on 1/100
Compiling crossbeam-utils v0.8.14
error: failed to run custom build command for `openssl-sys v0.9.77`

Caused by:
process didn't exit successfully: `/home/john/Desktop/tauri_mobile/src-tauri/target/debug/build/openssl-sys-ea23160e4c72873c/build-script-main` (exit status: 101)
--- stdout
cargo:rustc-cfg=const_fn
cargo:rustc-cfg=openssl
cargo:rerun-if-env-changed=AARCH64_LINUX_ANDROID_OPENSSL_LIB_DIR
AARCH64_LINUX_ANDROID_OPENSSL_LIB_DIR unset
cargo:rerun-if-env-changed=OPENSSL_LIB_DIR
OPENSSL_LIB_DIR unset
cargo:rerun-if-env-changed=AARCH64_LINUX_ANDROID_OPENSSL_INCLUDE_DIR
AARCH64_LINUX_ANDROID_OPENSSL_INCLUDE_DIR unset
cargo:rerun-if-env-changed=OPENSSL_INCLUDE_DIR
OPENSSL_INCLUDE_DIR unset
cargo:rerun-if-env-changed=AARCH64_LINUX_ANDROID_OPENSSL_DIR
AARCH64_LINUX_ANDROID_OPENSSL_DIR unset
cargo:rerun-if-env-changed=OPENSSL_DIR
OPENSSL_DIR unset
cargo:rerun-if-env-changed=OPENSSL_NO_PKG_CONFIG
cargo:rerun-if-env-changed=PKG_CONFIG_ALLOW_CROSS_aarch64-linux-android
cargo:rerun-if-env-changed=PKG_CONFIG_ALLOW_CROSS_aarch64_linux_android
cargo:rerun-if-env-changed=TARGET_PKG_CONFIG_ALLOW_CROSS
cargo:rerun-if-env-changed=PKG_CONFIG_ALLOW_CROSS
cargo:rerun-if-env-changed=PKG_CONFIG_aarch64-linux-android
cargo:rerun-if-env-changed=PKG_CONFIG_aarch64_linux_android
cargo:rerun-if-env-changed=TARGET_PKG_CONFIG
cargo:rerun-if-env-changed=PKG_CONFIG
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_aarch64-linux-android
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_aarch64_linux_android
cargo:rerun-if-env-changed=TARGET_PKG_CONFIG_SYSROOT_DIR
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
run pkg_config fail: "pkg-config has not been configured to support cross-compilation.\n\nInstall a sysroot for the target platform and configure it via\nPKG_CONFIG_SYSROOT_DIR and PKG_CONFIG_PATH, or install a\ncross-compiling wrapper for pkg-config and set it via\nPKG_CONFIG environment variable."

--- stderr
thread 'main' panicked at '

Could not find directory of OpenSSL installation, and this `-sys` crate cannot
proceed without this knowledge. If OpenSSL is installed and this crate had
trouble finding it,  you can set the `OPENSSL_DIR` environment variable for the
compilation process.

Make sure you also have the development packages of openssl installed.
For example, `libssl-dev` on Ubuntu or `openssl-devel` on Fedora.

If you're in a situation where you think the directory *should* be found
automatically, please open a bug at https://github.com/sfackler/rust-openssl
and include information about your system as well as this message.

$HOST = x86_64-unknown-linux-gnu
$TARGET = aarch64-linux-android
openssl-sys = 0.9.77

', /home/john/.cargo/registry/src/github.com-1ecc6299db9ec823/openssl-sys-0.9.77/build/find_normal.rs:191:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
Error `Failed to run `cargo build`: Command "cargo build --package tauri_mobile --manifest-path /home/john/Desktop/tauri_mobile/src-tauri/Cargo.toml --target aarch64-linux-android --no-default-features --color always" didn't complete successfully, exiting with code 101.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:rustBuildArm64Debug'.
> Process 'command '/home/john/.cargo/bin/cargo-tauri'' finished with non-zero exit value 1

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 13s
Error Failed to assemble APK: Command "/home/john/Desktop/tauri_mobile/src-tauri/gen/android/tauri_mobile/gradlew --project-dir /home/john/Desktop/tauri_mobile/src-tauri/gen/android/tauri_mobile assembleArm64Debug--warn" didn't complete successfully, exiting with code 1.

Copying libraries but still not found

I'm fixing a bunch of library not found errors by copying built *.a library files to random parts of my project.

So far so good, but then if I try to run the wry app on my phone (using Xcode), I still get:

dyld[439]: Library not loaded: /private/tmp/testwry/target/aarch64-apple-ios/debug/deps/libtestwry.dylib
  Referenced from: <6B1311CB-F640-32A4-84C7-92F59DC94295> /private/var/containers/Bundle/Application/768CEA02-A4FB-4DDD-AB3D-BAF1290CA975/testwry.app/testwry
  Reason: tried: '/usr/lib/system/introspection/libtestwry.dylib' (errno=2, not in dyld cache), '/private/tmp/testwry/target/aarch64-apple-ios/debug/deps/libtestwry.dylib' (errno=2), '/private/preboot/Cryptexes/OS/private/tmp/testwry/target/aarch64-apple-ios/debug/deps/libtestwry.dylib' (errno=2), '/private/tmp/testwry/target/aarch64-apple-ios/debug/deps/libtestwry.dylib' (errno=2), '/usr/local/lib/libtestwry.dylib' (errno=2), '/usr/lib/libtestwry.dylib' (errno=2, not in dyld cache)
Library not loaded: /private/tmp/testwry/target/aarch64-apple-ios/debug/deps/libtestwry.dylib
  Referenced from: <6B1311CB-F640-32A4-84C7-92F59DC94295> /private/var/containers/Bundle/Application/768CEA02-A4FB-4DDD-AB3D-BAF1290CA975/testwry.app/testwry
  Reason: tried: '/usr/lib/system/introspection/libtestwry.dylib' (errno=2, not in dyld cache), '/private/tmp/testwry/target/aarch64-apple-ios/debug/deps/libtestwry.dylib' (errno=2), '/private/preboot/Cryptexes/OS/private/tmp/testwry/target/aarch64-apple-ios/debug/deps/libtestwry.dylib' (errno=2), '/private/tmp/testwry/target/aarch64-apple-ios/debug/deps/libtestwry.dylib' (errno=2), '/usr/local/lib/libtestwry.dylib' (errno=2), '/usr/lib/libtestwry.dylib' (errno=2, not in dyld cache)
dyld config: DYLD_LIBRARY_PATH=/usr/lib/system/introspection DYLD_INSERT_LIBRARIES=/usr/lib/libBacktraceRecording.dylib:/usr/lib/libMainThreadChecker.dylib:/usr/lib/libRPAC.dylib:/Developer/Library/PrivateFrameworks/DTDDISupport.framework/libViewDebuggerSupport.dylib

Android release builds not working

Got the following error after installing the release apk:

adb logcat

2023-04-08 17:31:36.756 19837-19837 AndroidRuntime          pid-19837                            E  FATAL EXCEPTION: main
                                                                                                    Process: com.flysoft.stock, PID: 19837
                                                                                                    java.lang.NoSuchMethodError: no non-static method "Lcom/flysoft/stock/RustWebView;.setAutoPlay(Z)V"
                                                                                                    	at android.os.MessageQueue.nativePollOnce(Native Method)
                                                                                                    	at android.os.MessageQueue.next(MessageQueue.java:335)
                                                                                                    	at android.os.Looper.loopOnce(Looper.java:162)
                                                                                                    	at android.os.Looper.loop(Looper.java:294)
                                                                                                    	at android.app.ActivityThread.main(ActivityThread.java:8128)
                                                                                                    	at java.lang.reflect.Method.invoke(Native Method)
                                                                                                    	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:578)
                                                                                                    	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:946)

The setAutoPlay method is exist:
image

iOS - Any example is closed immediately after the install

Describe the bug
Hello, I tried something simple with all the templates:

mkdir my_dor
cargo mobile init
cargo apple run

This succeded but then, after the installation and the launch, the app is closed without rendering:

[100%] Installed package /Users/nazariglez/personal/mobile_test4/gen/apple/build/Payload/mobile-test4.app
------ Debug phase ------
Starting debug of 2600fae624d1da23d210fd58bf51efbf247c4614 (J98aAP, iPad Pro (12.9"), iphoneos, arm64, 16.4.1, 20E252) a.k.a. 'Nazarí’s iPad' connected through USB...
[  0%] Looking up developer disk image
[ 95%] Developer disk image mounted successfully
Symbol Path: /Users/nazariglez/Library/Developer/Xcode/iOS DeviceSupport/16.4.1 (20E252)/Symbols
[100%] Connecting to remote debug server
-------------------------
(lldb) command source -s 0 '/tmp/6E31D58B-1EDD-4BF2-95AF-D0469ECDC04F/fruitstrap-lldb-prep-cmds-2600fae624d1da23d210fd58bf51efbf247c4614'
Executing commands in '/tmp/6E31D58B-1EDD-4BF2-95AF-D0469ECDC04F/fruitstrap-lldb-prep-cmds-2600fae624d1da23d210fd58bf51efbf247c4614'.
(lldb)     platform select remote-'ios' --sysroot '/Users/nazariglez/Library/Developer/Xcode/iOS DeviceSupport/16.4.1 (20E252)/Symbols'
  Platform: remote-ios
 Connected: no
   Sysroot: /Users/nazariglez/Library/Developer/Xcode/iOS DeviceSupport/16.4.1 (20E252)/Symbols
  SDK Path: "/Users/nazariglez/Library/Developer/Xcode/iOS DeviceSupport/16.4.1 (20E252)/Symbols"
(lldb)     target create "/Users/nazariglez/personal/mobile_test4/gen/apple/build/Payload/mobile-test4.app"
Current executable set to '/Users/nazariglez/personal/mobile_test4/gen/apple/build/Payload/mobile-test4.app' (arm64).
(lldb)     script fruitstrap_device_app="/private/var/containers/Bundle/Application/84D35CB8-6BB1-4DC2-93A9-CC7DABD27ECC/mobile-test4.app"
(lldb)     script fruitstrap_connect_url="connect://127.0.0.1:50734"
(lldb)     script fruitstrap_output_path=""
(lldb)     script fruitstrap_error_path=""
(lldb)     target modules search-paths add /usr "/Users/nazariglez/Library/Developer/Xcode/iOS DeviceSupport/16.4.1 (20E252)/Symbols/usr" /System "/Users/nazariglez/Library/Developer/Xcode/iOS DeviceSupport/16.4.1 (20E252)/Symbols/System" "/private/var/containers/Bundle/Application/84D35CB8-6BB1-4DC2-93A9-CC7DABD27ECC" "/Users/nazariglez/personal/mobile_test4/gen/apple/build/Payload" "/var/containers/Bundle/Application/84D35CB8-6BB1-4DC2-93A9-CC7DABD27ECC" "/Users/nazariglez/personal/mobile_test4/gen/apple/build/Payload" /Developer "/Users/nazariglez/Library/Developer/Xcode/iOS DeviceSupport/16.4.1 (20E252)/Symbols/Developer"
(lldb)     command script import "/tmp/6E31D58B-1EDD-4BF2-95AF-D0469ECDC04F/fruitstrap_2600fae624d1da23d210fd58bf51efbf247c4614.py"
(lldb)     command script add -f fruitstrap_2600fae624d1da23d210fd58bf51efbf247c4614.connect_command connect
(lldb)     command script add -s asynchronous -f fruitstrap_2600fae624d1da23d210fd58bf51efbf247c4614.run_command run
(lldb)     command script add -s asynchronous -f fruitstrap_2600fae624d1da23d210fd58bf51efbf247c4614.autoexit_command autoexit
(lldb)     command script add -s asynchronous -f fruitstrap_2600fae624d1da23d210fd58bf51efbf247c4614.safequit_command safequit
(lldb)     connect
(lldb)     run
success
(lldb)     safequit
Process 1432 detached
[connected]

If I try to do cargo apple open and try to build from there, then Command PhaseScriptExecution failed with a nonzero exit code.

Platform and Versions (please complete the following information):
Host OS: MacOS Ventura 13.3.1 (a)
Target OS: iOS 16.4.1
Rustc: rustc 1.71.0 (8ede3aae2 2023-07-12)
cargo mobile doctor:

[✔] cargo-mobile v0.5.1
    • Contains commits up to "fix(linux): fix command detection (#174)\n"
    • Installed at "~/.cargo/.tauri-mobile"
    • macOS v13.3.1 (a) (22E772610a)
    • rustc v1.71.0 (8ede3aae2 2023-7-12)

[✔] Apple developer tools
    • Xcode v14.3
    • Active developer dir: "/Applications/Xcode.app/Contents/Developer"
    • ios-deploy v1.12.2
    • XcodeGen v2.35.0
    • xcode-rust-plugin plugin present
    ✗ xcode-rust-plugin lang spec absent
    ✗ xcode-rust-plugin lang metadata absent
    • xcode-rust-plugin is up-to-date
    ✗ xcode-rust-plugin doesn't support Xcode UUID "EA3EACC9-A0BE-423D-9BA3-AA8B9FE68E38"
    • Development team: Hopscotch Technologies (839GE64MX3)
    • Development team: NAZARI GONZALEZ (DJQBHZ4AR9)
[2023-07-19T16:54:39Z WARN  tauri_mobile::android::env] `ANDROID_HOME` isn't set; falling back to `ANDROID_SDK_ROOT`, which is deprecated

[✔] Android developer tools
    • SDK v26.1.1 installed at "~/Library/Android/sdk"
    • NDK v22.1.7171670 installed at "~/Library/Android/sdk/ndk-bundle"
[2023-07-19T16:54:40Z WARN  tauri_mobile::android::env] `ANDROID_HOME` isn't set; falling back to `ANDROID_SDK_ROOT`, which is deprecated

[✔] Connected devices
    • Nazarí’s iPad (iPad Pro (12.9"))

Any hint on how to resolve it? I am sure that it must be something silly.

Would you want to assign yourself to resolve this bug?

  • Yes
  • No

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.