jaumard / sms_autofill

Flutter plugin to provide SMS code autofill support
MIT License
289 stars 183 forks source link

When click on Phone number, app getting closed #22

Open rinkuanuragkumar opened 4 years ago

rinkuanuragkumar commented 4 years ago

In requestPhoneHint, when click on phone number or anywhere on popup widget, app is getting closed.

DhruvamSharma commented 4 years ago

Same here!

I got this error. When I turned autofocus off, even then the same error occurred.

I/flutter ( 7532): ══╡ EXCEPTION CAUGHT BY FOUNDATION LIBRARY ╞════════════════════════════════════════════════════════ I/flutter ( 7532): The following assertion was thrown while dispatching notifications for FocusNode: I/flutter ( 7532): RenderBox was not laid out: RenderEditable#0cf58 NEEDS-LAYOUT NEEDS-PAINT I/flutter ( 7532): 'package:flutter/src/rendering/box.dart': I/flutter ( 7532): Failed assertion: line 1687 pos 12: 'hasSize' I/flutter ( 7532): I/flutter ( 7532): Either the assertion indicates an error in the framework itself, or we should provide substantially I/flutter ( 7532): more information in this error message to help you determine and fix the underlying cause. I/flutter ( 7532): In either case, please report this assertion by filing a bug on GitHub: I/flutter ( 7532): https://github.com/flutter/flutter/issues/new?template=BUG.md I/flutter ( 7532): I/flutter ( 7532): When the exception was thrown, this was the stack: I/flutter ( 7532): #2 RenderBox.size (package:flutter/src/rendering/box.dart:1687:12) I/flutter ( 7532): #3 EditableTextState._updateSizeAndTransform (package:flutter/src/widgets/editable_text.dart:1729:40) I/flutter ( 7532): #4 EditableTextState._openInputConnection (package:flutter/src/widgets/editable_text.dart:1415:7) I/flutter ( 7532): #5 EditableTextState._openOrCloseInputConnectionIfNeeded (package:flutter/src/widgets/editable_text.dart:1441:7) I/flutter ( 7532): #6 EditableTextState._handleFocusChanged (package:flutter/src/widgets/editable_text.dart:1707:5) I/flutter ( 7532): #7 ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart:206:21) I/flutter ( 7532): #8 FocusNode._notify (package:flutter/src/widgets/focus_manager.dart:808:5) I/flutter ( 7532): #9 FocusManager._applyFocusChange (package:flutter/src/widgets/focus_manager.dart:1401:12) I/flutter ( 7532): (elided 12 frames from class _AssertionError and package dart:async) I/flutter ( 7532): I/flutter ( 7532): The FocusNode sending notification was: I/flutter ( 7532): FocusNode#a2ce8 I/flutter ( 7532): ════════════════════════════════════════════════════════════════════════════════════════════════════

clickervinod commented 4 years ago

hi, I am too facing same issue

E/AndroidRuntime( 5035): java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=11012, result=1002, data=Intent { }} to activity {com.example.hello_word/com.example.hello_word.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( 5035): at android.app.ActivityThread.deliverResults(ActivityThread.java:4845) E/AndroidRuntime( 5035): at android.app.ActivityThread.handleSendResult(ActivityThread.java:4886) E/AndroidRuntime( 5035): at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:51) E/AndroidRuntime( 5035): at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) E/AndroidRuntime( 5035): at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) E/AndroidRuntime( 5035): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016) E/AndroidRuntime( 5035): at android.os.Handler.dispatchMessage(Handler.java:107) E/AndroidRuntime( 5035): at android.os.Looper.loop(Looper.java:214) E/AndroidRuntime( 5035): at android.app.ActivityThread.main(ActivityThread.java:7356) E/AndroidRuntime( 5035): at java.lang.reflect.Method.invoke(Native Method) E/AndroidRuntime( 5035): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492) E/AndroidRuntime( 5035): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930) E/AndroidRuntime( 5035): 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 I/flutter ( 5035): onChange I/flutter ( 5035): onchanged W/IInputConnectionWrapper( 5035): getTextBeforeCursor on inactive InputConnection W/IInputConnectionWrapper( 5035): getSelectedText on inactive InputConnection W/IInputConnectionWrapper( 5035): getTextAfterCursor on inactive InputConnection D/AndroidRuntime( 5035): Shutting down VM E/AndroidRuntime( 5035): FATAL EXCEPTION: main E/AndroidRuntime( 5035): Process: com.example.hello_word, PID: 5035 E/AndroidRuntime( 5035): at com.jaumard.smsautofill.SmsAutoFillPlugin$1.onActivityResult(SmsAutoFillPlugin.java:66) E/AndroidRuntime( 5035): at io.flutter.embedding.engine.FlutterEnginePluginRegistry$FlutterEngineActivityPluginBinding.onActivityResult(FlutterEnginePluginRegistry.java:634) E/AndroidRuntime( 5035): at io.flutter.embedding.engine.FlutterEnginePluginRegistry.onActivityResult(FlutterEnginePluginRegistry.java:367) E/AndroidRuntime( 5035): at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.onActivityResult(FlutterActivityAndFragmentDelegate.java:546) E/AndroidRuntime( 5035): at io.flutter.embedding.android.FlutterActivity.onActivityResult(FlutterActivity.java:594) E/AndroidRuntime( 5035): at android.app.Activity.dispatchActivityResult(Activity.java:8110) E/AndroidRuntime( 5035): at android.app.ActivityThread.deliverResults(ActivityThread.java:4838) E/AndroidRuntime( 5035): ... 11 more I/Process ( 5035): Sending signal. PID: 5035 SIG: 9 Lost connection to device. Exited (sigterm)

kbrmimbyl commented 4 years ago

Did you guys figure out how to fix this? I'm seeing the same problem. This is only in the androidx version. In the first version 0.0.1 everything is fine!

jaumard commented 4 years ago

Anyone can tell me if branch bugfix/#22 works please ? should be ok with that fix :) if you confirm I'm merging and release it

kbrmimbyl commented 4 years ago

Hold on tight. I'm on the job :-)

kbrmimbyl commented 4 years ago

It's still crashing :-(

jaumard commented 4 years ago

I will need a reproducible example project them... because I don't have any crash on the example app with that branch :/

kbrmimbyl commented 4 years ago

This is the error I see on my Redmi Note 4:

java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=11012, result=1002, data=Intent {  }} to activity {com.example.production/com.example.production.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.jaumard.smsautofill.SmsAutoFillPlugin$1.onActivityResult(SmsAutoFillPlugin.java:68) at io.flutter.embedding.engine.FlutterEnginePluginRegistry$FlutterEngineActivityPluginBinding.onActivityResult(FlutterEnginePluginRegistry.java:634) at io.flutter.embedding.engine.FlutterEnginePluginRegistry.onActivityResult(FlutterEnginePluginRegistry.java:367) at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.onActivityResult(FlutterActivityAndFragmentDelegate.java:546) at io.flutter.embedding.android.FlutterActivity.onActivityResult(FlutterActivity.java:594) at android.app.Activity.dispatchActivityResult(Activity.java:7109) at android.app.ActivityThread.deliverResults(ActivityThread.java:4192) ... 9 more

Maybe this has something to do with the Gradle plugin versions, etc. I'll check it out tomorrow with your example app.

kbrmimbyl commented 4 years ago

BTW this is how I'm referring to your fix:

  sms_autofill:
    git:
      url: "https://github.com/jaumard/sms_autofill.git"
      ref: "a24af8263dce36c4b6744bc80253952d97602846"

Okay?

jaumard commented 4 years ago

Not sure @kbrmimbyl better use this:

sms_autofill:
    git:
      url: https://github.com/jaumard/sms_autofill.git
      ref: bugfix/#22

Let me know how it goes

jaumard commented 4 years ago

@kbrmimbyl any news ?

kbrmimbyl commented 4 years ago

@jaumard, checking your example app right now. Will update.

kbrmimbyl commented 4 years ago

Just completed testing. The example app crashes.

When I run your example app as it is, I see flutter's Red Screen of Death (I have the latest flutter version 1.12.13+hotfix.7):

Restarted application in 901ms. I/flutter (30502): ══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════ I/flutter (30502): The following assertion was thrown building TextFieldPinAutoFill(dirty, state: I/flutter (30502): _TextFieldPinAutoFillState#fc88b): I/flutter (30502): 'package:flutter/src/material/text_field.dart': Failed assertion: line 331 pos 15: 'obscureText != I/flutter (30502): null': is not true. I/flutter (30502): I/flutter (30502): Either the assertion indicates an error in the framework itself, or we should provide substantially I/flutter (30502): more information in this error message to help you determine and fix the underlying cause. I/flutter (30502): In either case, please report this assertion by filing a bug on GitHub: I/flutter (30502): https://github.com/flutter/flutter/issues/new?template=BUG.md I/flutter (30502): I/flutter (30502): The relevant error-causing widget was: I/flutter (30502): TextFieldPinAutoFill I/flutter (30502): I/flutter (30502): I/flutter (30502): When the exception was thrown, this was the stack: I/flutter (30502): #2 new TextField I/flutter (30502): #3 _TextFieldPinAutoFillState.build I/flutter (30502): #4 StatefulElement.build I/flutter (30502): #5 ComponentElement.performRebuild I/flutter (30502): #6 Element.rebuild I/flutter (30502): #7 ComponentElement._firstBuild I/flutter (30502): #8 StatefulElement._firstBuild I/flutter (30502): #9 ComponentElement.mount I/flutter (30502): #10 Element.inflateWidget I/flutter (30502): #11 MultiChildRenderObjectElement.mount I/flutter (30502): #12 Element.inflateWidget I/flutter (30502): #13 Element.updateChild I/flutter (30502): #14 SingleChildRenderObjectElement.mount I/flutter (30502): #15 Element.inflateWidget I/flutter (30502): #16 Element.updateChild I/flutter (30502): #17 ComponentElement.performRebuild I/flutter (30502): #18 Element.rebuild I/flutter (30502): #19 ComponentElement._firstBuild I/flutter (30502): #20 ComponentElement.mount I/flutter (30502): #21 Element.inflateWidget I/flutter (30502): #22 Element.updateChild I/flutter (30502): #23 ComponentElement.performRebuild I/flutter (30502): #24 Element.rebuild I/flutter (30502): #25 ComponentElement._firstBuild I/flutter (30502): #26 ComponentElement.mount I/flutter (30502): #27 Element.inflateWidget I/flutter (30502): #28 Element.updateChild I/flutter (30502): #29 ComponentElement.performRebuild I/flutter (30502): #30 Element.rebuild I/flutter (30502): #31 ComponentElement._firstBuild I/flutter (30502): #32 ComponentElement.mount I/flutter (30502): #33 ParentDataElement.mount I/flutter (30502): #34 Element.inflateWidget I/flutter (30502): #35 MultiChildRenderObjectElement.mount I/flutter (30502): #36 Element.inflateWidget I/flutter (30502): #37 Element.updateChild I/flutter (30502): #38 ComponentElement.performRebuild I/flutter (30502): #39 Element.rebuild I/flutter (30502): #40 ComponentElement._firstBuild I/flutter (30502): #41 StatefulElement._firstBuild I/flutter (30502): #42 ComponentElement.mount I/flutter (30502): #43 Element.inflateWidget I/flutter (30502): #44 Element.updateChild I/flutter (30502): #45 ComponentElement.performRebuild I/flutter (30502): #46 Element.rebuild I/flutter (30502): #47 ComponentElement._firstBuild I/flutter (30502): #48 ComponentElement.mount I/flutter (30502): #49 Element.inflateWidget I/flutter (30502): #50 Element.updateChild I/flutter (30502): #51 ComponentElement.performRebuild I/flutter (30502): #52 Element.rebuild I/flutter (30502): #53 ComponentElement._firstBuild I/flutter (30502): #54 StatefulElement._firstBuild I/flutter (30502): #55 ComponentElement.mount I/flutter (30502): #56 Element.inflateWidget I/flutter (30502): #57 Element.updateChild I/flutter (30502): #58 SingleChildRenderObjectElement.mount I/flutter (30502): #59 Element.inflateWidget I/flutter (30502): #60 Element.updateChild I/flutter (30502): #61 ComponentElement.performRebuild I/flutter (30502): #62 Element.rebuild I/flutter (30502): #63 ComponentElement._firstBuild I/flutter (30502): #64 ComponentElement.mount I/flutter (30502): #65 Element.inflateWidget I/flutter (30502): #66 Element.updateChild I/flutter (30502): #67 SingleChildRenderObjectElement.mount I/flutter (30502): #68 Element.inflateWidget I/flutter (30502): #69 Element.updateChild I/flutter (30502): #70 ComponentElement.performRebuild I/flutter (30502): #71 Element.rebuild I/flutter (30502): #72 ComponentElement._firstBuild I/flutter (30502): #73 StatefulElement._firstBuild I/flutter (30502): #74 ComponentElement.mount I/flutter (30502): #75 Element.inflateWidget I/flutter (30502): #76 Element.updateChild I/flutter (30502): #77 ComponentElement.performRebuild I/flutter (30502): #78 Element.rebuild I/flutter (30502): #79 ComponentElement._firstBuild I/flutter (30502): #80 StatefulElement._firstBuild I/flutter (30502): #81 ComponentElement.mount I/flutter (30502): #82 Element.inflateWidget I/flutter (30502): #83 Element.updateChild I/flutter (30502): #84 ComponentElement.performRebuild I/flutter (30502): #85 Element.rebuild I/flutter (30502): #86 ComponentElement._firstBuild I/flutter (30502): #87 ComponentElement.mount I/flutter (30502): #88 Element.inflateWidget I/flutter (30502): #89 Element.updateChild I/flutter (30502): #90 ComponentElement.performRebuild I/flutter (30502): #91 Element.rebuild I/flutter (30502): #92 ComponentElement._firstBuild I/flutter (30502): #93 ComponentElement.mount I/flutter (30502): #94 Element.inflateWidget I/flutter (30502): #95 Element.updateChild I/flutter (30502): #96 ComponentElement.performRebuild I/flutter (30502): #97 Element.rebuild I/flutter (30502): #98 ComponentElement._firstBuild I/flutter (30502): #99 StatefulElement._firstBuild I/flutter (30502): #100 ComponentElement.mount I/flutter (30502): #101 Element.inflateWidget I/flutter (30502): #102 Element.updateChild I/flutter (30502): #103 SingleChildRenderObjectElement.mount I/flutter (30502): #104 Element.inflateWidget I/flutter (30502): #105 Element.updateChild I/flutter (30502): #106 ComponentElement.performRebuild I/flutter (30502): #107 Element.rebuild I/flutter (30502): #108 ComponentElement._firstBuild I/flutter (30502): #109 ComponentElement.mount I/flutter (30502): #110 Element.inflateWidget I/flutter (30502): #111 Element.updateChild I/flutter (30502): #112 SingleChildRenderObjectElement.mount I/flutter (30502): #113 Element.inflateWidget I/flutter (30502): #114 Element.updateChild I/flutter (30502): #115 SingleChildRenderObjectElement.mount I/flutter (30502): #116 Element.inflateWidget I/flutter (30502): #117 Element.updateChild I/flutter (30502): #118 ComponentElement.performRebuild I/flutter (30502): #119 Element.rebuild I/flutter (30502): #120 ComponentElement._firstBuild I/flutter (30502): #121 StatefulElement._firstBuild I/flutter (30502): #122 ComponentElement.mount I/flutter (30502): #123 Element.inflateWidget I/flutter (30502): #124 Element.updateChild I/flutter (30502): #125 SingleChildRenderObjectElement.mount I/flutter (30502): #126 Element.inflateWidget I/flutter (30502): #127 Element.updateChild I/flutter (30502): #128 SingleChildRenderObjectElement.mount I/flutter (30502): #129 Element.inflateWidget I/flutter (30502): #130 Element.updateChild I/flutter (30502): #131 ComponentElement.performRebuild I/flutter (30502): #132 Element.rebuild I/flutter (30502): #133 ComponentElement._firstBuild I/flutter (30502): #134 StatefulElement._firstBuild I/flutter (30502): #135 ComponentElement.mount I/flutter (30502): #136 Element.inflateWidget I/flutter (30502): #137 Element.updateChild I/flutter (30502): #138 ComponentElement.performRebuild I/flutter (30502): #139 Element.rebuild I/flutter (30502): #140 ComponentElement._firstBuild I/flutter (30502): #141 ComponentElement.mount I/flutter (30502): #142 Element.inflateWidget I/flutter (30502): #143 Element.updateChild I/flutter (30502): #144 ComponentElement.performRebuild I/flutter (30502): #145 Element.rebuild I/flutter (30502): #146 ComponentElement._firstBuild I/flutter (30502): #147 StatefulElement._firstBuild I/flutter (30502): #148 ComponentElement.mount I/flutter (30502): #149 Element.inflateWidget I/flutter (30502): #150 Element.updateChild I/flutter (30502): #151 SingleChildRenderObjectElement.mount I/flutter (30502): #152 Element.inflateWidget I/flutter (30502): #153 Element.updateChild I/flutter (30502): #154 ComponentElement.performRebuild I/flutter (30502): #155 Element.rebuild I/flutter (30502): #156 ComponentElement._firstBuild I/flutter (30502): #157 ComponentElement.mount I/flutter (30502): #158 Element.inflateWidget I/flutter (30502): #159 Element.updateChild I/flutter (30502): #160 SingleChildRenderObjectElement.mount I/flutter (30502): #161 Element.inflateWidget I/flutter (30502): #162 Element.updateChild I/flutter (30502): #163 ComponentElement.performRebuild I/flutter (30502): #164 Element.rebuild I/flutter (30502): #165 ComponentElement._firstBuild I/flutter (30502): #166 StatefulElement._firstBuild I/flutter (30502): #167 ComponentElement.mount I/flutter (30502): #168 Element.inflateWidget I/flutter (30502): #169 Element.updateChild I/flutter (30502): #170 ComponentElement.performRebuild I/flutter (30502): #171 Element.rebuild I/flutter (30502): #172 ComponentElement._firstBuild I/flutter (30502): #173 ComponentElement.mount I/flutter (30502): #174 Element.inflateWidget I/flutter (30502): #175 Element.updateChild I/flutter (30502): #176 SingleChildRenderObjectElement.mount I/flutter (30502): #177 Element.inflateWidget I/flutter (30502): #178 Element.updateChild I/flutter (30502): #179 ComponentElement.performRebuild I/flutter (30502): #180 Element.rebuild I/flutter (30502): #181 ComponentElement._firstBuild I/flutter (30502): #182 ComponentElement.mount I/flutter (30502): #183 Element.inflateWidget I/flutter (30502): #184 Element.updateChild I/flutter (30502): #185 ComponentElement.performRebuild I/flutter (30502): #186 Element.rebuild I/flutter (30502): #187 ComponentElement._firstBuild I/flutter (30502): #188 StatefulElement._firstBuild I/flutter (30502): #189 ComponentElement.mount I/flutter (30502): #190 Element.inflateWidget I/flutter (30502): #191 Element.updateChild I/flutter (30502): #192 ComponentElement.performRebuild I/flutter (30502): #193 Element.rebuild I/flutter (30502): #194 ComponentElement._firstBuild I/flutter (30502): #195 StatefulElement._firstBuild I/flutter (30502): #196 ComponentElement.mount I/flutter (30502): #197 Element.inflateWidget I/flutter (30502): #198 MultiChildRenderObjectElement.mount I/flutter (30502): #199 Element.inflateWidget I/flutter (30502): #200 Element.updateChild I/flutter (30502): #201 _TheatreElement.mount I/flutter (30502): #202 Element.inflateWidget I/flutter (30502): #203 Element.updateChild I/flutter (30502): #204 ComponentElement.performRebuild I/flutter (30502): #205 Element.rebuild I/flutter (30502): #206 ComponentElement._firstBuild I/flutter (30502): #207 StatefulElement._firstBuild I/flutter (30502): #208 ComponentElement.mount I/flutter (30502): #209 Element.inflateWidget I/flutter (30502): #210 Element.updateChild I/flutter (30502): #211 ComponentElement.performRebuild I/flutter (30502): #212 Element.rebuild I/flutter (30502): #213 ComponentElement._firstBuild I/flutter (30502): #214 ComponentElement.mount I/flutter (30502): #215 Element.inflateWidget I/flutter (30502): #216 Element.updateChild I/flutter (30502): #217 SingleChildRenderObjectElement.mount I/flutter (30502): #218 Element.inflateWidget I/flutter (30502): #219 Element.updateChild I/flutter (30502): #220 ComponentElement.performRebuild I/flutter (30502): #221 Element.rebuild I/flutter (30502): #222 ComponentElement._firstBuild I/flutter (30502): #223 StatefulElement._firstBuild I/flutter (30502): #224 ComponentElement.mount I/flutter (30502): #225 Element.inflateWidget I/flutter (30502): #226 Element.updateChild I/flutter (30502): #227 SingleChildRenderObjectElement.mount I/flutter (30502): #228 Element.inflateWidget I/flutter (30502): #229 Element.updateChild I/flutter (30502): #230 SingleChildRenderObjectElement.mount I/flutter (30502): #231 Element.inflateWidget I/flutter (30502): #232 Element.updateChild I/flutter (30502): #233 ComponentElement.performRebuild I/flutter (30502): #234 Element.rebuild I/flutter (30502): #235 ComponentElement._firstBuild I/flutter (30502): #236 ComponentElement.mount I/flutter (30502): #237 Element.inflateWidget I/flutter (30502): #238 Element.updateChild I/flutter (30502): #239 ComponentElement.performRebuild I/flutter (30502): #240 Element.rebuild I/flutter (30502): #241 ComponentElement._firstBuild I/flutter (30502): #242 StatefulElement._firstBuild I/flutter (30502): #243 ComponentElement.mount I/flutter (30502): #244 Element.inflateWidget I/flutter (30502): #245 Element.updateChild I/flutter (30502): #246 ComponentElement.performRebuild I/flutter (30502): #247 Element.rebuild I/flutter (30502): #248 ComponentElement._firstBuild I/flutter (30502): #249 ComponentElement.mount I/flutter (30502): #250 Element.inflateWidget I/flutter (30502): #251 Element.updateChild I/flutter (30502): #252 ComponentElement.performRebuild I/flutter (30502): #253 Element.rebuild I/flutter (30502): #254 ComponentElement._firstBuild I/flutter (30502): #255 ComponentElement.mount I/flutter (30502): #256 Element.inflateWidget I/flutter (30502): #257 Element.updateChild I/flutter (30502): #258 ComponentElement.performRebuild I/flutter (30502): #259 Element.rebuild I/flutter (30502): #260 ComponentElement._firstBuild I/flutter (30502): #261 ComponentElement.mount I/flutter (30502): #262 Element.inflateWidget I/flutter (30502): #263 Element.updateChild I/flutter (30502): #264 ComponentElement.performRebuild I/flutter (30502): #265 Element.rebuild I/flutter (30502): #266 ComponentElement._firstBuild I/flutter (30502): #267 ComponentElement.mount I/flutter (30502): #268 Element.inflateWidget I/flutter (30502): #269 Element.updateChild I/flutter (30502): #270 ComponentElement.performRebuild I/flutter (30502): #271 Element.rebuild I/flutter (30502): #272 ComponentElement._firstBuild I/flutter (30502): #273 ComponentElement.mount I/flutter (30502): #274 Element.inflateWidget I/flutter (30502): #275 Element.updateChild I/flutter (30502): #276 ComponentElement.performRebuild I/flutter (30502): #277 Element.rebuild I/flutter (30502): #278 ComponentElement._firstBuild I/flutter (30502): #279 ComponentElement.mount I/flutter (30502): #280 Element.inflateWidget I/flutter (30502): #281 Element.updateChild I/flutter (30502): #282 ComponentElement.performRebuild I/flutter (30502): #283 Element.rebuild I/flutter (30502): #284 ComponentElement._firstBuild I/flutter (30502): #285 StatefulElement._firstBuild I/flutter (30502): #286 ComponentElement.mount I/flutter (30502): #287 Element.inflateWidget I/flutter (30502): #288 Element.updateChild I/flutter (30502): #289 ComponentElement.performRebuild I/flutter (30502): #290 Element.rebuild I/flutter (30502): #291 ComponentElement._firstBuild I/flutter (30502): #292 ComponentElement.mount I/flutter (30502): #293 Element.inflateWidget I/flutter (30502): #294 Element.updateChild I/flutter (30502): #295 ComponentElement.performRebuild I/flutter (30502): #296 Element.rebuild I/flutter (30502): #297 ComponentElement._firstBuild I/flutter (30502): #298 ComponentElement.mount I/flutter (30502): #299 Element.inflateWidget I/flutter (30502): #300 Element.updateChild I/flutter (30502): #301 SingleChildRenderObjectElement.mount I/flutter (30502): #302 Element.inflateWidget I/flutter (30502): #303 Element.updateChild I/flutter (30502): #304 ComponentElement.performRebuild I/flutter (30502): #305 Element.rebuild I/flutter (30502): #306 ComponentElement._firstBuild I/flutter (30502): #307 ComponentElement.mount I/flutter (30502): #308 Element.inflateWidget I/flutter (30502): #309 Element.updateChild I/flutter (30502): #310 ComponentElement.performRebuild I/flutter (30502): #311 Element.rebuild I/flutter (30502): #312 ComponentElement._firstBuild I/flutter (30502): #313 ComponentElement.mount I/flutter (30502): #314 Element.inflateWidget I/flutter (30502): #315 Element.updateChild I/flutter (30502): #316 ComponentElement.performRebuild I/flutter (30502): #317 Element.rebuild I/flutter (30502): #318 ComponentElement._firstBuild I/flutter (30502): #319 ComponentElement.mount I/flutter (30502): #320 Element.inflateWidget I/flutter (30502): #321 Element.updateChild I/flutter (30502): #322 ComponentElement.performRebuild I/flutter (30502): #323 Element.rebuild I/flutter (30502): #324 ComponentElement._firstBuild I/flutter (30502): #325 ComponentElement.mount I/flutter (30502): #326 Element.inflateWidget I/flutter (30502): #327 Element.updateChild I/flutter (30502): #328 ComponentElement.performRebuild I/flutter (30502): #329 Element.rebuild I/flutter (30502): #330 ComponentElement._firstBuild I/flutter (30502): #331 ComponentElement.mount I/flutter (30502): #332 Element.inflateWidget I/flutter (30502): #333 Element.updateChild I/flutter (30502): #334 SingleChildRenderObjectElement.mount I/flutter (30502): #335 Element.inflateWidget I/flutter (30502): #336 Element.updateChild I/flutter (30502): #337 ComponentElement.performRebuild I/flutter (30502): #338 Element.rebuild I/flutter (30502): #339 ComponentElement._firstBuild I/flutter (30502): #340 StatefulElement._firstBuild I/flutter (30502): #341 ComponentElement.mount I/flutter (30502): #342 Element.inflateWidget I/flutter (30502): #343 Element.updateChild I/flutter (30502): #344 ComponentElement.performRebuild I/flutter (30502): #345 Element.rebuild I/flutter (30502): #346 ComponentElement._firstBuild I/flutter (30502): #347 ComponentElement.mount I/flutter (30502): #348 Element.inflateWidget I/flutter (30502): #349 Element.updateChild I/flutter (30502): #350 ComponentElement.performRebuild I/flutter (30502): #351 Element.rebuild I/flutter (30502): #352 ComponentElement._firstBuild I/flutter (30502): #353 StatefulElement._firstBuild I/flutter (30502): #354 ComponentElement.mount I/flutter (30502): #355 Element.inflateWidget I/flutter (30502): #356 Element.updateChild I/flutter (30502): #357 ComponentElement.performRebuild I/flutter (30502): #358 Element.rebuild I/flutter (30502): #359 ComponentElement._firstBuild I/flutter (30502): #360 ComponentElement.mount I/flutter (30502): #361 Element.inflateWidget I/flutter (30502): #362 Element.updateChild I/flutter (30502): #363 ComponentElement.performRebuild I/flutter (30502): #364 Element.rebuild I/flutter (30502): #365 ComponentElement._firstBuild I/flutter (30502): #366 ComponentElement.mount I/flutter (30502): #367 Element.inflateWidget I/flutter (30502): #368 Element.updateChild I/flutter (30502): #369 ComponentElement.performRebuild I/flutter (30502): #370 Element.rebuild I/flutter (30502): #371 ComponentElement._firstBuild I/flutter (30502): #372 ComponentElement.mount I/flutter (30502): #373 Element.inflateWidget I/flutter (30502): #374 Element.updateChild I/flutter (30502): #375 SingleChildRenderObjectElement.mount I/flutter (30502): #376 Element.inflateWidget I/flutter (30502): #377 Element.updateChild I/flutter (30502): #378 ComponentElement.performRebuild I/flutter (30502): #379 Element.rebuild I/flutter (30502): #380 ComponentElement._firstBuild I/flutter (30502): #381 ComponentElement.mount I/flutter (30502): #382 Element.inflateWidget I/flutter (30502): #383 Element.updateChild I/flutter (30502): #384 ComponentElement.performRebuild I/flutter (30502): #385 Element.rebuild I/flutter (30502): #386 ComponentElement._firstBuild I/flutter (30502): #387 StatefulElement._firstBuild I/flutter (30502): #388 ComponentElement.mount I/flutter (30502): #389 Element.inflateWidget I/flutter (30502): #390 Element.updateChild I/flutter (30502): #391 ComponentElement.performRebuild I/flutter (30502): #392 Element.rebuild I/flutter (30502): #393 ComponentElement._firstBuild I/flutter (30502): #394 StatefulElement._firstBuild I/flutter (30502): #395 ComponentElement.mount I/flutter (30502): #396 Element.inflateWidget I/flutter (30502): #397 Element.updateChild I/flutter (30502): #398 ComponentElement.performRebuild I/flutter (30502): #399 Element.rebuild I/flutter (30502): #400 ComponentElement._firstBuild I/flutter (30502): #401 StatefulElement._firstBuild I/flutter (30502): #402 ComponentElement.mount I/flutter (30502): #403 Element.inflateWidget I/flutter (30502): #404 Element.updateChild I/flutter (30502): #405 ComponentElement.performRebuild I/flutter (30502): #406 Element.rebuild I/flutter (30502): #407 ComponentElement._firstBuild I/flutter (30502): #408 ComponentElement.mount I/flutter (30502): #409 Element.inflateWidget I/flutter (30502): #410 Element.updateChild I/flutter (30502): #411 ComponentElement.performRebuild I/flutter (30502): #412 Element.rebuild I/flutter (30502): #413 ComponentElement._firstBuild I/flutter (30502): #414 StatefulElement._firstBuild I/flutter (30502): #415 ComponentElement.mount I/flutter (30502): #416 Element.inflateWidget I/flutter (30502): #417 Element.updateChild I/flutter (30502): #418 ComponentElement.performRebuild I/flutter (30502): #419 Element.rebuild I/flutter (30502): #420 ComponentElement._firstBuild I/flutter (30502): #421 StatefulElement._firstBuild I/flutter (30502): #422 ComponentElement.mount I/flutter (30502): #423 Element.inflateWidget I/flutter (30502): #424 Element.updateChild I/flutter (30502): #425 RenderObjectToWidgetElement._rebuild I/flutter (30502): #426 RenderObjectToWidgetElement.mount I/flutter (30502): #427 RenderObjectToWidgetAdapter.attachToRenderTree. I/flutter (30502): #428 BuildOwner.buildScope I/flutter (30502): #429 RenderObjectToWidgetAdapter.attachToRenderTree I/flutter (30502): #430 WidgetsBinding.attachRootWidget I/flutter (30502): #431 WidgetsBinding.scheduleAttachRootWidget. I/flutter (30502): #440 _Timer._runTimers (dart:isolate-patch/timer_impl.dart:384:19) I/flutter (30502): #441 _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:418:5) I/flutter (30502): #442 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:174:12) I/flutter (30502): (elided 10 frames from class _AssertionError, package dart:async, and package dart:async-patch) I/flutter (30502): I/flutter (30502): ════════════════════════════════════════════════════════════════════════════════════════════════════ I/flutter (30502): Another exception was thrown: RenderBox was not laid out: RenderEditable#85ece NEEDS-LAYOUT NEEDS-PAINT I/flutter (30502): Another exception was thrown: A RenderFlex overflowed by 99686 pixels on the bottom.

Since I'm not using TextFieldPinAutoFill, I disabled it in your example app and this is what I get:

Restarted application in 1,047ms. I/flutter (30502): ══╡ EXCEPTION CAUGHT BY FOUNDATION LIBRARY ╞════════════════════════════════════════════════════════ I/flutter (30502): The following assertion was thrown while dispatching notifications for FocusNode: I/flutter (30502): RenderBox was not laid out: RenderEditable#5f177 NEEDS-LAYOUT NEEDS-PAINT I/flutter (30502): 'package:flutter/src/rendering/box.dart': I/flutter (30502): Failed assertion: line 1687 pos 12: 'hasSize' I/flutter (30502): I/flutter (30502): Either the assertion indicates an error in the framework itself, or we should provide substantially I/flutter (30502): more information in this error message to help you determine and fix the underlying cause. I/flutter (30502): In either case, please report this assertion by filing a bug on GitHub: I/flutter (30502): https://github.com/flutter/flutter/issues/new?template=BUG.md I/flutter (30502): I/flutter (30502): When the exception was thrown, this was the stack: I/flutter (30502): #2 RenderBox.size I/flutter (30502): #3 EditableTextState._updateSizeAndTransform I/flutter (30502): #4 EditableTextState._openInputConnection I/flutter (30502): #5 EditableTextState._openOrCloseInputConnectionIfNeeded I/flutter (30502): #6 EditableTextState._handleFocusChanged I/flutter (30502): #7 ChangeNotifier.notifyListeners I/flutter (30502): #8 FocusNode._notify I/flutter (30502): #9 FocusManager._applyFocusChange I/flutter (30502): (elided 12 frames from class _AssertionError and package dart:async) I/flutter (30502): I/flutter (30502): The FocusNode sending notification was: I/flutter (30502): FocusNode#775fd I/flutter (30502): ════════════════════════════════════════════════════════════════════════════════════════════════════

There are no errors or crashes if I comment out PhonefieldHint.

jaumard commented 4 years ago

Should be all good now @kbrmimbyl ! There were a small error with a feature I added on that branch. Can you pull the changes and let me know please

kbrmimbyl commented 4 years ago

Hey @jaumard, tested the new example app. The first error is gone and it didn't crash this time.... so this is great progress! But I'm still getting this exception. It's coming from PhoneFieldHint (I know because the exception vanishes when I comment it out):

I/flutter ( 9374): ══╡ EXCEPTION CAUGHT BY FOUNDATION LIBRARY ╞════════════════════════════════════════════════════════ I/flutter ( 9374): The following assertion was thrown while dispatching notifications for FocusNode: I/flutter ( 9374): RenderBox was not laid out: RenderEditable#ccb08 NEEDS-LAYOUT NEEDS-PAINT I/flutter ( 9374): 'package:flutter/src/rendering/box.dart': I/flutter ( 9374): Failed assertion: line 1687 pos 12: 'hasSize' I/flutter ( 9374): I/flutter ( 9374): Either the assertion indicates an error in the framework itself, or we should provide substantially I/flutter ( 9374): more information in this error message to help you determine and fix the underlying cause. I/flutter ( 9374): In either case, please report this assertion by filing a bug on GitHub: I/flutter ( 9374): https://github.com/flutter/flutter/issues/new?template=BUG.md I/flutter ( 9374): I/flutter ( 9374): When the exception was thrown, this was the stack: I/flutter ( 9374): #2 RenderBox.size package:flutter/…/rendering/box.dart:1687 I/flutter ( 9374): #3 EditableTextState._updateSizeAndTransform package:flutter/…/widgets/editable_text.dart:1729 I/flutter ( 9374): #4 EditableTextState._openInputConnection package:flutter/…/widgets/editable_text.dart:1415 I/flutter ( 9374): #5 EditableTextState._openOrCloseInputConnectionIfNeeded package:flutter/…/widgets/editable_text.dart:1441 I/flutter ( 9374): #6 EditableTextState._handleFocusChanged package:flutter/…/widgets/editable_text.dart:1707 I/flutter ( 9374): #7 ChangeNotifier.notifyListeners package:flutter/…/foundation/change_notifier.dart:206 I/flutter ( 9374): #8 FocusNode._notify package:flutter/…/widgets/focus_manager.dart:808 I/flutter ( 9374): #9 FocusManager._applyFocusChange package:flutter/…/widgets/focus_manager.dart:1401 I/flutter ( 9374): (elided 12 frames from class _AssertionError and package dart:async) I/flutter ( 9374): I/flutter ( 9374): The FocusNode sending notification was: I/flutter ( 9374): FocusNode#22816 I/flutter ( 9374): ════════════════════════════════════════════════════════════════════════════════════════════════════

jaumard commented 4 years ago

@kbrmimbyl it's fixed :) thanks for the testing !

kbrmimbyl commented 4 years ago

Hey, thanks a lot.... so you're not supporting autoFocus any more, right? I still get the exception if I enable autofocus (which is a good feature to have, frankly!)

kbrmimbyl commented 4 years ago

Hey @jaumard, unfortunately, I still get a crash on a real device in my app. No crash if I remove Phone Hint. Overall, the Phone Hint feature isn't usable right now.

Here's what I see:

java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=11012, result=1002, data=Intent { }} to activity {com.example/com.example.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 c.f.a.b.onActivityResult(:4) at io.flutter.embedding.engine.FlutterEnginePluginRegistry$FlutterEngineActivityPluginBinding.onActivityResult(:2) at io.flutter.embedding.engine.FlutterEnginePluginRegistry.onActivityResult(:3) at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.onActivityResult(:4) at io.flutter.embedding.android.FlutterActivity.onActivityResult(:1) at android.app.Activity.dispatchActivityResult(Activity.java:7109) at android.app.ActivityThread.deliverResults(ActivityThread.java:4192) ... 9 more

jaumard commented 4 years ago

@kbrmimbyl I've search for the layout problem of autofocus, but I didn't find any fix right now as it crash deep into flutter components so I don't know what's wrong :/

I don't know what to say about the crash as it doesn't crash at all for me :(

But I'm open to pull request if you guys find a fix for this !

kbrmimbyl commented 4 years ago

It's crashing without autofocus also. Fix -- I will get back to you if I find the root cause. I'm no good at creating plugins, though.

jaumard commented 4 years ago

Thanks :) I would probably be able to fix it if I was able to reproduce but so far I didn't get any crash at all :/

kbrmimbyl commented 4 years ago

Have you tried on a real device? I've tested on 3 phones... redmi, nokia, lenovo... crash on all 3.... and no crash in 0.0.1, mind you! So something's wrong with the AndroidX migration. That much is clear.

jaumard commented 4 years ago

I've tested on my pixel 3 without any trouble, I have only that device to test for now

kbrmimbyl commented 4 years ago

BTW You don't seem to be picking the filled number in your example app. How am I supposed to read out the phone-hint phone number? Here's how I'm doing it:

TextEditingController _phoneNumberTextController = new TextEditingController();
//
PhoneFieldHint(
  controller:
  _phoneNumberTextController,
),

If fetching the hint is succesful, I have the phone number in _phoneNumberTextController.text. Is this how I'm supposed to use it?

caiopardal commented 4 years ago

@jaumard Any thoughts about this issue?

caiopardal commented 4 years ago

@jaumard ? Are you still offering maintenance for this library?

jaumard commented 4 years ago

@caiopardal yes but I can only fix what I can reproduce, and I don't reproduce this one. If any of you can make a PR that fix this problem I'll gladly review and merge it. Or maybe share a reproducible project/steps for me to be able to have it too

prasant10050 commented 4 years ago

i'm facing this ,please fix it as soon as possible

lab9fr commented 4 years ago

Hi, I was facing the same trouble testing on my emulator, the app closing as soon as you press on the hint.

I've tried to play around a bit with the java code (that's not a language I'm really familiar with) and reading a few stackoverflow with similar issues.

On my device, it seems to be working better now modifying the code like this :

@Override
public boolean onActivityResult(int requestCode, int resultCode, Intent data) {
        if (requestCode == PHONE_HINT_REQUEST && pendingHintResult != null) {
                    if (resultCode == Activity.RESULT_OK && data != null) {
                        Credential credential = data.getParcelableExtra(Credential.EXTRA_KEY);
                        final String phoneNumber = credential.getId();
                        pendingHintResult.success(phoneNumber);
                    } else {
                        pendingHintResult.success(null);
                    }
                    return true;
                }
                return false;
            }

I simply check that pendingHintResult isn't null, it seems that sometime, onActivityResult can be called with a null pendingHintResult, I don't exactly know how, but it' what causes the bug encountered. And I also check that data isn't null.

I've created a PR

Renatinaveen commented 4 years ago

I'm using this plugin in 2 projects in one project the phonehint is working and in the other project it just shows the mobile number and when i select it doesn't give the mobilenumber like in my another project.

In one project when I tap on the hint it just closes the hint and doesn't provide selected mobile number

chrystoffer commented 4 years ago

Motorola XT1095, Android 7.1.2 there is also a problem with crashing the application. I changed the code as @lab9fr suggested, but it still keeps crashing.

jack24254029 commented 3 years ago

I found a problem. When I click PhoneFieldHint() icon and _hintShown is false, _askPhoneHint() will be trigger twice and occur app crash.

cedvdb commented 3 years ago

@jack24254029 @jaumard

the crashes happen when the dialog to pick the phone number is shown and then you hot reload the flutter application (with the dialog still being shown) and it will crash.

IE: You have autofocus true, keep the dialog open, and hot reload a few times, then click on the dialogs (there should be many of them) on the last one it will crash (or sooner)

parammittal162 commented 3 years ago

@jack24254029 @jaumard @cedvdb hi all any updates on this issue... has anyone got the fix

Technorocker commented 2 years ago

Has anyone figured this out yet? I just started trying to use this and when the popup shows my number on my android device and I click it the app crashes with this error output...

D/CompatibilityChangeReporter(10708): Compat change id reported: 160794467; UID 10545; state: DISABLED
I/BufferQueueProducer(10708): [SurfaceView - com.example.app/com.example.app.MainActivity@2efbc97@0#1(BLAST Consumer)1](id:29d400000001,api:1,p:10708,c:10708) queueBuffer: queued for the first time.
I/BufferQueueProducer(10708): [ViewRootImpl@19f944a[MainActivity]#0(BLAST Consumer)0](id:29d400000000,api:1,p:10708,c:10708) queueBuffer: queued for the first time.
I/ViewRootImpl@19f944a[MainActivity](10708): [DP] pdf(0) 1 android.view.ViewRootImpl.lambda$createFrameCompleteCallback$3$ViewRootImpl:4845 android.view.ViewRootImpl$$ExternalSyntheticLambda15.run:6 android.os.Handler.handleCallback:938
I/ViewRootImpl@19f944a[MainActivity](10708): [DP] rdf()
D/ViewRootImpl@19f944a[MainActivity](10708): reportDrawFinished (fn: -1)

Is there a proper example of how to use the PhoneFieldHint properly that I'm maybe missing?

SreehariCodewave commented 5 months ago

HintRequest hintRequest = new HintRequest.Builder() .setPhoneNumberIdentifierSupported(true) .build();

This code is used in SmsAutoFillPlugin.java to get the mobile number. This method is deprecated.
I think replacing this will fix this issue

PawanFyers commented 5 months ago

Requesting a fix please @jaumard We have a release....

cedvdb commented 5 months ago

@PawanFyers Provide a fix, this is open source.

Shub0327 commented 5 months ago

found any solution to this?