Giter Club home page Giter Club logo

Comments (8)

babariviere avatar babariviere commented on July 3, 2024

Hi, are you requesting SMS permission with simple_permissions?

from flutter_sms.

zachgrayio avatar zachgrayio commented on July 3, 2024

@babariviere - nope, I'm just trying to get READ/WRITE access to external storage.

from flutter_sms.

babariviere avatar babariviere commented on July 3, 2024

Do you have any log?

from flutter_sms.

zachgrayio avatar zachgrayio commented on July 3, 2024

Sure, I'll fire that branch back up now

from flutter_sms.

zachgrayio avatar zachgrayio commented on July 3, 2024

So, what's interesting is that when I implemented simple_permissions, I'd already allowed the sms permissions so they were saved for the app and it didn't ask again; my live-reloads and even full launches of the app were fine until I uninstalled the app entirely and sms needed to request perms again.

At this point, the app boots OK, and then sms requests permissions and the android native dialog appears asking for access to phone - when I click allow, the app crashes with the following (notice it's actually simple_permissions crashing even though that code hasn't been called directly yet):

[{"event":"app.started","params":{"appId":"59ea5f7b-2c74-4fd1-818e-26fed2f76323"}}]
[  +40 ms] I/SimplePermission(23176): Requesting permission status : 0
[        ] D/AndroidRuntime(23176): Shutting down VM
[        ] E/AndroidRuntime(23176): FATAL EXCEPTION: main
[        ] E/AndroidRuntime(23176): Process: com.example.app.host, PID: 23176
[        ] E/AndroidRuntime(23176): java.lang.RuntimeException: Failure delivering result ResultInfo{who=@android:requestPermissions:, request=6, result=-1, data=Intent { act=android.content.pm.action.REQUEST_PERMISSIONS (has extras) }} to activity {com.example.app.host/com.example.app.host.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
[        ] E/AndroidRuntime(23176): 	at android.app.ActivityThread.deliverResults(ActivityThread.java:4360)
[        ] E/AndroidRuntime(23176): 	at android.app.ActivityThread.handleSendResult(ActivityThread.java:4402)
[        ] E/AndroidRuntime(23176): 	at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:49)
[        ] E/AndroidRuntime(23176): 	at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
[        ] E/AndroidRuntime(23176): 	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
[        ] E/AndroidRuntime(23176): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1808)
[        ] E/AndroidRuntime(23176): 	at android.os.Handler.dispatchMessage(Handler.java:106)
[        ] E/AndroidRuntime(23176): 	at android.os.Looper.loop(Looper.java:193)
[        ] E/AndroidRuntime(23176): 	at android.app.ActivityThread.main(ActivityThread.java:6669)
[        ] E/AndroidRuntime(23176): 	at java.lang.reflect.Method.invoke(Native Method)
[        ] E/AndroidRuntime(23176): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
[        ] E/AndroidRuntime(23176): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
[        ] E/AndroidRuntime(23176): 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
[        ] E/AndroidRuntime(23176): 	at com.ethras.simplepermissions.SimplePermissionsPlugin.onRequestPermissionsResult(SimplePermissionsPlugin.java:172)
[        ] E/AndroidRuntime(23176): 	at io.flutter.app.FlutterPluginRegistry.onRequestPermissionsResult(FlutterPluginRegistry.java:191)
[        ] E/AndroidRuntime(23176): 	at io.flutter.app.FlutterActivityDelegate.onRequestPermissionsResult(FlutterActivityDelegate.java:125)
[        ] E/AndroidRuntime(23176): 	at io.flutter.app.FlutterActivity.onRequestPermissionsResult(FlutterActivity.java:133)
[        ] E/AndroidRuntime(23176): 	at android.app.Activity.dispatchRequestPermissionsResult(Activity.java:7608)
[        ] E/AndroidRuntime(23176): 	at android.app.Activity.dispatchActivityResult(Activity.java:7458)
[        ] E/AndroidRuntime(23176): 	at android.app.ActivityThread.deliverResults(ActivityThread.java:4353)
[        ] E/AndroidRuntime(23176): 	... 11 more
[  +30 ms] I/Process (23176): Sending signal. PID: 23176 SIG: 9

from flutter_sms.

zachgrayio avatar zachgrayio commented on July 3, 2024

I'm thinking the sms plugin's native code is overwriting the simple_permissions channel perhaps?

from flutter_sms.

babariviere avatar babariviere commented on July 3, 2024

Yes I think as we have 2 different listener for permission, it cannot choose which one to use

from flutter_sms.

zachgrayio avatar zachgrayio commented on July 3, 2024

I wonder how much work it would be to make use of simple permissions to request permissions in sms to avoid a conflict

from flutter_sms.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.