-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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 tauri-plugin capabilities disallowed #9502
Comments
It's also present when trying to use event:allow-listen. |
also same for upload plugin |
Same for me, {
"$schema": "../gen/schemas/mobile-schema.json",
"identifier": "mobile-capability",
"description": "Capability for mobile",
"webviews": [
"main"
],
"windows": [
"main"
],
"platforms": [
"android",
"iOS"
],
"permissions": [
"event:allow-emit",
"event:allow-emit-to",
"event:allow-listen",
"event:allow-unlisten"
]
} And {
"$schema": "../gen/schemas/desktop-schema.json",
"identifier": "desktop-capability",
"description": "Capability for desktop",
"webviews": [
"main"
],
"windows": [
"main"
],
"platforms": [
"linux",
"macOS",
"windows"
],
"permissions": [
"event:allow-emit",
"event:allow-emit-to",
"event:allow-listen",
"event:allow-unlisten"
]
} Everything works fine for the desktop (firing events from Rust and listening to them from JS), but no success on mobile.
I also noticed the following error in Android Logcat
|
I have the same issue. In development mode I can see how the first time I launch my app (it uses
But when I simply reload the webview (via the chromium debugger), the error disappears and everything works. I think that indicates it's timing-related: When the rust code & webview code start up at roughly the same time, the permission gets rejected, but if the webview code waits for the rust code a bit, it works. |
Getting the same for fs plugin on android |
same here |
Describe the bug
Works as expected for desktop build; issue only occurs when running on mobile (Only tried Android, not iOS)
In the last two beta releases of 2.0 tauri + tauri-plugin, I have been running into an issue where capability permissions won't allow my plugin to function. Without any code changes, and only updating:
tauri 2.0.0-beta.12 -> 2.0.0-beta.15
tauri-plugin 2.0.0-beta.10 -> 2.0.0-beta.12
My plugin has stopped functioning (only on android), and my client is throwing a new error:
Uncaught (in promise) my-plugin.init not allowed on window main, webview main, allowed windows: , allowed webviews: , referenced by
My capabilities looks something like this:
Reproduction
I was able to reproduce the error here, using a similar setup: https://github.com/bpevs/tauri_diesel_example/tree/android
However, the behavior is not exactly matching with my private repo's issue; still trying to figure out why. Difference is that in this repo:
Expected behavior
In this example repo, the expected behavior is that the todos are fetched from sqlite, and returned via tauri invoke command.
Full
tauri info
outputStack trace
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: