rekabhq / background_locator

A Flutter plugin for updating location in background.
MIT License
287 stars 321 forks source link

Issue on release build #352

Closed hpsolver closed 1 year ago

hpsolver commented 1 year ago

E/flutter ( 5395): [ERROR:flutter/shell/common/shell.cc(93)] Dart Error: Dart_LookupLibrary: library 'package:location_sharing/location_callback_handler.dart' not found.

bornakpaul commented 1 year ago

use @pragma("vm:entry-point") before the class or function, so that the compiler knows that this particular class/function will be used from native code

hpsolver commented 1 year ago

@bornakpaul by adding "@pragma("vm:entry-point")" is fixed last crash. But now release build not updating latlng on firebase.

here is my code it's working fine only debug build : Future callback(LocationDto locationDto) async { print('$_count location in dart: ${locationDto.toString()}'); await Firebase.initializeApp(); FirebaseReference.userSecret.doc(Globals.firebaseUser?.uid).update( {"latitude": locationDto.latitude, "longitude": locationDto.longitude}); final SendPort? send = IsolateNameServer.lookupPortByName(isolateName); send?.send(locationDto); _count++; }

bornakpaul commented 1 year ago

@hpsolver i am on flutter 3.0.5 and it works fine for me.

hpsolver commented 1 year ago

@bornakpaul my flutter version is 3.3.3

hpsolver commented 1 year ago

@bornakpaul could you help me on this version ?

bornakpaul commented 1 year ago

@hpsolver i will have to look into this, might take some time. meanwhile, if you are in a hurry you can try to degrade the version and check

hpsolver commented 1 year ago

okay i will

hpsolver commented 1 year ago

@bornakpaul thanks on flutter 3.0.5 is working fine