Skip to content
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

Build failure in external_app_launcher: "cannot find symbol: class Registrar" #51

Open
MattiaudaNicolasCN opened this issue Feb 13, 2025 · 5 comments

Comments

@MattiaudaNicolasCN
Copy link

Hello everyone,

I'm encountering a build failure when running flutter build appbundle. The error message is:

../.pub-cache/hosted/pub.dev/external_app_launcher-4.0.1/android/src/main/java/com/example/launchexternalapp/LaunchexternalappPlugin.java:9: error: cannot find symbol
import io.flutter.plugin.common.PluginRegistry.Registrar;
^
symbol: class Registrar
location: interface PluginRegistry
../.pub-cache/hosted/pub.dev/external_app_launcher-4.0.1/android/src/main/java/com/example/launchexternalapp/LaunchexternalappPlugin.java:30: error: cannot find symbol
public static void registerWith(Registrar registrar) {
^
symbol: class Registrar
location: class LaunchexternalappPlugin
2 errors

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':external_app_launcher:compileReleaseJavaWithJavac'.

Compilation failed; see the compiler error output for details.

The output of my flutter doctor is:

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.29.0, on macOS 15.3 24D60 darwin-x64, locale en-IT)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0-rc1)
[✓] Xcode - develop for iOS and macOS (Xcode 16.2)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.1)
[✓] VS Code (version 1.97.0)
[✓] Connected device (4 available)
[✓] Network resources

• No issues found!

I tried to resolve modifying the package locally using FlutterPlugin, but if I do that I get a new error:

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':package_info_plus:compileReleaseJavaWithJavac'.

error: invalid source release: 17

  • Try:

Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.

BUILD FAILED in 8s
Running Gradle task 'bundleRelease'... 9.5s
Gradle task bundleRelease failed with exit code 1

What could I do to resolve this issue?

Would appreciate any guidance or updates on this. Thanks in advance! 🙏

@a-aslan-blink
Copy link

I faced same error, any update?

@xaldarof
Copy link

Hi you can downgrade your flutter version if you upgraded flutter to 3.29

They removed import io.flutter.plugin.common.PluginRegistry.Registrar on Flutter 3.29

@xaldarof
Copy link

Try replace dependency to this:

  external_app_launcher:
    git:
      url: https://github.com/xaldarof/external_app_launcher.git
      ref: master

@nick-cuypers
Copy link

nick-cuypers commented Feb 14, 2025

@geekruchika
Copy link
Contributor

Hi All,
I have fixed this in the latest version
external_app_launcher: ^4.0.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants