rekabhq / background_locator

A Flutter plugin for updating location in background.
MIT License
288 stars 329 forks source link

MissingPluginException(No implementation found for method getTemporaryDirectory on channel plugins.flutter.io/path_provider #181

Open siva563 opened 3 years ago

siva563 commented 3 years ago

Trying to integrate background location reade, I am getting below error:

MissingPluginException(No implementation found for method getTemporaryDirectory on channel plugins.flutter.io/path_provider

[ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: MissingPluginException(No implementation found for method getTemporaryDirectory on channel plugins.flutter.io/path_provider)

siva563 commented 3 years ago

@mehdok Could you please help me

mehdok commented 3 years ago

Hi @siva563 Thank you for opening an issue;

I think you just forgot to follow documentation for using other plugins, please go to this wiki page, Use other plugins in callback and let me know if you have any other problem;

siva563 commented 3 years ago

Could you please help, which location i have to create Application file

where this line of code should be placed ?

<application
        android:name=".Application"
mehdok commented 3 years ago

Please look at the example app;

dimas0211 commented 3 years ago

hi, @mehdok I was trying to do the same as you showed in a 'Use other plugins in callback': https://github.com/rekab-app/background_locator/wiki/Use-other-plugins-in-callback

But I receive an error : 'MainActivity.kt: (13, 30): Unresolved reference: setPluginRegistrant'in a line 'IsolateHolderService.setPluginRegistrant(this)'.

I need it to trigger the graphQl mutation while background. on iOS it works fine, but Android throws errors related to 'path_provider'

mehdok commented 3 years ago

Did you imported the ‘IsolateHolderSetvice’? You can find the import line in the example app.

dimas0211 commented 3 years ago

Did you imported the ‘IsolateHolderSetvice’? You can find the import line in the example app.

Yes, I did.

mehdok commented 3 years ago

As you can see the method that you are looking for is here setPluginRegistrant

So I’m not sure what is wrong with your code. It would be nice if you could open a new issue and share some code;

dimas0211 commented 3 years ago

@mehdok thanks for a reply!

I opened a new issue and would be happy if you could help me out :)

https://github.com/rekab-app/background_locator/issues/202

ventseslav8 commented 2 years ago

Hello! I have the same error. The strange is that it was working fine some weeks ago and now it shows this thing everytime when it is trying to find location. All dart files also all dependencies from pubspec from the example app are included. Also Setup for android is done.

`E/flutter (21013): [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: MissingPluginException(No implementation found for method getTemporaryDirectory on channel plugins.flutter.io/path_provider)

E/flutter (21013): #0      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:175:7)
E/flutter (21013): <asynchronous suspension>

E/flutter (21013): #1      getTemporaryDirectory (package:path_provider/path_provider.dart:55:24)
E/flutter (21013): <asynchronous suspension>

E/flutter (21013): #2      FileManager._getTempLogFile (package:flutter_app/file_manager.dart:17:23)
E/flutter (21013): <asynchronous suspension>

E/flutter (21013): #3      FileManager.writeToLogFile (package:flutter_app/file_manager.dart:7:18)
E/flutter (21013): <asynchronous suspension>

E/flutter (21013): #4      LocationServiceRepository.setLogLabel (package:flutter_app/location_service_repository.dart:65:5)
E/flutter (21013): <asynchronous suspension>

E/flutter (21013): #5      LocationServiceRepository.init (package:flutter_app/location_service_repository.dart:41:5)
E/flutter (21013): <asynchronous suspension>

E/flutter (21013): #6      LocationCallbackHandler.initCallback (package:flutter_app/location_callback_handler.dart:11:5)
E/flutter (21013): <asynchronous suspension>
E/flutter (21013): 

`

p1pahareAlpha commented 2 years ago

I am receiving this error on both Android and iOS applications, can you please help. on both System I am running flutter version 2.10+. the callback is running and also same code is working on the Main isolate.

[MissingPluginException(No implementation found for method getTemporaryDirectory on channel plugins.flutter.io/path_provider]

p1pahareAlpha commented 2 years ago

the problem started occurring when I ran command flutter pub upgrade. I used this solution and It worked

https://github.com/flutter/flutter/issues/99155#issuecomment-1052023743

umerfarooq7111 commented 2 years ago

I'm getting same issue. i have run the example. my sdk is >=2.7.0 <3.0.0. Any body can help me?

ventseslav8 commented 2 years ago

This helps for android: if (Platform.isAndroid) PathProviderAndroid.registerWith(); Place it before using the functions. And still not tested but this should help for IOS: if (Platform.isIOS) PathProviderIOS.registerWith();

Also for more information follow the link from the previous comment, the link is link.