Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] Android apk crash at startup caused by WryActivity can't find create() #10094

Closed
Yuxiza opened this issue Jun 19, 2024 · 3 comments
Closed
Labels
status: needs triage This issue needs to triage, applied to new issues type: bug

Comments

@Yuxiza
Copy link

Yuxiza commented Jun 19, 2024

Describe the bug

Both debug and release apk will crash on startup. Tried updating dependencies and cli and regenerating gen/android but to no avail.
This doesn't happen until a small refactor. I suspect it was caused by updating dependencies when I was refactoring, because the bug didn't disappear even when I restored the code.
Some one said that migrating the code to a brand new tauri project can solve this problem, but I haven't tried it yet. It's too expensive.

Reproduction

No response

Expected behavior

No response

Full tauri info output

[✔] Environment
    - OS: Windows 10.0.19045 X64
    ✔ WebView2: 126.0.2592.61
    ✔ MSVC: Visual Studio 生成工具 2022
    ✔ rustc: 1.81.0-nightly (f8e566053 2024-06-14)
    ✔ cargo: 1.81.0-nightly (4dcbca118 2024-06-11)
    ✔ rustup: 1.27.1 (54dd3d00f 2024-04-24)
    ✔ Rust toolchain: nightly-x86_64-pc-windows-msvc (default)
    - node: 20.14.0
    - yarn: 1.22.22
    - npm: 10.7.0

[-] Packages
    - tauri [RUST]: 2.0.0-beta.22
    - tauri-build [RUST]: 2.0.0-beta.17
    - wry [RUST]: 0.40.1
    - tao [RUST]: 0.28.1
    - tauri-cli [RUST]: 2.0.0-beta.20
    - @tauri-apps/api : not installed!
    - @tauri-apps/cli [NPM]: 2.0.0-beta.20

[-] App
    - build-type: bundle
    - CSP: unset
    - frontendDist: ../prosit
    - devUrl: http:https://localhost:3001/
    - bundler: Vite
Done in 9.81s.

Stack trace

2024-06-19 23:36:23.560  7911-7911  ziparchive              club.hihuu.prosit                    W  Unable to open '/data/app/~~DknL1ZeD6r7NJhD37xmuqw==/club.hihuu.prosit-qvRGCf-STgau_IiQwTJ_6A==/base.dm': No such file or directory
2024-06-19 23:36:23.561  7911-7911  ziparchive              club.hihuu.prosit                    W  Unable to open '/data/app/~~DknL1ZeD6r7NJhD37xmuqw==/club.hihuu.prosit-qvRGCf-STgau_IiQwTJ_6A==/base.dm': No such file or directory
2024-06-19 23:36:23.678  7911-7911  nativeloader            club.hihuu.prosit                    D  Configuring clns-6 for other apk /data/app/~~DknL1ZeD6r7NJhD37xmuqw==/club.hihuu.prosit-qvRGCf-STgau_IiQwTJ_6A==/base.apk. target_sdk_version=34, uses_libraries=, library_path=/data/app/~~DknL1ZeD6r7NJhD37xmuqw==/club.hihuu.prosit-qvRGCf-STgau_IiQwTJ_6A==/lib/x86_64:/data/app/~~DknL1ZeD6r7NJhD37xmuqw==/club.hihuu.prosit-qvRGCf-STgau_IiQwTJ_6A==/base.apk!/lib/x86_64, permitted_path=/data:/mnt/expand:/data/user/0/club.hihuu.prosit
2024-06-19 23:36:23.696  7911-7911  GraphicsEnvironment     club.hihuu.prosit                    V  Currently set values for:
2024-06-19 23:36:23.696  7911-7911  GraphicsEnvironment     club.hihuu.prosit                    V    angle_gl_driver_selection_pkgs=[]
2024-06-19 23:36:23.696  7911-7911  GraphicsEnvironment     club.hihuu.prosit                    V    angle_gl_driver_selection_values=[]
2024-06-19 23:36:23.697  7911-7911  GraphicsEnvironment     club.hihuu.prosit                    V  ANGLE GameManagerService for club.hihuu.prosit: false
2024-06-19 23:36:23.697  7911-7911  GraphicsEnvironment     club.hihuu.prosit                    V  club.hihuu.prosit is not listed in per-application setting
2024-06-19 23:36:23.698  7911-7911  GraphicsEnvironment     club.hihuu.prosit                    V  Neither updatable production driver nor prerelease driver is supported.
2024-06-19 23:36:23.701  7911-7911  ActivityThread          club.hihuu.prosit                    W  Application club.hihuu.prosit is suspending. Debugger needs to resume to continue.
2024-06-19 23:36:23.706  7911-7911  System.out              club.hihuu.prosit                    I  Sending WAIT chunk
2024-06-19 23:36:23.706  7911-7911  System.out              club.hihuu.prosit                    I  Waiting for debugger first packet
2024-06-19 23:36:23.908  7911-7911  System.out              club.hihuu.prosit                    I  Debug.suspendAllAndSentVmStart
2024-06-19 23:36:24.428  7911-7911  System.out              club.hihuu.prosit                    I  Debug.suspendAllAndSendVmStart, resumed
2024-06-19 23:36:24.479  7911-7963  libEGL                  club.hihuu.prosit                    D  loaded /vendor/lib64/egl/libEGL_emulation.so
2024-06-19 23:36:24.480  7911-7963  libEGL                  club.hihuu.prosit                    D  loaded /vendor/lib64/egl/libGLESv1_CM_emulation.so
2024-06-19 23:36:24.483  7911-7963  libEGL                  club.hihuu.prosit                    D  loaded /vendor/lib64/egl/libGLESv2_emulation.so
2024-06-19 23:36:24.770  7911-7911  AppCompatDelegate       club.hihuu.prosit                    D  Checking for metadata for AppLocalesMetadataHolderService : Service not found
2024-06-19 23:36:24.807  7911-7911  ub.hihuu.prosit         club.hihuu.prosit                    E  No implementation found for void club.hihuu.prosit.WryActivity.create(club.hihuu.prosit.WryActivity) (tried Java_club_hihuu_prosit_WryActivity_create and Java_club_hihuu_prosit_WryActivity_create__Lclub_hihuu_prosit_WryActivity_2) - is the library loaded, e.g. System.loadLibrary?
2024-06-19 23:36:24.807  7911-7911  AndroidRuntime          club.hihuu.prosit                    D  Shutting down VM
2024-06-19 23:36:24.809  7911-7911  AndroidRuntime          club.hihuu.prosit                    E  FATAL EXCEPTION: main
                                                                                                    Process: club.hihuu.prosit, PID: 7911
                                                                                                    java.lang.UnsatisfiedLinkError: No implementation found for void club.hihuu.prosit.WryActivity.create(club.hihuu.prosit.WryActivity) (tried Java_club_hihuu_prosit_WryActivity_create and Java_club_hihuu_prosit_WryActivity_create__Lclub_hihuu_prosit_WryActivity_2) - is the library loaded, e.g. System.loadLibrary?
                                                                                                    	at club.hihuu.prosit.WryActivity.create(Native Method)
                                                                                                    	at club.hihuu.prosit.WryActivity.onCreate(WryActivity.kt:62)
                                                                                                    	at android.app.Activity.performCreate(Activity.java:8595)
                                                                                                    	at android.app.Activity.performCreate(Activity.java:8573)
                                                                                                    	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1456)
                                                                                                    	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3764)
                                                                                                    	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3922)
                                                                                                    	at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:103)
                                                                                                    	at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:139)
                                                                                                    	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:96)
                                                                                                    	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2443)
                                                                                                    	at android.os.Handler.dispatchMessage(Handler.java:106)
                                                                                                    	at android.os.Looper.loopOnce(Looper.java:205)
                                                                                                    	at android.os.Looper.loop(Looper.java:294)
                                                                                                    	at android.app.ActivityThread.main(ActivityThread.java:8177)
                                                                                                    	at java.lang.reflect.Method.invoke(Native Method)
                                                                                                    	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
                                                                                                    	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:971)
2024-06-19 23:36:24.818  7911-7911  Process                 club.hihuu.prosit                    I  Sending signal. PID: 7911 SIG: 9

Additional context

No response

@Yuxiza Yuxiza added status: needs triage This issue needs to triage, applied to new issues type: bug labels Jun 19, 2024
@Yuxiza
Copy link
Author

Yuxiza commented Jun 21, 2024

Sorry, it's my fault. I use mobile_entry_point macro for a wrong function which is not in my mobile lib.
But no error throwed during the compile. If there is no mobile_entry_point has been found for a mobile target, then we should throw an error.

@thewh1teagle
Copy link
Contributor

thewh1teagle commented Jun 23, 2024

hey @Yuxiza
I experience the same issue when trying to build tauri app for android.
Did you found solution?
This is how my lib.rs looks like: lib.rs

Looks like the cause is #10024 (comment)

@amrbashir
Copy link
Member

amrbashir commented Jun 24, 2024

Sorry, it's my fault. I use mobile_entry_point macro for a wrong function which is not in my mobile lib. But no error throwed during the compile. If there is no mobile_entry_point has been found for a mobile target, then we should throw an error.

This is hard to catch since we can only know that mobile_entry_point has not been set correctly after compilation, probably at runtime like you experienced, or maybe through our CLI by checking whether the compiled .a file has the needed export, but that comes with a cost that if the underlying libs, tao and wry changes the name of the initialization function name, our CLI will break and need to be updated, so I'd rather keep this implementation detail in wry and tao

@amrbashir amrbashir closed this as not planned Won't fix, can't repro, duplicate, stale Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs triage This issue needs to triage, applied to new issues type: bug
Projects
None yet
Development

No branches or pull requests

3 participants