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

[ios] Call back is not working in release mode #41

Closed
Faisalkc4u opened this issue Sep 15, 2022 · 14 comments
Closed

[ios] Call back is not working in release mode #41

Faisalkc4u opened this issue Sep 15, 2022 · 14 comments
Labels
bug Something isn't working

Comments

@Faisalkc4u
Copy link

The application is working as expected in debug mode no issues are found.

But when the ios app is running on release mode, The callback is not calling from the native side.
Even the example app is not working in release mode.

@aaqibkhaskheli
Copy link

also facing same issue on android.

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

@evaldofreu
Copy link

also facing same issue on android.

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

In Android, does same.

@as2a3
Copy link

as2a3 commented Sep 20, 2022

Also facing same issue.

I'm forced to downgrade the Flutter version to 3.0.x to make it work.
This is a temporary solution now but I am looking for a permanent solution.
If someone finds a solution, please share it quickly.
Thank you

@Faisalkc4u
Copy link
Author

Hi,
I don't know how to make this is working
So I made my own plug-in
currently only in iOS available, also still in development mode
But working fine for iOS

https://github.com/Faisalkc4u/bg_location_fetch

@mohammedX6
Copy link

I think we need to do like this: firebase/flutterfire#9446 (comment)
but i am not sure where to add this annotation.
anyone have idea ?

@kotran88
Copy link

kotran88 commented Oct 4, 2022

this makes me crazy ...T_T I developed all the function with this plugin and now I can't release it

@iamwaseemsh
Copy link

having same issue callback_handler not found

@mohammedX6
Copy link

mohammedX6 commented Oct 6, 2022

another solution:
on your method that starts background_locater (the one that starts the Isolate), please add this annotation
@pragma('vm:entry-point')

@shantaly
Copy link

any updates on releasing a fix for this issue?

@yusriltakeuchi
Copy link

Please we need an update for this issue :)

@yusriltakeuchi
Copy link

another solution: on your method that starts background_locater (the one that starts the Isolate), please add this annotation @pragma('vm:entry-point')

is that in the function when i call BackgroundLocator.registerLocationUpdate() ?

@Wian-TMC
Copy link

Wian-TMC commented Nov 9, 2022

Just tested adding @pragma('vm:entry-point') on Flutter 3.3.7 it
did not seem to make a difference, same error of:
VERBOSE-2:shell.cc(93)] Dart Error: Dart_LookupLibrary: library 'package:hero/helpers/background-location.dart' not found.

I think I am adding the @pragma('vm:entry-point') at the wrong place...

@Wian-TMC
Copy link

For anyone who also runs into this issue (Please note that @pragma('vm:entry-point') works as expected):

I used my own custom callback function, meaning that @pragma('vm:entry-point') obviously needs to be added above that function, and not above the LocationCallbackHandler's callback function as provided by the example.

For clarification

await BackgroundLocator.registerLocationUpdate(
      LocationCallbackHandler.callback,
      initCallback: YOUR_CALLBACK_FUNCTION
      ...
      ...
      ...

WhereverYOUR_CALLBACK_FUNCTION is defined, it should have @pragma('vm:entry-point') above it

@Yukams
Copy link
Owner

Yukams commented Mar 8, 2023

This has been fixed in the new version 2.0.6

@Yukams Yukams closed this as completed Mar 8, 2023
@Yukams Yukams added the bug Something isn't working label Mar 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests