Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[Bug]: Build Error on Android with Geolocator Plugin 4.3.1 and Flutter 3.29 #1650

Closed
3 of 8 tasks
matheusbristot opened this issue Mar 6, 2025 · 3 comments
Closed
3 of 8 tasks

Comments

@matheusbristot
Copy link

Please check the following before submitting a new issue.

Please select affected platform(s)

  • Android
  • iOS
  • Linux
  • macOS
  • Web
  • Windows

Steps to reproduce

Description:
After upgrading to Flutter 3.29, I am encountering two build errors in the Geolocator plugin (version 4.3.1) when building the Android app. The errors indicate that the Registrar symbol cannot be found in io.flutter.plugin.common.PluginRegistry.

Error Details:

First Error:

android/src/main/java/com/baseflow/geolocator/GeolocatorPlugin.java:58: error: cannot find symbol
   private io.flutter.plugin.common.PluginRegistry.Registrar pluginRegistrar;
                                                  ^
  symbol:   class Registrar
  location: interface PluginRegistry

Second Error:

android/src/main/java/com/baseflow/geolocator/GeolocatorPlugin.java:78: error: cannot find symbol
   public static void registerWith(io.flutter.plugin.common.PluginRegistry.Registrar registrar) {
                                                                          ^
   symbol:   class Registrar
   location: interface PluginRegistry

Steps to Reproduce:
Upgrade Flutter to version 3.29.
Use Geolocator plugin version 4.3.1.
Run the build for the Android app (e.g., flutter build apk).

Expected results

Build pass

Actual results

android/src/main/java/com/baseflow/geolocator/GeolocatorPlugin.java:58: error: cannot find symbol
private io.flutter.plugin.common.PluginRegistry.Registrar pluginRegistrar;
^
symbol: class Registrar
location: interface PluginRegistry

android/src/main/java/com/baseflow/geolocator/GeolocatorPlugin.java:78: error: cannot find symbol
public static void registerWith(io.flutter.plugin.common.PluginRegistry.Registrar registrar) {
^
symbol: class Registrar
location: interface PluginRegistry

Code sample

Code sample
[Paste your code here]

Screenshots or video

Screenshots or video demonstration

[Upload media here]

Version

4.3.1

Flutter Doctor output

Doctor output
[✓] Flutter (Channel stable, 3.29.0, on macOS 15.3.1 24D70 darwin-arm64, locale pt-BR) [3,0s]
    • Flutter version 3.29.0 on channel stable at /Users/matheusbristot/fvm/versions/stable
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 35c388afb5 (3 weeks ago), 2025-02-10 12:48:41 -0800
    • Engine revision f73bfc4522
    • Dart version 3.7.0
    • DevTools version 2.42.2

[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.1) [2,8s]
    • Android SDK at /Users/matheusbristot/Library/Android/sdk
    • Platform android-35, build-tools 35.0.1
    • ANDROID_HOME = /Users/matheusbristot/Library/Android/sdk
    • Java binary at: /Users/matheusbristot/.sdkman/candidates/java/current/bin/java
      This JDK is specified in your Flutter configuration.
      To change the current JDK, run: `flutter config --jdk-dir="path/to/jdk"`.
    • Java version OpenJDK Runtime Environment Corretto-17.0.13.11.1 (build 17.0.13+11-LTS)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 16.0) [1.921ms]
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 16A242d
    • CocoaPods version 1.16.2

[✗] Chrome - develop for the web (Cannot find Chrome executable at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome) [12ms]
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.

[✓] Android Studio (version 2024.3) [11ms]
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 21.0.5+-12932927-b750.29)

[✓] VS Code (version 1.98.0) [10ms]
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.106.0

[✓] Connected device (5 available) [7,8s]
    • sdk gphone64 arm64 (mobile)     • emulator-5554                        • android-arm64 • Android 14 (API 34) (emulator)
    • iBristot (wireless) (mobile)    • 00008110-001C449A3411401E            • ios           • iOS 18.4 22E5200s
    • iPhone 15 Pro (mobile)          • AFA8A3E3-C938-4706-B096-899278B5D5D6 • ios           • com.apple.CoreSimulator.SimRuntime.iOS-17-2 (simulator)
    • macOS (desktop)                 • macos                                • darwin-arm64  • macOS 15.3.1 24D70 darwin-arm64
    • Mac Designed for iPad (desktop) • mac-designed-for-ipad                • darwin        • macOS 15.3.1 24D70 darwin-arm64

[✓] Network resources [657ms]
    • All expected network resources are available.
@pettymn
Copy link

pettymn commented Mar 6, 2025

I’m facing the same problem with the new 3.29.X Flutter version

@ebot64
Copy link

ebot64 commented Mar 12, 2025

I also started facing same issue after upgrading to fluttter 3.29.1

Note: Recompile with -Xlint:unchecked for details.
AppData\Local\Pub\Cache\hosted\pub.dev\geolocator_android-4.3.1\android\src\main\java\com\baseflow\geolocator\GeolocatorPlugin.java:58: error: cannot find symbol
  private io.flutter.plugin.common.PluginRegistry.Registrar pluginRegistrar;
                                                 ^
  symbol:   class Registrar
  location: interface PluginRegistry
AppData\Local\Pub\Cache\hosted\pub.dev\geolocator_android-4.3.1\android\src\main\java\com\baseflow\geolocator\GeolocatorPlugin.java:78: error: cannot find symbol
  public static void registerWith(io.flutter.plugin.common.PluginRegistry.Registrar registrar) {
                                                                         ^
  symbol:   class Registrar
  location: interface PluginRegistry
2 errors

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':geolocator_android:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

* 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.

* Get more help at https://help.gradle.org

BUILD FAILED in 48s

@TimHoogstrate
Copy link
Contributor

TimHoogstrate commented Mar 18, 2025

@matheusbristot, @pettymn, @ebot64 It should be resolved in the new(er) versions. Please upgrade the geolocator_android package to 4.6.2 or 5.0.0.

Kind regards,

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

No branches or pull requests

4 participants