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

Force-close application when first asking permission #12

Open
yusrenaltair opened this issue Feb 3, 2020 · 6 comments
Open

Force-close application when first asking permission #12

yusrenaltair opened this issue Feb 3, 2020 · 6 comments

Comments

@yusrenaltair
Copy link

I have tested your package and it works only on Android version 10. In version 6 (M), the application always forces close when first asking the user to give READ_PHONE access.
I haven't tried other versions except those I have mentioned above

@zgramming
Copy link

Same Issue here ...

Log Error

java.lang.RuntimeException: Failure delivering result ResultInfo{who=@android:requestPermissions:, request=1995, result=-1, data=Intent { act=android.content.pm.action.REQUEST_PERMISSIONS (has extras) }} to activity {id.klenger_burger/id.klenger_burger.MainActivity}: java.lang.NullPointerException: Attempt to invoke interface method 'void io.flutter.plugin.common.MethodChannel$Result.success(java.lang.Object)' on a null object reference
	at android.app.ActivityThread.deliverResults(ActivityThread.java:4196)
	at android.app.ActivityThread.handleSendResult(ActivityThread.java:4239)
	at android.app.ActivityThread.-wrap20(ActivityThread.java)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1599)
	at android.os.Handler.dispatchMessage(Handler.java:102)
	at android.os.Looper.loop(Looper.java:165)
	at android.app.ActivityThread.main(ActivityThread.java:6375)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:912)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:802)
Caused by: java.lang.NullPointerException: Attempt to invoke interface method 'void io.flutter.plugin.common.MethodChannel$Result.success(java.lang.Object)' on a null object reference
	at com.rioapp.demo.imeiplugin.ImeiPlugin.getImei(ImeiPlugin.java:77)
	at com.rioapp.demo.imeiplugin.ImeiPlugin.onRequestPermissionsResult(ImeiPlugin.java:123)
	at io.flutter.embedding.engine.FlutterEnginePluginRegistry$FlutterEngineActivityPluginBinding.onRequestPermissionsResult(FlutterEnginePluginRegistry.java:612)
	at io.flutter.embedding.engine.FlutterEnginePluginRegistry.onRequestPermissionsResult(FlutterEnginePluginRegistry.java:356)
	at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.onRequestPermissionsResult(FlutterActivityAndFragmentDelegate.java:509)
	at io.flutter.embedding.android.FlutterActivity.onRequestPermissionsResult(FlutterActivity.java:611)
	at android.app.Activity.dispatchRequestPermis

@easazade
Copy link

yes same here

@aisrael
Copy link

aisrael commented Mar 30, 2020

Same here.

@premnair
Copy link

Same here!. any suggestions ?

@DenisMrGnusa
Copy link

Same issue here,
I've fix it with, run a phone permission request before "var imei = await ImeiPlugin.getImei();".
using https://pub.dev/packages/permission_handler

@premnair
Copy link

premnair commented May 3, 2020

I had the same issue. Then used android_multiple_identifier (https://pub.dev/packages/android_multiple_identifier) instead of imei_plugin and got around the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants