-
-
Notifications
You must be signed in to change notification settings - Fork 874
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
Not working when start Flutter Engine with FlutterFragment #241
Comments
Thank you for submitting this issue. Would you be able to supply a small example which reproduces this bug? Also which version of the plugin are you using? We did implement support for Add-2-app features since 4.4.0. |
I am asking for an example since I am not sure what you mean with “start FlutterEngine with FlutterFragment” |
I'm using plugin ver 4.4.0+hotfix.2. I'm import my flutter project as a module inside Android native app. Example code start FlutterEngine with FlutterFragment:public class VietJetFlutterFragment extends FlutterFragment {
@Override
public FlutterEngine provideFlutterEngine(Context context) {
FlutterEngine flutterEngine = new FlutterEngine(context);
flutterEngine.getDartExecutor().executeDartEntrypoint(
DartExecutor.DartEntrypoint.createDefault()
);
GeneratedPluginRegistrant.registerWith(flutterEngine);
return flutterEngine;
}
} I added FlutterFragment to an AppcompatActivity
Generated code from Flutter Engine: @Keep
public final class GeneratedPluginRegistrant {
public static void registerWith(@NonNull FlutterEngine flutterEngine) {
ShimPluginRegistry shimPluginRegistry = new ShimPluginRegistry(flutterEngine);
flutter.plugins.contactsservice.contactsservice.ContactsServicePlugin.registerWith(shimPluginRegistry.registrarFor("flutter.plugins.contactsservice.contactsservice.ContactsServicePlugin"));
flutterEngine.getPlugins().add(new io.flutter.plugins.deviceinfo.DeviceInfoPlugin());
io.github.ponnamkarthik.toast.fluttertoast.FluttertoastPlugin.registerWith(shimPluginRegistry.registrarFor("io.github.ponnamkarthik.toast.fluttertoast.FluttertoastPlugin"));
io.scer.pdf.renderer.NativePDFRendererPlugin.registerWith(shimPluginRegistry.registrarFor("io.scer.pdf.renderer.NativePDFRendererPlugin"));
flutterEngine.getPlugins().add(new io.flutter.plugins.pathprovider.PathProviderPlugin());
flutterEngine.getPlugins().add(new com.baseflow.permissionhandler.PermissionHandlerPlugin());
flutterEngine.getPlugins().add(new io.flutter.plugins.sharedpreferences.SharedPreferencesPlugin());
flutterEngine.getPlugins().add(new io.flutter.plugins.urllauncher.UrlLauncherPlugin());
}
} |
I have same issue. I use flutter module as aar and import into android project as a fragment. Android 9 and earlier working fine. But android 10, sometimes it will ask permission, sometimes doesn't. I don't know why. Error: [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: PlatformException(PermissionHandler.PermissionManager, Android activity is required to check for permissions and cannot be null., null) |
Any suggestion on this issue? Currently having this issue with steps explained above. |
Same issue here, |
Do we have any update here ? :) |
🐛 Bug Report
Maybe method startListening() not being called when I start flutter engine with FlutterFragment. Because doesn't fired on onAttachedToActivity(@nonnull ActivityPluginBinding binding)?
So I getting this exception when trying to check permission: MissingPluginException(No implementation found for method checkPermissionStatus on channel flutter.baseflow.com/permissions/methods).
Expected behavior
Reproduction steps
When I call :
final PermissionStatus statusFuture = await PermissionHandler()
.checkPermissionStatus(PermissionGroup.contacts);
I getting this error:
[ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: MissingPluginException(No implementation found for method checkPermissionStatus on channel flutter.baseflow.com/permissions/methods) #0 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:319:7) <asynchronous suspension> #1 MethodChannelPermissionHandler.checkPermissionStatus (package:permission_handler_platform_interface/src/method_channel/method_channel_permission_handler.dart:19:41) #2 PermissionHandler.checkPermissionStatus (package:permission_handler/permission_handler.dart:21:47) #3 InputCustomerInfoBloc._checkContactPermission (package:wallet_vietjet/src/blocs/input_customer_info_bloc.dart:384:10) #4 InputCustomerInfoBloc.requestOpenContact (package:wallet_vietjet/src/blocs/input_customer_info_bloc.dart:368:37) #5 _TextInputWidgetState._getRowChildren.<anonymous closure> (package:wallet_vietjet/src/ui/screens/input_customer_info_screen.dart:569:31) #6 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:182:24) #7 TapGestureRecognizer.handleTapUp (package:flutter/src/gestures/tap.dart:486:11) #8 BaseTapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:264:5) #9 BaseTapGestureRecognizer.acceptGesture (package:flutter/src/gestures/tap.dart:236:7) #10 GestureArenaManager.sweep (package:flutter/src/gestures/arena.dart:156:27) #11 GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:222:20) #12 GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:198:22) #13 GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dart:156:7) #14 GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:102:7) #15 GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:86:7) #16 _rootRunUnary (dart:async/zone.dart:1138:13) #17 _CustomZone.runUnary (dart:async/zone.dart:1031:19) #18 _CustomZone.runUnaryGuarded (dart:async/zone.dart:933:7) #19 _invoke1 (dart:ui/hooks.dart:273:10) #20 _dispatchPointerDataPacket (dart:ui/hooks.dart:182:5)
Configuration
Platform:
The text was updated successfully, but these errors were encountered: