Skip to content

[bug] no such method getPluginManager() #7016

Description

@nikoPLP

Describe the bug

When runing the release android app, the app crashes with

java.lang.NoSuchMethodError: no non-static method ... MainActivity;.getPluginManager()Lapp/tauri/plugin/PluginManager;

Reproduction

cargo install create-tauri-app
cargo create-tauri-app --alpha
cd tauri-app
cargo tauri android init
cargo tauri android build
adb install app-universal-release.apk

Expected behavior

The problem is solved when a line is added in the file src-tauri/gen/android/app/proguard-rules.pro which is otherwise empty!!!

-keep class [your app name here].TauriActivity {
  public app.tauri.plugin.PluginManager getPluginManager();
}

There must be a bug in the build script that generates proguard-rules.pro from https://github.com/tauri-apps/tauri/blob/tauri-v2.0.0-alpha.9/core/tauri/mobile/proguard-tauri.pro

Platform and versions

[✔] Environment
    - OS: Mac OS 10.15.6 X64
    ✔ Xcode Command Line Tools: installed
    ✔ rustc: 1.69.0 (84c898d65 2023-04-16)
    ✔ Cargo: 1.69.0 (6e9a83356 2023-04-12)
    ✔ rustup: 1.26.0 (5af9b9484 2023-04-05)
    ✔ Rust toolchain: stable-x86_64-apple-darwin (environment override by RUSTUP_TOOLCHAIN)
    - node: 16.13.1
    - pnpm: 7.15.0
    - yarn: 1.22.18
    - npm: 8.1.2

[-] Packages
    - tauri [RUST]: 2.0.0-alpha.9
    - tauri-build [RUST]: 2.0.0-alpha.5
    - wry [RUST]: 0.28.3
    - tao [RUST]: 0.19.1
    - @tauri-apps/api [NPM]: 2.0.0-alpha.4
    - @tauri-apps/cli [NPM]: 2.0.0-alpha.9

[-] App
    - build-type: bundle
    - CSP: unset
    - distDir: ../dist
    - devPath: http://localhost:1420/
    - framework: Svelte
    - bundler: Vite

Stack trace

No response

Additional context

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions