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

[Bug]: Fatal Exception when running on Android SDK < 29 #1502

Closed
3 of 8 tasks
pamafe1976 opened this issue May 13, 2024 · 2 comments
Closed
3 of 8 tasks

[Bug]: Fatal Exception when running on Android SDK < 29 #1502

pamafe1976 opened this issue May 13, 2024 · 2 comments

Comments

@pamafe1976
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

When my app starts the Geolocator listeners:

      positionStream = GeolocatorPlatform.instance.getPositionStream(locationSettings: settings).handleError((error) => _positionErrorGPS(error)).listen(
            (data) => _nuevaPosicionGPS(data),
          );
      serviceStream = GeolocatorPlatform.instance.getServiceStatusStream().handleError((error) => _serviceErrorGPS(error)).listen(
            (data) => _nuevoStatusGPS(data),
          );

It exist with the following exception:

D/AndroidRuntime( 3882): Shutting down VM
E/AndroidRuntime( 3882): FATAL EXCEPTION: main
E/AndroidRuntime( 3882): Process: com.pmf.testapp, PID: 3882
E/AndroidRuntime( 3882): java.lang.AbstractMethodError: abstract method "void android.location.LocationListener.onStatusChanged(java.lang.String, int, android.os.Bundle)"
E/AndroidRuntime( 3882): 	at android.location.LocationManager$ListenerTransport._handleMessage(LocationManager.java:299)
E/AndroidRuntime( 3882): 	at android.location.LocationManager$ListenerTransport.-wrap0(Unknown Source:0)
E/AndroidRuntime( 3882): 	at android.location.LocationManager$ListenerTransport$1.handleMessage(LocationManager.java:237)
E/AndroidRuntime( 3882): 	at android.os.Handler.dispatchMessage(Handler.java:106)
E/AndroidRuntime( 3882): 	at android.os.Looper.loop(Looper.java:164)
E/AndroidRuntime( 3882): 	at android.app.ActivityThread.main(ActivityThread.java:6494)
E/AndroidRuntime( 3882): 	at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime( 3882): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
E/AndroidRuntime( 3882): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
Lost connection to device.

Expected results

Expect package to work with sdk < 29

Actual results

FATAL EXCEPTION

Code sample

Code sample
[Paste your code here]

Screenshots or video

Screenshots or video demonstration

[Upload media here]

Version

11.0.0

Flutter Doctor output

Doctor output
[✓] Flutter (Channel stable, 3.19.6, on macOS 14.4.1 23E224 darwin-arm64, locale
    es-AR)
    • Flutter version 3.19.6 on channel stable at /Users/pablo/Proyectos/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 54e66469a9 (4 weeks ago), 2024-04-17 13:08:03 -0700
    • Engine revision c4cd48e186
    • Dart version 3.3.4
    • DevTools version 2.31.1

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/pablo/Library/Android/sdk
    • Platform android-34, build-tools 34.0.0
    • ANDROID_HOME = /Users/pablo/Library/Android/sdk
    • ANDROID_SDK_ROOT = /Users/pablo/Library/Android/sdk
    • Java binary at: /Applications/Android
      Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build
      17.0.10+0-17.0.10b1087.21-11572160)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15E204a
    • CocoaPods version 1.15.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2023.3)
    • 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
      17.0.10+0-17.0.10b1087.21-11572160)

[✓] VS Code (version 1.89.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.89.20240501

[✓] Connected device (3 available)
    • iPhone de Pablo (mobile) • 00008110-001E38D03651801E • ios            •
      iOS 17.4.1 21E236
    • macOS (desktop)          • macos                     • darwin-arm64   •
      macOS 14.4.1 23E224 darwin-arm64
    • Chrome (web)             • chrome                    • web-javascript •
      Google Chrome 124.0.6367.201

[✓] Network resources
    • All expected network resources are available.

• No issues found!
@pamafe1976
Copy link
Author

I don't know if this is relevant, but my app starts the geolocator listeners from within a foreground task.

@pamafe1976
Copy link
Author

The problem was another package that is also using location services. Nothing to do with Geolocator

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

1 participant