plugins-workspace icon indicating copy to clipboard operation
plugins-workspace copied to clipboard

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

Open xuchao-ovo opened this issue 2 years ago • 6 comments

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':

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:

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?

xuchao-ovo avatar Dec 19 '23 09:12 xuchao-ovo

Does your device has a internet connection and Google Play Services? Currently the plugin dynamically downloads the module on the phone instead of the build system (to my understanding to reduce bundle size and share the module with other apps)

FabianLars avatar Dec 19 '23 11:12 FabianLars

So far, it is possible to download this module with the internet, and its functions are normal. However, the download conditions will be very difficult, and it cannot be downloaded every time. I guess it may be related to the internet in China.

Can this plugin provide an offline version or a way to integrate into the app?

xsxz01 avatar Dec 22 '23 03:12 xsxz01

same problem

songjiachao avatar Jul 24 '24 02:07 songjiachao

Do You have a plain to support this?

songjiachao avatar Sep 13 '24 07:09 songjiachao

Yes, otherwise this issue would be closed. I cannot give you an estimated timeframe though. I assume that this will not be part of the initial 2.0.0 release of the plugin (unless a community member wants to research and implement this).

FabianLars avatar Sep 16 '24 12:09 FabianLars

To solve this problem, it would be simpler if only the frontend is used. However, I'm not sure about using Rust. Do I need to create a frontend plugin to call the frontend?

xsxz01 avatar Sep 28 '24 04:09 xsxz01