Skip to content

egui android template doesn't start because of outdated android-activity #456

@0x53A

Description

@0x53A

Describe the bug
The template app doesn't start on my android device but crashes immediately with an error.

Steps To Reproduce

cargo install --git https://github.com/tauri-apps/cargo-mobile2
cargo mobile init (Enter, Enter, "com.x53a.my_test_project", 3)
cargo android run

Expected behavior

The app launches

Screenshots

Platform and Versions (please complete the following information):
Host OS: Win 11 x64 22H2
Target OS: Lineage OS 22.1 on Xiaomi Mi 9 Lite (CC 9)
Rustc:

>rustc --version -v
rustc 1.88.0-nightly (df35ff6c3 2025-04-23)
binary: rustc
commit-hash: df35ff6c354f1f1fbf430b84e7dea37dfe997f34
commit-date: 2025-04-23
host: x86_64-pc-windows-msvc
release: 1.88.0-nightly
LLVM version: 20.1.2

Ouput of cargo mobile doctor:

>cargo mobile doctor

[✔] cargo-mobile v0.20.0
    • Contains commits up to "publish new versions (#454)\n"
    • Installed at "C:\\Users\\Lukas\\.cargo\\.cargo-mobile2"
    • Windows 11 v10.0
    • rustc v1.88.0-nightly (df35ff6c3 2025-4-23)

[✔] Android developer tools
    • SDK v35.0.2 installed at "C:\\Users\\Lukas\\AppData\\Local\\Android\\Sdk"
    • NDK v29.0.13113456-beta1 installed at "C:\\Users\\Lukas\\AppData\\Local\\Android\\Sdk\\ndk\\29.0.13113456"

[✔] Connected devices
 (Mi 9 Lite) Mi 9 Lite

Additional context

> cargo android run
 (Mi 9 Lite) with target "aarch64-linux-android"
w: file:///R:/mobile_tmp/my_test_project/gen/android/buildSrc/src/main/kotlin/BuildTask.kt:22:17 'exec(Action<in ExecSpec!>): ExecResult' is deprecated. Deprecated in Java
WARNING: We recommend using a newer Android Gradle plugin to use compileSdk = 34

This Android Gradle plugin (8.0.0) was tested up to compileSdk = 33.

You are strongly encouraged to update your project to use a newer
Android Gradle plugin that has been tested with compileSdk = 34.

If you are already using the latest version of the Android Gradle plugin,
you may need to wait until a newer version with support for compileSdk = 34 is available.

To suppress this warning, add/update
    android.suppressUnsupportedCompileSdk=34
to this project's gradle.properties.
    Updating crates.io indexG [18s]
     Locking 241 packages to latest compatible versions
      Adding android_logger v0.13.3 (available: v0.15.0)
      Adding block-sys v0.1.0-beta.1 (available: v0.1.0-beta.2)
      Adding block2 v0.2.0-alpha.6 (available: v0.2.0)
[...]
   Compiling egui-wgpu v0.22.0[2m 10s]
   Compiling my-test-project v0.1.0 (R:\mobile_tmp\my_test_project)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 2m 13s
warning: [options] source value 8 is obsolete and will be removed in a future release
warning: [options] target value 8 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
3 warnings

[Incubating] Problems report is available at: file:///R:/mobile_tmp/my_test_project/gen/android/build/reports/problems/problems-report.html

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

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

For more on this, please refer to https://docs.gradle.org/8.12.1/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.
Performing Streamed Install
Success
Starting: Intent { cmp=com.x53a.my_test_project/android.app.NativeActivity }

(After the last line, the app starts and immediatly crashes and closes. There are no errors in the console window)

Using Android Studio and Logcat, i got the following logs from starting the app:

2025-04-25 02:32:53.165  1679-2155  SplashScre...eptionList system_server                        V  SplashScreen checking exception for package com.x53a.my_test_project (target sdk:34) -> false
2025-04-25 02:32:53.170  1679-2155  ActivityTaskManager     system_server                        I  START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.x53a.my_test_project/android.app.NativeActivity bnds=[644,1235][851,1611]} with LAUNCH_MULTIPLE from uid 10109 (BAL_ALLOW_VISIBLE_WINDOW) result code=0
2025-04-25 02:32:53.170  2328-2356  WindowManagerShell      com.android.systemui                 V  UNKNOWN MESSAGE (319134872409225255) 232 android.os.BinderProxy@ac6ba40 TransitionRequestInfo { type = OPEN, triggerTask = TaskInfo{userId=0 taskId=266 effectiveUid=10019 displayId=0 isRunning=true baseIntent=Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.x53a.my_test_project/android.app.NativeActivity } baseActivity=ComponentInfo{com.x53a.my_test_project/android.app.NativeActivity} topActivity=ComponentInfo{com.x53a.my_test_project/android.app.NativeActivity} origActivity=null realActivity=ComponentInfo{com.x53a.my_test_project/android.app.NativeActivity} numActivities=1 lastActiveTime=93805441 supportsMultiWindow=true resizeMode=1 isResizeable=true minWidth=-1 minHeight=-1 defaultMinSize=220 token=WCT{android.window.IWindowContainerToken$Stub$Proxy@dcfd79} topActivityType=1 pictureInPictureParams=null shouldDockBigOverlays=false launchIntoPipHostTaskId=-1 lastParentTaskIdBeforePip=-1 displayCutoutSafeInsets=Rect(0, 75 - 0, 0) topActivityInfo=ActivityInfo{7e8fabe android.app.NativeActivity} launchCookies=[android.os.BinderProxy@78cd71f] positionInParent=Point(0, 0) parentTaskId=-1 isFocused=false isVisible=false isVisibleRequested=false isSleeping=false locusId=null displayAreaFeatureId=1 isTopActivityTransparent=false isTopActivityStyleFloating=false lastNonFullscreenBounds=Rect(283, 668 - 798, 1748) capturedLink=null capturedLinkTimestamp=0 appCompatTaskInfo=AppCompatTaskInfo { topActivityInSizeCompat=false eligibleForLetterboxEducation= false isLetterboxEducationEnabled= false isLetterboxDoubleTapEnabled= false eligibleForUserAspectRatioButton= false topActivityBoundsLetterboxed= false isFromLetterboxDoubleTap= false topActivityLetterboxVerticalPosition= -1 topActivityLetterboxHorizontalPosition= -1 topActivityLetterboxWidth=1080 topActivityLetterboxHeight=2340 topActivityLetterboxAppWidth=1080 topActivityLetterboxAppHeight=2265 isUserFullscreenOverrideEnabled=false isSystemFullscreenOverrideEnabled=false hasMinAspectRatioOverride=false cameraCompatTaskInfo=CameraCompatTaskInfo { freeformCameraCompatMode=inactive}}}, pipTask = null, remoteTransition = RemoteTransition { remoteTransition = android.window.IRemoteTransition$Stub$Proxy@17d3a6c, appThread = android.app.IApplicationThread$Stub$Proxy@5a6f835, debugName = QuickstepLaunch }, displayChange = null, flags = 0, debugId = 232 }
2025-04-25 02:32:53.191  1679-2095  CoreBackPreview         system_server                        D  Window{e405f57 u0 Splash Screen com.x53a.my_test_project}: Setting back callback OnBackInvokedCallbackInfo{mCallback=android.window.IOnBackInvokedCallback$Stub$Proxy@60199f3, mPriority=0, mIsAnimationCallback=false}
2025-04-25 02:32:53.210  1679-1818  ActivityManager         system_server                        I  Start proc 29719:com.x53a.my_test_project/u0a19 for next-top-activity {com.x53a.my_test_project/android.app.NativeActivity}
2025-04-25 02:32:53.222  1679-1802  WindowManager           system_server                        V  Sent Transition (#232) createdAt=04-25 02:32:53.152 via request=TransitionRequestInfo { type = OPEN, triggerTask = TaskInfo{userId=0 taskId=266 effectiveUid=10019 displayId=0 isRunning=true baseIntent=Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.x53a.my_test_project/android.app.NativeActivity } baseActivity=ComponentInfo{com.x53a.my_test_project/android.app.NativeActivity} topActivity=ComponentInfo{com.x53a.my_test_project/android.app.NativeActivity} origActivity=null realActivity=ComponentInfo{com.x53a.my_test_project/android.app.NativeActivity} numActivities=1 lastActiveTime=93805441 supportsMultiWindow=true resizeMode=1 isResizeable=true minWidth=-1 minHeight=-1 defaultMinSize=220 token=WCT{RemoteToken{d91e24f Task{c44d67b #266 type=standard A=10019:com.x53a.my_test_project isResizeable=true minWidth=-1 minHeight=-1}}} topActivityType=1 pictureInPictureParams=null shouldDockBigOverlays=false launchIntoPipHostTaskId=-1 lastParentTaskIdBeforePip=-1 displayCutoutSafeInsets=Rect(0, 75 - 0, 0) topActivityInfo=ActivityInfo{ad36ee5 android.app.NativeActivity} launchCookies=[android.os.BinderProxy@1ee2dba] positionInParent=Point(0, 0) parentTaskId=-1 isFocused=false isVisible=false isVisibleRequested=false isSleeping=false locusId=null displayAreaFeatureId=1 isTopActivityTransparent=false isTopActivityStyleFloating=false lastNonFullscreenBounds=Rect(283, 668 - 798, 1748) capturedLink=null capturedLinkTimestamp=0 appCompatTaskInfo=AppCompatTaskInfo { topActivityInSizeCompat=false eligibleForLetterboxEducation= false isLetterboxEducationEnabled= false isLetterboxDoubleTapEnabled= false eligibleForUserAspectRatioButton= false topActivityBoundsLetterboxed= false isFromLetterboxDoubleTap= false topActivityLetterboxVerticalPosition= -1 topActivityLetterboxHorizontalPosition= -1 topActivityLetterboxWidth=1080 topActivityLetterboxHeight=2340 topActivityLetterboxAppWidth=1080 topActivityLetterboxAppHeight=2265 isUserFullscreenOverrideEnabled=false isSystemFullscreenOverrideEnabled=false hasMinAspectRatioOverride=false cameraCompatTaskInfo=CameraCompatTaskInfo { freeformCameraCompatMode=inactive}}}, pipTask = null, remoteTransition = RemoteTransition { remoteTransition = android.window.IRemoteTransition$Stub$Proxy@9c2bbc8, appThread = android.app.IApplicationThread$Stub$Proxy@1d11461, debugName = QuickstepLaunch }, displayChange = null, flags = 0, debugId = 232 }
2025-04-25 02:32:53.222  1679-1802  WindowManager           system_server                        V      info={id=232 t=OPEN f=0x0 trk=0 r=[0@Point(0, 0)] c=[
                                                                                                            {WCT{RemoteToken{d91e24f Task{c44d67b #266 type=standard A=10019:com.x53a.my_test_project isResizeable=true minWidth=-1 minHeight=-1}}} m=OPEN f=NONE leash=Surface(name=Task=266)/@0x2e66929 sb=Rect(0, 0 - 1080, 2340) eb=Rect(0, 0 - 1080, 2340) epz=Point(1080, 2340) d=0 taskParent=-1},
                                                                                                            {WCT{RemoteToken{8687e77 Task{3cfb239 #1 type=home isResizeable=true minWidth=-1 minHeight=-1}}} m=TO_BACK f=SHOW_WALLPAPER leash=Surface(name=Task=1)/@0xebb5d6f sb=Rect(0, 0 - 1080, 2340) eb=Rect(0, 0 - 1080, 2340) epz=Point(1080, 2340) d=0 taskParent=-1}
                                                                                                        ]}
2025-04-25 02:32:53.228 29719-29719 my_test_project         pid-29719                            I  Late-enabling -Xcheck:jni
2025-04-25 02:32:53.268 29719-29719 my_test_project         pid-29719                            I  Using CollectorTypeCC GC.
2025-04-25 02:32:53.301  1679-2095  WindowManager           system_server                        V  Binding proc com.x53a.my_test_project with config {1.0 ?mcc0mnc [en_US] ldltr sw393dp w393dp h824dp 440dpi nrml long hdr widecg port night finger -keyb/v/h -nav/h winConfig={ mBounds=Rect(0, 0 - 1080, 2340) mAppBounds=Rect(0, 75 - 1080, 2340) mMaxBounds=Rect(0, 0 - 1080, 2340) mDisplayRotation=ROTATION_0 mWindowingMode=fullscreen mActivityType=undefined mAlwaysOnTop=undefined mRotation=ROTATION_0} as.4 s.44 fontWeightAdjustment=0}
---------------------------- PROCESS STARTED (29719) for package com.x53a.my_test_project ----------------------------
2025-04-25 02:32:53.344 29719-29719 ziparchive              com.x53a.my_test_project             W  Unable to open '/data/app/~~NQr9BYMJCmZ7_x0_IHUQbg==/com.x53a.my_test_project-UokKQ90Qx-idyn-Z9wDUuQ==/base.dm': No such file or directory
2025-04-25 02:32:53.344 29719-29719 ziparchive              com.x53a.my_test_project             W  Unable to open '/data/app/~~NQr9BYMJCmZ7_x0_IHUQbg==/com.x53a.my_test_project-UokKQ90Qx-idyn-Z9wDUuQ==/base.dm': No such file or directory
2025-04-25 02:32:53.510 29719-29719 nativeloader            com.x53a.my_test_project             D  Configuring clns-7 for other apk /data/app/~~NQr9BYMJCmZ7_x0_IHUQbg==/com.x53a.my_test_project-UokKQ90Qx-idyn-Z9wDUuQ==/base.apk. target_sdk_version=34, uses_libraries=, library_path=/data/app/~~NQr9BYMJCmZ7_x0_IHUQbg==/com.x53a.my_test_project-UokKQ90Qx-idyn-Z9wDUuQ==/lib/arm64:/data/app/~~NQr9BYMJCmZ7_x0_IHUQbg==/com.x53a.my_test_project-UokKQ90Qx-idyn-Z9wDUuQ==/base.apk!/lib/arm64-v8a, permitted_path=/data:/mnt/expand:/data/user/0/com.x53a.my_test_project
2025-04-25 02:32:53.524 29719-29719 GraphicsEnvironment     com.x53a.my_test_project             V  Currently set values for:
2025-04-25 02:32:53.524 29719-29719 GraphicsEnvironment     com.x53a.my_test_project             V    angle_gl_driver_selection_pkgs=[]
2025-04-25 02:32:53.524 29719-29719 GraphicsEnvironment     com.x53a.my_test_project             V    angle_gl_driver_selection_values=[]
2025-04-25 02:32:53.524 29719-29719 GraphicsEnvironment     com.x53a.my_test_project             V  Global.Settings values are invalid: number of packages: 0, number of values: 0
2025-04-25 02:32:53.524 29719-29719 GraphicsEnvironment     com.x53a.my_test_project             V  Neither updatable production driver nor prerelease driver is supported.
2025-04-25 02:32:53.553  1679-2155  AppsFilter              system_server                        I  interaction: PackageSetting{9ab6a4f com.x53a.my_test_project/10019} -> PackageSetting{d60c04 com.android.launcher3/10109} BLOCKED
2025-04-25 02:32:53.630 29719-29719 DesktopModeFlagsUtil    com.x53a.my_test_project             D  Toggle override initialized to: OVERRIDE_UNSET
2025-04-25 02:32:53.712 29719-29719 nativeloader            com.x53a.my_test_project             D  Load /data/app/~~NQr9BYMJCmZ7_x0_IHUQbg==/com.x53a.my_test_project-UokKQ90Qx-idyn-Z9wDUuQ==/base.apk!/lib/arm64-v8a/libmy_test_project.so using ns clns-7 from class loader (caller=<unknown>): ok
2025-04-25 02:32:53.713 29719-29741 RustStdoutStderr        com.x53a.my_test_project             I  
2025-04-25 02:32:53.713 29719-29741 RustStdoutStderr        com.x53a.my_test_project             I  thread '<unnamed>' panicked at library/core/src/panicking.rs:218:5:
2025-04-25 02:32:53.713 29719-29741 RustStdoutStderr        com.x53a.my_test_project             I  unsafe precondition(s) violated: slice::from_raw_parts requires the pointer to be aligned and non-null, and the total size of the slice not to exceed `isize::MAX`
2025-04-25 02:32:53.713 29719-29741 RustStdoutStderr        com.x53a.my_test_project             I  
2025-04-25 02:32:53.713 29719-29741 RustStdoutStderr        com.x53a.my_test_project             I  This indicates a bug in the program. This Undefined Behavior check is optional, and cannot be relied on for safety.
2025-04-25 02:32:53.713 29719-29741 RustStdoutStderr        com.x53a.my_test_project             I  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2025-04-25 02:32:53.713 29719-29741 RustStdoutStderr        com.x53a.my_test_project             I  thread caused non-unwinding panic. aborting.
2025-04-25 02:32:53.714 29719-29719 libc                    com.x53a.my_test_project             A  Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 29719 (my_test_project), pid 29719 (my_test_project)
2025-04-25 02:32:54.007 29744-29744 DEBUG                   pid-29744                            A  Cmdline: com.x53a.my_test_project
2025-04-25 02:32:54.007 29744-29744 DEBUG                   pid-29744                            A  pid: 29719, tid: 29719, name: my_test_project  >>> com.x53a.my_test_project <<<
2025-04-25 02:32:54.007 29744-29744 DEBUG                   pid-29744                            A        #01 pc 0000000000e9203c  /data/app/~~NQr9BYMJCmZ7_x0_IHUQbg==/com.x53a.my_test_project-UokKQ90Qx-idyn-Z9wDUuQ==/base.apk (offset 0x39d000) (std::sys::pal::unix::abort_internal::h9403aaa23df550eb+8)
2025-04-25 02:32:54.007 29744-29744 DEBUG                   pid-29744                            A        #02 pc 0000000000e90e44  /data/app/~~NQr9BYMJCmZ7_x0_IHUQbg==/com.x53a.my_test_project-UokKQ90Qx-idyn-Z9wDUuQ==/base.apk (offset 0x39d000) (std::panicking::rust_panic_with_hook::h03bb60ae853908db+284)
2025-04-25 02:32:54.007 29744-29744 DEBUG                   pid-29744                            A        #03 pc 0000000000e90b24  /data/app/~~NQr9BYMJCmZ7_x0_IHUQbg==/com.x53a.my_test_project-UokKQ90Qx-idyn-Z9wDUuQ==/base.apk (offset 0x39d000) (std::panicking::begin_panic_handler::_$u7b$$u7b$closure$u7d$$u7d$::hc418790e45ce9984+92)
2025-04-25 02:32:54.007 29744-29744 DEBUG                   pid-29744                            A        #04 pc 0000000000e8f6b4  /data/app/~~NQr9BYMJCmZ7_x0_IHUQbg==/com.x53a.my_test_project-UokKQ90Qx-idyn-Z9wDUuQ==/base.apk (offset 0x39d000) (std::sys::backtrace::__rust_end_short_backtrace::hf019f8e8cfd75565+8)
2025-04-25 02:32:54.007 29744-29744 DEBUG                   pid-29744                            A        #05 pc 0000000000e907fc  /data/app/~~NQr9BYMJCmZ7_x0_IHUQbg==/com.x53a.my_test_project-UokKQ90Qx-idyn-Z9wDUuQ==/base.apk (offset 0x39d000) (_RNvCslLrv5HjUTzK_7___rustc17rust_begin_unwind+28)
2025-04-25 02:32:54.007 29744-29744 DEBUG                   pid-29744                            A        #06 pc 0000000000eac760  /data/app/~~NQr9BYMJCmZ7_x0_IHUQbg==/com.x53a.my_test_project-UokKQ90Qx-idyn-Z9wDUuQ==/base.apk (offset 0x39d000) (core::panicking::panic_nounwind_fmt::h99ca9bf5d8ccfe70+48)
2025-04-25 02:32:54.007 29744-29744 DEBUG                   pid-29744                            A        #07 pc 0000000000eac7d8  /data/app/~~NQr9BYMJCmZ7_x0_IHUQbg==/com.x53a.my_test_project-UokKQ90Qx-idyn-Z9wDUuQ==/base.apk (offset 0x39d000) (core::panicking::panic_nounwind::hdc76bb15c2bd2d56+56)
2025-04-25 02:32:54.007 29744-29744 DEBUG                   pid-29744                            A        #08 pc 0000000000e6d324  /data/app/~~NQr9BYMJCmZ7_x0_IHUQbg==/com.x53a.my_test_project-UokKQ90Qx-idyn-Z9wDUuQ==/base.apk (offset 0x39d000) (core::slice::raw::from_raw_parts::precondition_check::hd990fdb6150135a7+352)
2025-04-25 02:32:54.007 29744-29744 DEBUG                   pid-29744                            A        #09 pc 0000000000e6d1a8  /data/app/~~NQr9BYMJCmZ7_x0_IHUQbg==/com.x53a.my_test_project-UokKQ90Qx-idyn-Z9wDUuQ==/base.apk (offset 0x39d000) (core::slice::raw::from_raw_parts::h60ba974cc6a0eed3+48)
2025-04-25 02:32:54.007 29744-29744 DEBUG                   pid-29744                            A        #10 pc 0000000000e4c4ac  /data/app/~~NQr9BYMJCmZ7_x0_IHUQbg==/com.x53a.my_test_project-UokKQ90Qx-idyn-Z9wDUuQ==/base.apk (offset 0x39d000) (android_activity::native_activity::glue::WaitableNativeActivityState::new::hdee137d712c3fe25+100)
2025-04-25 02:32:54.007 29744-29744 DEBUG                   pid-29744                            A        #11 pc 0000000000e4ab88  /data/app/~~NQr9BYMJCmZ7_x0_IHUQbg==/com.x53a.my_test_project-UokKQ90Qx-idyn-Z9wDUuQ==/base.apk (offset 0x39d000) (android_activity::native_activity::glue::NativeActivityGlue::new::hb8a2711779ad74b3+40)
2025-04-25 02:32:54.007 29744-29744 DEBUG                   pid-29744                            A        #12 pc 0000000000e54940  /data/app/~~NQr9BYMJCmZ7_x0_IHUQbg==/com.x53a.my_test_project-UokKQ90Qx-idyn-Z9wDUuQ==/base.apk (offset 0x39d000) (android_activity::native_activity::glue::ANativeActivity_onCreate::_$u7b$$u7b$closure$u7d$$u7d$::hddc9dd1946e3bb27+180)
2025-04-25 02:32:54.008 29744-29744 DEBUG                   pid-29744                            A        #13 pc 0000000000e5f7bc  /data/app/~~NQr9BYMJCmZ7_x0_IHUQbg==/com.x53a.my_test_project-UokKQ90Qx-idyn-Z9wDUuQ==/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::hac769178657af6bf+32)
2025-04-25 02:32:54.008 29744-29744 DEBUG                   pid-29744                            A        #14 pc 0000000000e5b7ec  /data/app/~~NQr9BYMJCmZ7_x0_IHUQbg==/com.x53a.my_test_project-UokKQ90Qx-idyn-Z9wDUuQ==/base.apk (offset 0x39d000) (std::panicking::try::do_call::hec755fdb8400e326+56)
2025-04-25 02:32:54.008 29744-29744 DEBUG                   pid-29744                            A        #15 pc 0000000000e665f0  /data/app/~~NQr9BYMJCmZ7_x0_IHUQbg==/com.x53a.my_test_project-UokKQ90Qx-idyn-Z9wDUuQ==/base.apk (offset 0x39d000) (__rust_try+24)
2025-04-25 02:32:54.008 29744-29744 DEBUG                   pid-29744                            A        #16 pc 0000000000e642fc  /data/app/~~NQr9BYMJCmZ7_x0_IHUQbg==/com.x53a.my_test_project-UokKQ90Qx-idyn-Z9wDUuQ==/base.apk (offset 0x39d000) (std::panic::catch_unwind::h98268b8b7bcd0473+68)
2025-04-25 02:32:54.008 29744-29744 DEBUG                   pid-29744                            A        #17 pc 0000000000e5ed9c  /data/app/~~NQr9BYMJCmZ7_x0_IHUQbg==/com.x53a.my_test_project-UokKQ90Qx-idyn-Z9wDUuQ==/base.apk (offset 0x39d000) (android_activity::util::abort_on_panic::hd2048fed1df9c0cb+32)
2025-04-25 02:32:54.008 29744-29744 DEBUG                   pid-29744                            A        #18 pc 0000000000e54874  /data/app/~~NQr9BYMJCmZ7_x0_IHUQbg==/com.x53a.my_test_project-UokKQ90Qx-idyn-Z9wDUuQ==/base.apk (offset 0x39d000) (ANativeActivity_onCreate+48)
---------------------------- PROCESS STARTED (29746) for package com.x53a.my_test_project ----------------------------
2025-04-25 02:32:54.034  1679-29749 ActivityTaskManager     system_server                        W    Force finishing activity com.x53a.my_test_project/android.app.NativeActivity
2025-04-25 02:32:54.044  1679-1803  ActivityManager         system_server                        I  Showing crash dialog for package com.x53a.my_test_project u0
---------------------------- PROCESS ENDED (29719) for package com.x53a.my_test_project ----------------------------
2025-04-25 02:32:54.069  1679-2095  ActivityManager         system_server                        I  Process com.x53a.my_test_project (pid 29719) has died: fg  TOP 
2025-04-25 02:32:54.092  1679-29749 ActivityManager         system_server                        W  Ignoring remove of inactive process: ProcessRecord{8ab872d 0:com.x53a.my_test_project/u0a19}
2025-04-25 02:32:54.124  1679-1802  WindowManager           system_server                        V      info={id=233 t=CLOSE f=0x10 trk=0 r=[0@Point(0, 0)] c=[
                                                                                                            {WCT{RemoteToken{8687e77 Task{3cfb239 #1 type=home isResizeable=true minWidth=-1 minHeight=-1}}} m=TO_FRONT f=SHOW_WALLPAPER|MOVE_TO_TOP leash=Surface(name=Task=1)/@0xebb5d6f sb=Rect(0, 0 - 1080, 2340) eb=Rect(0, 0 - 1080, 2340) epz=Point(1080, 2340) d=0 taskParent=-1},
                                                                                                            {WCT{RemoteToken{d91e24f Task{c44d67b #266 type=standard A=10019:com.x53a.my_test_project isResizeable=true minWidth=-1 minHeight=-1}}} m=CLOSE f=NONE leash=Surface(name=Task=266)/@0x2e66929 sb=Rect(0, 0 - 1080, 2340) eb=Rect(0, 0 - 1080, 2340) epz=Point(1080, 2340) d=0 taskParent=-1},
                                                                                                            {null m=TO_FRONT f=IS_WALLPAPER leash=Surface(name=WallpaperWindowToken{87aada4 token=android.os.Binder@5c7b437})/@0x5396749 sb=Rect(0, 0 - 1080, 2340) eb=Rect(0, 0 - 1080, 2340) epz=Point(1080, 2340) d=0}
                                                                                                        ]}
2025-04-25 02:32:54.145  1679-2523  CoreBackPreview         system_server                        D  Window{e405f57 u0 Splash Screen com.x53a.my_test_project EXITING}: Setting back callback null
2025-04-25 02:32:54.538  1679-1805  ActivityTaskManager     system_server                        W  Activity top resumed state loss timeout for ActivityRecord{d662e0a u0 com.x53a.my_test_project/android.app.NativeActivity t266 f} isExiting}
---------------------------- PROCESS ENDED (29746) for package com.x53a.my_test_project ----------------------------

unsafe precondition(s) violated: slice::from_raw_parts requires the pointer to be aligned and non-null, and the total size of the slice not to exceed `isize::MAX`
[...]
(core::slice::raw::from_raw_parts::precondition_check::hd990fdb6150135a7+352)
(core::slice::raw::from_raw_parts::h60ba974cc6a0eed3+48)
(android_activity::native_activity::glue::WaitableNativeActivityState::new::hdee137d712c3fe25+1
(android_activity::native_activity::glue::NativeActivityGlue::new::hb8a2711779ad74b3+40)

That's a known issue: rust-mobile/android-activity#153, which was fixed with rust-mobile/android-activity#157

The app created by the template still uses 0.4.3 when 0.6 is the current version:

>cargo tree -i android-activity --target all
android-activity v0.4.3
└── winit v0.28.7
    ├── egui-wgpu v0.22.0
    │   └── my-test-project v0.1.0 (D:\repos\mobile_tmp\my_test_project)
    ├── egui-winit v0.22.0
    │   └── my-test-project v0.1.0 (D:\repos\mobile_tmp\my_test_project)
    └── my-test-project v0.1.0 (D:\repos\mobile_tmp\my_test_project)

I tried updating all crates to their latest version:

[dependencies] 
log = "0.4"
chrono = "0.4"
pollster = "0.4"
egui = "0.31"
wgpu = "25.0"
winit = { version = "0.30", features = ["android-native-activity"] }
egui_demo_lib = "0.31"
egui-winit = { version = "0.31", default-features = false }
egui-wgpu = { version = "0.31", features = [ "winit" ] }

[target.'cfg(target_os = "android")'.dependencies]
android_logger = "0.15"

[target.'cfg(not(target_os = "android"))'.dependencies]
env_logger = "0.11"
D:\repos\mobile_tmp\my_test_project>cargo tree -i android-activity --target all
android-activity v0.6.0
└── winit v0.30.9
    ├── egui-wgpu v0.31.1
    │   └── my-test-project v0.1.0 (D:\repos\mobile_tmp\my_test_project)
    ├── egui-winit v0.31.1
    │   └── my-test-project v0.1.0 (D:\repos\mobile_tmp\my_test_project)
    └── my-test-project v0.1.0 (D:\repos\mobile_tmp\my_test_project)

now it references android-activity v0.6.

Unfortunately there have been some changes and it now fails to compile:

   Compiling my-test-project v0.1.0 (R:\mobile_tmp\my_test_project)
error: unsafe attribute used without unsafe
   --> src\lib.rs:178:3bug
    |
178 | #[no_mangle]
    |   ^^^^^^^^^ usage of unsafe attribute
    |
help: wrap the attribute in `unsafe(...)`
    |
178 | #[unsafe(no_mangle)]
    |   +++++++         +

error[E0432]: unresolved import `winit::event_loop::EventLoopWindowTarget`
 --> src\lib.rs:5:674Debug
  |
5 | use winit::event_loop::{ControlFlow, EventLoop, EventLoopBuilder, EventLoopWindowTarget};
  |                                                                   ^^^^^^^^^^^^^^^^^^^^^ no `EventLoopWindowTarget` in `event_loop`

error[E0433]: failed to resolve: could not find `WindowBuilder` in `window`
  --> src\lib.rs:27:33
   |
27 |     let window = winit::window::WindowBuilder::new()
   |                                 ^^^^^^^^^^^^^ could not find `WindowBuilder` in `window`

error[E0408]: variable `MainEventsCleared` is not bound in all patterns
   --> src\lib.rs:115:29ug
    |
115 |         MainEventsCleared | UserEvent(Event::RequestRedraw) => {
    |         -----------------   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pattern doesn't bind `MainEventsCleared`
    |         |
    |         variable not in all patterns
    |
help: if you meant to match on a variant or a `const` item, consider making the path in the pattern qualified: `path::to::ModOrType::MainEventsCleared`
   --> src\lib.rs:115:9
    |
115 |         MainEventsCleared | UserEvent(Event::RequestRedraw) => {
    |         ^^^^^^^^^^^^^^^^^

error[E0531]: cannot find tuple struct or tuple variant `RedrawRequested` in this scope
  --> src\lib.rs:93:9
   |
93 |         RedrawRequested(..) => {
   |         ^^^^^^^^^^^^^^^ not found in this scope

error[E0599]: no method named `set_pixels_per_point` found for mutable reference `&mut egui_winit::State` in the current scope
  --> src\lib.rs:49:11ebug
   |
49 |     state.set_pixels_per_point(pixels_per_point);
   |           ^^^^^^^^^^^^^^^^^^^^ method not found in `&mut State`

error[E0061]: this function takes 6 arguments but 1 argument was supplied
   --> src\lib.rs:70:21bug
    |
70  |     let mut state = State::new(&event_loop);
    |                     ^^^^^^^^^^-------------
    |                               |
    |                               two arguments of type `egui::Context` and `ViewportId` are missing
    |                               three arguments of type `Option<f32>`, `Option<winit::window::Theme>`, and `Option<usize>` are missing
    |
note: associated function defined here
   --> C:\Users\Lukas\.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\egui-winit-0.31.1\src\lib.rs:113:12
    |
113 |     pub fn new(
    |            ^^^
help: provide the arguments
    |
70  -     let mut state = State::new(&event_loop);
70  +     let mut state = State::new(/* egui::Context */, /* ViewportId */, &event_loop, /* Option<f32> */, /* Option<winit::window::Theme> */, /* Option<usize> */);
    |

error[E0061]: this function takes 6 arguments but 4 arguments were supplied
  --> src\lib.rs:71:23
   |
71 |       let mut painter = Painter::new(
   |  _______________________^^^^^^^^^^^^-
72 | |         egui_wgpu::WgpuConfiguration::default(),
   | |         --------------------------------------- argument #1 of type `egui::Context` is missing
73 | |         1, // msaa samples
74 | |         None,
75 | |         false,
76 | |     );
   | |_____- argument #6 of type `bool` is missing
   |
note: associated function defined here
  --> C:\Users\Lukas\.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\egui-wgpu-0.31.1\src\winit.rs:54:18
   |
54 |     pub async fn new(
   |                  ^^^
help: provide the arguments
   |
71 -     let mut painter = Painter::new(
72 -         egui_wgpu::WgpuConfiguration::default(),
73 -         1, // msaa samples
74 -         None,
75 -         false,
76 -     );
71 +     let mut painter = Painter::new(/* egui::Context */, egui_wgpu::WgpuConfiguration::default(), 1, None, false, /* bool */);
   |

warning: use of deprecated method `winit::event_loop::EventLoop::<T>::run`: use `EventLoop::run_app` instead
  --> src\lib.rs:80:16
   |
80 |     event_loop.run(move |event, event_loop, control_flow| match event {
   |                ^^^
   |
   = note: `#[warn(deprecated)]` on by default

error[E0593]: closure is expected to take 2 arguments, but it takes 3 arguments
  --> src\lib.rs:80:16
   |
80 |     event_loop.run(move |event, event_loop, control_flow| match event {
   |                ^^^ -------------------------------------- takes 3 arguments
   |                |
   |                expected closure that takes 2 arguments

error[E0308]: mismatched types
  --> src\lib.rs:83:69
   |
83 |                 window = Some(create_window(event_loop, &mut state, &mut painter));
   |                               -------------                         ^^^^^^^^^^^^ expected `&mut Painter`, found `&mut impl Future<Output = Painter>`
   |                               |
   |                               arguments to this function are incorrect
   |
   = note: expected mutable reference `&mut egui_wgpu::winit::Painter`
              found mutable reference `&mut impl Future<Output = egui_wgpu::winit::Painter>`
note: function defined here
  --> src\lib.rs:22:4
   |
22 | fn create_window<T>(
   |    ^^^^^^^^^^^^^
...
25 |     painter: &mut Painter,
   |     ---------------------

error[E0599]: no method named `set_window` found for opaque type `impl Future<Output = egui_wgpu::winit::Painter>` in the current scope
  --> src\lib.rs:86:44ebug
   |
86 |                 pollster::block_on(painter.set_window(Some(window))).unwrap();
   |                                            ^^^^^^^^^^ method not found in `impl Future<Output = Painter>`
   |
help: consider `await`ing on the `Future` and calling the method on its `Output`
   |
86 |                 pollster::block_on(painter.await.set_window(Some(window))).unwrap();
   |                                            ++++++

error[E0061]: this method takes 2 arguments but 3 arguments were supplied
   --> src\lib.rs:100:23ug
    |
100 |                 state.handle_platform_output(window, &ctx, full_output.platform_output);
    |                       ^^^^^^^^^^^^^^^^^^^^^^         ---- unexpected argument #2 of type `&egui::Context`
    |
note: method defined here
   --> C:\Users\Lukas\.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\egui-winit-0.31.1\src\lib.rs:820:12
    |
820 |     pub fn handle_platform_output(
    |            ^^^^^^^^^^^^^^^^^^^^^^
help: remove the extra argument
    |
100 -                 state.handle_platform_output(window, &ctx, full_output.platform_output);
100 +                 state.handle_platform_output(window, full_output.platform_output);
    |

error[E0599]: no method named `paint_and_update_textures` found for opaque type `impl Future<Output = egui_wgpu::winit::Painter>` in the current scope
   --> src\lib.rs:102:25ug
    |
102 |                 painter.paint_and_update_textures(
    |                 --------^^^^^^^^^^^^^^^^^^^^^^^^^ method not found in `impl Future<Output = Painter>`
    |
help: consider `await`ing on the `Future` and calling the method on its `Output`
    |
102 |                 painter.await.paint_and_update_textures(
    |                         ++++++

error[E0599]: no method named `pixels_per_point` found for struct `egui_winit::State` in the current scope
   --> src\lib.rs:103:27ug
    |
103 |                     state.pixels_per_point(),
    |                           ^^^^^^^^^^^^^^^^ method not found in `State`

error[E0061]: this method takes 2 arguments but 1 argument was supplied
    --> src\lib.rs:105:26g
     |
105  |                     &ctx.tessellate(full_output.shapes),
     |                          ^^^^^^^^^^-------------------- argument #2 of type `f32` is missing
     |
note: method defined here
    --> C:\Users\Lukas\.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\egui-0.31.1\src\context.rs:2499:12
     |
2499 |     pub fn tessellate(
     |            ^^^^^^^^^^
help: provide the argument
     |
105  |                     &ctx.tessellate(full_output.shapes, /* f32 */),
     |                                                       +++++++++++

error[E0609]: no field `repaint_after` on type `FullOutput`
   --> src\lib.rs:110:32
    |
110 |                 if full_output.repaint_after.is_zero() {
    |                                ^^^^^^^^^^^^^ unknown field
    |
    = note: available fields are: `platform_output`, `textures_delta`, `shapes`, `pixels_per_point`, `viewport_output`

error[E0599]: no method named `on_window_resized` found for opaque type `impl Future<Output = egui_wgpu::winit::Painter>` in the current scope
   --> src\lib.rs:123:29UTING [5m 11s]
    |p:rustBuildArm64Debug
123 |                     painter.on_window_resized(size.width, size.height);
    |                             ^^^^^^^^^^^^^^^^^ method not found in `impl Future<Output = Painter>`
    |
help: consider `await`ing on the `Future` and calling the method on its `Output`
    |
123 |                     painter.await.on_window_resized(size.width, size.height);
    |                             ++++++

error[E0599]: no variant or associated item named `Exit` found for enum `winit::event_loop::ControlFlow` in the current scope
   --> src\lib.rs:126:50
    |
126 |                     *control_flow = ControlFlow::Exit;
    |                                                  ^^^^ variant or associated item not found in `ControlFlow`

error[E0599]: no method named `on_event` found for struct `egui_winit::State` in the current scope
   --> src\lib.rs:131:34ug
    |
131 |             let response = state.on_event(&ctx, &event);
    |                                  ^^^^^^^^
    |
help: there is a method `on_window_event` with a similar name
    |
131 |             let response = state.on_window_event(&ctx, &event);
    |                                     +++++++

error[E0599]: no function or associated item named `with_user_event` found for struct `EventLoopBuilder` in the current scope
   --> src\lib.rs:186:40
    |
186 |     let event_loop = EventLoopBuilder::with_user_event()
    |                                        ^^^^^^^^^^^^^^^ function or associated item not found in `EventLoopBuilder<_>`
    |
note: if you're trying to build a new `EventLoopBuilder<_>`, consider using `EventLoopBuilder::<()>::new` which returns `EventLoopBuilder<()>`
   --> C:\Users\Lukas\.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\winit-0.30.9\src\event_loop.rs:75:5
    |
75  |     pub fn new() -> Self {
    |     ^^^^^^^^^^^^^^^^^^^^

Some errors have detailed explanations: E0061, E0308, E0408, E0432, E0433, E0531, E0593, E0599, E0609.
For more information about an error, try `rustc --explain E0061`.
warning: `my-test-project` (lib) generated 1 warning
error: could not compile `my-test-project` (lib) due to 20 previous errors; 1 warning emitted
error: Failed to compile lib
    `Failed to run `cargo build`: command ["cargo", "build", "--package",
    "my-test-project", "--manifest-path", "R:\\mobile_tmp\\my_test_project\
    \Cargo.toml", "--target", "aarch64-linux-android"] exited with code 101

The good news is that the updated crates seem to be compatible with each other, the errors are only from the app itself, which shouldn't be too hard to adapt. I'll take a look at that later but wanted to post the issue thus far.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions