tauri-apps / tauri-apps/plugins-workspace

[barcode-scanner]Tauri : Waiting for the barcode module to be downloaded. Please wait.

Open
#836 6 comments 1 reaction 0 assignees View on GitHub
platform: android plugin: barcode-scanner type: feature request
Dominant language
Rust
Stars
1.8k
Forks
602
Avg merge
4d 14h
Merged PRs (30d)
9

Description

Friends who love Rust and Tauri, I encountered problems while developing Android applications using Tauri and need help.
When I use the barcode scanner plugin, I receive the following error message:

```
Tauri : Waiting for the barcode module to be downloaded. Please wait.
```
Is there a problem with my usage? Here is how I use the barcode scanner plugin:
In the file 'Cargo. toml':
```
[target."cfg(any(target_os = \"android\", target_os = \"ios\"))".dependencies]
tauri-plugin-barcode-scanner = "2.0.0-alpha.3"
```
In the file 'main.rs':
```rust
tauri::Builder::default()
.plugin(tauri_plugin_window::init())
.plugin(tauri_plugin_shell::init())
.plugin(tauri_plugin_barcode_scanner::init())
.invoke_handler(tauri::generate_handler![greet])
.run(tauri::generate_context!())
.expect("error while running tauri application");
```
And it's written like this at the point of call:
```typescript
if (state == "prompt") {
requestPermissions();
} else if (state == "denied") {
return;
} else if (state == "granted") {
scan({
windowed: false,
formats: [Format.QRCode],
// cameraDirection: 'back'
}).then((resp) => {
console.log(`response: ${resp.content}`);
});
}
```
In addition, the device number of the camera will also prompt an error message. Is there a solution?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.