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

Crash on first launch (only) #59

Closed
abhinavc opened this issue May 15, 2019 · 6 comments
Closed

Crash on first launch (only) #59

abhinavc opened this issue May 15, 2019 · 6 comments

Comments

@abhinavc
Copy link

Hi Danvick,
Noticing a strange behaviour. My app crashes only when

  • I do a fresh install (not on subsequent re-runs)
  • and click on a FormBuilderTextField (not on any other type of field)

The stack trace suggests a problem on the Android end - perhaps with the plugin from adee42.
If this is a dependency of FormBuilder, then what could be causing the crash?

java.lang.NullPointerException: Attempt to invoke virtual method 'void android.view.View.getWindowVisibleDisplayFrame(android.graphics.Rect)' on a null object reference
E/AndroidRuntime(32149): 	at com.github.adee42.keyboardvisibility.KeyboardVisibilityPlugin.onGlobalLayout(KeyboardVisibilityPlugin.java:40)
E/AndroidRuntime(32149): 	at android.view.ViewTreeObserver.dispatchOnGlobalLayout(ViewTreeObserver.java:912)
E/AndroidRuntime(32149): 	at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2150)
E/AndroidRuntime(32149): 	at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1298)
E/AndroidRuntime(32149): 	at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6437)
E/AndroidRuntime(32149): 	at android.view.Choreographer$CallbackRecord.run(Choreographer.java:876)
E/AndroidRuntime(32149): 	at android.view.Choreographer.doCallbacks(Choreographer.java:688)
E/AndroidRuntime(32149): 	at android.view.Choreographer.doFrame(Choreographer.java:623)
E/AndroidRuntime(32149): 	at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:862)
E/AndroidRuntime(32149): 	at android.os.Handler.handleCallback(Handler.java:754)
E/AndroidRuntime(32149): 	at android.os.Handler.dispatchMessage(Handler.java:95)
E/AndroidRuntime(32149): 	at android.os.Looper.loop(Looper.java:163)
E/AndroidRuntime(32149): 	at android.app.ActivityThread.main(ActivityThread.java:6238)
E/AndroidRuntime(32149): 	at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(32149): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:933)
E/AndroidRuntime(32149): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:823)
I/Process (32149): Sending signal. PID: 32149 SIG: 9
@abhinavc
Copy link
Author

Hi Danvick,
It seems that this issue was corrected by the publisher of `flutter_keyboard_visiblilty' about 2 days back.

https://github.com/adee42/flutter_keyboard_visibility/commit/981f6794718654cb30b36e403505fe1ff502205b

If you have a dependency on this plugin, then perhaps a update to pubspec.yaml is all that is needed. And if this be the issue, then can a hot-fix release be made available?

@abhinavc
Copy link
Author

abhinavc commented May 15, 2019

Right, flutter_form_builder depends on flutter_typeahead which depends on flutter_keyboard_visibility. Can I bypass the version included via your plugin and directly use the latest version of flutter_keyboard_visibility? I guess this is now more a question on how pubspec.yaml works

@danvick
Copy link
Collaborator

danvick commented May 15, 2019

Thanks very much for the insight. The issue to do with flutter_keyboard_visibility had been reported but I didn't know exactly where the issue came from - and couldn't reproduce.

I obviously thought the one who reported the issue had the dependency on the plugin.

@danvick
Copy link
Collaborator

danvick commented May 16, 2019

Hi @abhinavc,
Someone has reported that running flutter packages upgrade will sort that out.

Kindly confirm.

@abhinavc
Copy link
Author

flutter packages upgrade should work as it would / should upgrade keyboard_visibility to version 0.5.6. But it didn't occur to me to do that. So, I simply made the following change in my pubspec.yaml and then ran flutter packages get (not upgrade)

dependency_overrides:
    keyboard_visibility: ^0.5.6

flutter packages upgrade would, I'm guessing, also upgrade every other package. Not sure if everyone would want that, lest it causes breaking behaviour

@danvick
Copy link
Collaborator

danvick commented May 16, 2019

I see, thanks for the insight - very helpful.

We will then have that as the solution for the issue and close this 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

2 participants