flutterlocation icon indicating copy to clipboard operation
flutterlocation copied to clipboard

Side effects with firebase messaging library

Open fl-oe opened this issue 6 years ago • 3 comments

Describtion I am using firebase_messaging 6.0.13. I also want to add this location library. When I add the location library dependency to pubspec.yaml I got an exception. This exception is a typical for the firebase_messaging library, but I could fix it bevor using location library. My steps before:

  • Implement firebase_messaging
  • fixing known bug
  • added location library to pubspec.yaml
  • flutter get
  • try to run the app on emulator
  • --> exception

Expected behavior I want to use the location library to write user location to firebase database.

Tested on:

  • Android, API Level 27, Android Emulator Pixel 2

Other plugins:

  • firebase_messaging: 6.0.13 (Send messages to user)

Exception

E/flutter (25041): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: PlatformException(error, Attempt to invoke virtual method 'android.os.Looper android.app.Activity.getMainLooper()' on a null object reference, null)
E/flutter (25041): #0      StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:569:7)
E/flutter (25041): #1      MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:321:33)
E/flutter (25041): <asynchronous suspension>
E/flutter (25041): #2      FirebaseMessaging.configure (package:firebase_messaging/firebase_messaging.dart:130:16)
E/flutter (25041): #3      FirebaseHandling.initFirebaseHandling (package:fwbrk_flutter/custom/firebase_handling.dart:126:24)
E/flutter (25041): #4      _RootPageState.initializeDataIfUserLoggedInSuccessfully (package:fwbrk_flutter/pages/root_page.dart:85:22)
E/flutter (25041): #5      _asyncThenWrapperHelper.<anonymous closure> (dart:async-patch/async_patch.dart:73:64)
E/flutter (25041): #6      _rootRunUnary (dart:async/zone.dart:1134:38)
E/flutter (25041): #7      _CustomZone.runUnary (dart:async/zone.dart:1031:19)
E/flutter (25041): #8      _FutureListener.handleValue (dart:async/future_impl.dart:139:18)
E/flutter (25041): #9      Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:680:45)
E/flutter (25041): #10     Future._propagateToListeners (dart:async/future_impl.dart:709:32)
E/flutter (25041): #11     Future._completeWithValue (dart:async/future_impl.dart:524:5)
E/flutter (25041): #12     Future._asyncComplete.<anonymous closure> (dart:async/future_impl.dart:554:7)
E/flutter (25041): #13     _rootRun (dart:async/zone.dart:1126:13)
E/flutter (25041): #14     _CustomZone.run (dart:async/zone.dart:1023:19)
E/flutter (25041): #15     _CustomZone.runGuarded (dart:async/zone.dart:925:7)
E/flutter (25041): #16     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:965:23)
E/flutter (25041): #17     _microtaskLoop (dart:async/schedule_microtask.dart:43:21)
E/flutter (25041): #18     _startMicrotaskLoop (dart:async/schedule_microtask.dart:52:5)

I know my exception is a exception from firebase_messaging. But maybe someone knows whether these two libraries influence each other.

fl-oe avatar Apr 15 '20 17:04 fl-oe

Huuum, I'm using api 'com.google.android.gms:play-services-location:16.+', maybe it causes a compatibility issue ?

Lyokone avatar Apr 20 '20 07:04 Lyokone

Hi. That could not fix my issue. I think pull request #314 could maybe fix my issue.

fl-oe avatar Apr 20 '20 17:04 fl-oe

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar May 20 '20 17:05 stale[bot]