tauri-apps / tauri

Build smaller, faster, and more secure desktop and mobile applications with a web frontend.
https://tauri.app
Apache License 2.0
85.4k stars 2.58k forks source link

[bug] cargo tauri android dev does not work #11494

Open omani opened 4 weeks ago

omani commented 4 weeks ago

Describe the bug

emulator starts. app starts. blank page in app.

following ERROR in console:

Performing Streamed Install
Success
Starting: Intent { cmp=com.tauri_gui.app/.MainActivity }
--------- beginning of main
10-25 18:33:01.139  7699  7699 I m.tauri_gui.ap: Late-enabling -Xcheck:jni
10-25 18:33:01.162  7699  7699 I m.tauri_gui.ap: Unquickening 12 vdex files!
10-25 18:33:01.165  7699  7699 W m.tauri_gui.ap: Unexpected CPU variant for X86 using defaults: x86
10-25 18:33:03.725  7699  7699 W m.tauri_gui.ap: Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (greylist, reflection, allowed)
10-25 18:33:03.742  7699  7699 W m.tauri_gui.ap: Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (greylist, reflection, allowed)
10-25 18:33:04.242  7699  7699 I WebViewFactory: Loading com.google.android.webview version 83.0.4103.106 (code 410410681)
10-25 18:33:04.251  7699  7699 I m.tauri_gui.ap: The ClassLoaderContext is a special shared library.
    Info Watching /home/sun/shared/git/tauri-gui/src-tauri for changes...
    Info Watching /home/sun/shared/git/tauri-gui/src-tauri for changes...
10-25 18:33:04.333  7699  7699 I m.tauri_gui.ap: The ClassLoaderContext is a special shared library.
10-25 18:33:04.443  7699  7699 I cr_LibraryLoader: Loaded native library version number "83.0.4103.106"
10-25 18:33:04.443  7699  7699 I cr_CachingUmaRecorder: Flushed 3 samples from 3 histograms.
10-25 18:33:04.568  7699  7699 I TetheringManager: registerTetheringEventCallback:com.tauri_gui.app
10-25 18:33:04.594  7699  7774 W chromium: [WARNING:dns_config_service_posix.cc(341)] Failed to read DnsConfig.
10-25 18:33:04.594  7699  7735 I RustStdoutStderr: [WARNING:dns_config_service_posix.cc(341)] Failed to read DnsConfig.
10-25 18:33:04.788  7699  7699 I Choreographer: Skipped 58 frames!  The application may be doing too much work on its main thread.
10-25 18:33:04.954  7699  7720 I Gralloc4: mapper 4.x is not supported
10-25 18:33:05.272  7699  7720 I OpenGLRenderer: Davey! duration=1463ms; Flags=1, IntendedVsync=1753651430032, Vsync=1754618096660, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=1754634855782, AnimationStart=1754634858817, PerformTraversalsStart=1754634860865, DrawStart=1754866078336, SyncQueued=1754906258212, SyncStart=1754909366856, IssueDrawCommandsStart=1754909498669, SwapBuffers=1754990242778, FrameCompleted=1755118317873, DequeueBufferDuration=72519, QueueBufferDuration=740027, GpuCompleted=0,
10-25 18:33:05.284  7699  7775 W m.tauri_gui.ap: Accessing hidden method Landroid/media/AudioManager;->getOutputLatency(I)I (greylist, reflection, allowed)
10-25 18:33:05.332  7699  7775 W cr_media: Requires BLUETOOTH permission
10-25 18:33:06.016  7699  7788 I VideoCapabilities: Unsupported profile 4 for video/mp4v-es
10-25 18:33:06.018  7699  7788 W cr_MediaCodecUtil: HW encoder for video/avc is not available on this device.
10-25 18:33:06.145  7699  7720 I OpenGLRenderer: Davey! duration=1311ms; Flags=0, IntendedVsync=1754668113787, Vsync=1755134780435, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=1755146382750, AnimationStart=1755146384913, PerformTraversalsStart=1755153804069, DrawStart=1755154033136, SyncQueued=1755154564377, SyncStart=1755166660271, IssueDrawCommandsStart=1755167044663, SwapBuffers=1755859292143, FrameCompleted=1755991924439, DequeueBufferDuration=47150157, QueueBufferDuration=16711743, GpuCompleted=0,
10-25 18:33:06.898  7699  7699 W Tauri/Console: File: http://tauri.localhost/ - Line 590 - Msg: The `integrity` attribute is currently ignored for preload destinations that do not support subresource integrity. See https://crbug.com/981419 for more information
10-25 18:33:07.003  7699  7699 E Tauri/Console: File: http://tauri.localhost/ - Line 581 - Msg: Uncaught SyntaxError: Unexpected reserved word
10-25 18:33:09.964  7699  7699 W Tauri/Console: File:  - Line 0 - Msg: The resource http://tauri.localhost/tauri-gui-ui-c3ba43d7a57ce0b1_bg.wasm was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.

Reproduction

No response

Expected behavior

No response

Full tauri info output

--------

Stack trace

-

Additional context

No response

omani commented 4 weeks ago

this is after creating a tauri app with rust + leptos with cargo create-tauri-app. freshly installed. everything according to docs.

lucasfernog commented 2 weeks ago

Uncaught SyntaxError: Unexpected reserved word i think this happens when the simulator you're using has a super old webview version

omani commented 2 weeks ago

Im not familiar with android and the android SDK. I downloaded a pretty recent version of android (version 34). how can it be old? what do I have to do to update the webview version?

omani commented 2 weeks ago

Uncaught SyntaxError: Unexpected reserved word i think this happens when the simulator you're using has a super old webview version

I should also mention that I tried this on two different real hardware android phones (from different vendors) and it was the same issue. (android 8 and android 10 or so I think. not sure. several years old phones).