0

While implementing platform specific code for Android I faced the following error.

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

1 Answer 1

1

I faced this issue while implementing platform specific code. I want to share my experience in this case.

First clean the project using

flutter clean

Then upgrade the plugins using

flutter pub get

Then run project(Not hot reload. Plugins will inject codes)

flutter run

If the problem persist again, you may be missing

GeneratedPluginRegistrant.registerWith(flutterEngine)

which you have to place here

override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) {
    //***HERE***
    GeneratedPluginRegistrant.registerWith(flutterEngine)
    MethodChannel(flutterEngine.dartExecutor.binaryMessenger, BEACON_ACTIVATE_CHANNEL).setMethodCallHandler{
        call, result ->
        when {
            call.method.equals("yourMethodName") -> {
                yourNativeFunction(call, result)
            }
        }
    }
}
Sign up to request clarification or add additional context in comments.

1 Comment

Not related, but do you mind sharing your beacon implementation? I've been having trouble setting up background monitoring. EDIT: only android is not working properly

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.