Flutter upgrade issue with lots of un-understandable logs (no harm though) - flutter

I just upgraded flutter and right after the upgrade I am getting quite a bunch of logs in the console, which don't make sense to me, tried to surf the internet for such sort of errors but apparently there don't seem to be any traces of these kind of errors: For a start, you guys can help me in trying to understand these and how to go about this because it is getting to be quite hard to debug: I must also mention though that the they don't stop the app from running:
I/HwPhoneWindow(25343): updateLayoutParamsColor false mSpecialSet=true, mForcedNavigationBarColor=true, navigationBarColor=ff6451fe, mNavBarShow=true, mIsFloating=false
I/HwPhoneWindow(25343): updateLayoutParamsColor false mSpecialSet=true, mForcedNavigationBarColor=true, navigationBarColor=ff6451fe, mNavBarShow=true, mIsFloating=false
V/InputMethodManager(25343): Reporting focus gain, without startInput
V/InputMethodManager(25343): Reporting focus gain, without startInput
Similarly whenever I get the following when I touch anywhere on the screen:
W/HiTouch_PressGestureDetector(25343): Touch pointer move a lot. The moving distance of X is:2.0, limit is:51The moving distance of Y is:69.0, limit is:51
Below log also just appears am currently not sure of what is triggering this yet:
W/InputMethodManager(25343): startInputReason = 8
W/IInputConnectionWrapper(25343): getExtractedText on inactive InputConnection
W/IInputConnectionWrapper(25343): getTextBeforeCursor on inactive InputConnection
W/IInputConnectionWrapper(25343): requestCursorAnchorInfo on inactive InputConnection
D/ZrHung.AppEyeUiProbe(25343): stop checker.
W/libEGL (25343): EGLNativeWindowType 0x755f41b010 disconnect failed
D/ViewRootImpl[MainActivity](25343): surface should not be released
D/FlutterView(25343): Detaching from a FlutterEngine:
io.flutter.embedding.engine.FlutterEngine#486f178
W/InputMethodManager(25343): startInputReason = 3
W/IInputConnectionWrapper(25343): getExtractedText on inactive InputConnection
W/IInputConnectionWrapper(25343): getTextBeforeCursor on inactive InputConnection
W/IInputConnectionWrapper(25343): requestCursorAnchorInfo on inactive InputConnection
W/libEGL (25343): EGLNativeWindowType 0x75660d7010 disconnect failed
V/ActivityThread(25343): Handle window ActivityRecord{d450bd5 token=android.os.BinderProxy#c9b5ecf{com.example.cmed/com.example.cmed.MainActivity}} visibility: false
D/ZrHung.AppEyeUiProbe(25343): Current Activity:false
D/ZrHung.AppEyeUiProbe(25343): not watching, wait.
E/ (25343): [ZeroHung]zrhung_get_config: Get config failed for wp[0x0008]

As I'd earlier stated in the comments, there is an issue with flutter v1.12.13+hotfix.8. The issue is currently not resolved yet but you can work around the problem as of now by downgrading:
run:
flutter version v1.12.13+hotfix.7
This is because hotfix.8 is missing log filters

Related

Flutter error I/TextInputPlugin , W/IInputConnectionWrapper

1
Error:
I/TextInputPlugin(22952): Composing region changed by the framework. Restarting the input method.
W/IInputConnectionWrapper(22952): getTextBeforeCursor on inactive InputConnection
W/IInputConnectionWrapper(22952): getSelectedText on inactive InputConnection
W/IInputConnectionWrapper(22952): getTextAfterCursor on inactive InputConnection
Is anyone how to solve this?
use a TextEditingController() to store the value in the textfield controller.
and then call the text value using theController.text .
this error is due to the keyboard being manually closed, it causes a rebuild.
make sure you're doing this in a stateful widget.
check this image for a guide.
TextEditingController

Cannot compile SchedulerBinding.instance.addPostFrameCallback and executeAfterBuild() async not working either

In my app the user is presented with a puzzle, drawn by a re-implementation of Flutter's CustomerPainter class and accepting moves made by tapping on the Canvas. The Canvas is continually updated and re-drawn to show the moves. When the user makes the last move and completes a correct solution, the app should tell the user so. The app is using Flutter's AlertDialog to issue such messages to the user.
The problem is that the app is deep in the paint() method of CustomPainter when a solution situation is detected. Any attempt to issue a message at that point crashes the app. The message to the user does appear, but by that time the app has crashed. The error messages are either:
[ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception:
setState() or markNeedsBuild() called during build.
or
[ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception:
Build scheduled during frame.
These messages are followed by comprehensive advice as to what has happened and what to do. There are also several suggestions on Stack Overflow, but I cannot get any of them to work.
If I write SchedulerBinding.instance.addPostFrameCallback in my widget-build it fails to compile because it wants several parts from BindingBase. SchedulerBinding is a mixin. If I try to mixin BindingBase to my Widget, compilation fails again because BindingBase is a class, with a constructor, not a mixin.
If I go the async way, using Future executeAfterBuild(), the app compiles but crashes again, apparently because the async function executes straight away (as is normal) and is not scheduled after the widget-build, as suggested in some of the Stack Overflow posts. The app is definitely not in setState() when it crashes, so maybe marksNeedsBuild() is triggering the crash somehow.
I am using Flutter 2.8.2 and Dart 2.15.1, plus sound null safety. Has Flutter's widget-scheduling policy changed? The Stack Overflow posts I refer to are up to 3 years old.
have you tried putting setState in :
WidgetsBinding.instance?.addPostFrameCallback((_) {setState((){});})

getSelectedText on inactive InputConnection & getTextAfterCursor on inactive InputConnection problem

enter image description here
please when I select from my dropdown it displays the following error: getSelectedText on inactive InputConnection & getTextAfterCursor on inactive InputConnection problem on flutter
It happens to me as well because of another function running in background of same context. But if it doesn't gives you an error then that's ok(as in my case).
But if it gives error you just check if two or more function or build running simultaneously.
OR
Share the full code here (your code has only a portion of it)so we can check it.

Flutter TextInputType change gives error in Form

While changing keyboard type from TextInputType.text to TextInputType.phone inside Form receiving this error:
W/IInputConnectionWrapper(13712): getTextBeforeCursor on inactive InputConnection
W/IInputConnectionWrapper(13712): getSelectedText on inactive InputConnection
W/IInputConnectionWrapper(13712): getTextAfterCursor on inactive InputConnection
The widget is StatefulWidget
I don't think you can call them errors (or at least not breaking errors because they won't crash the app)
This long and still open issue on github addresses the problem and there seem to be no way to stop these warnings (until now) that are being caused by clearing the TextField

Can Android WebView HTML influence keyboard or keyboard features?

I have a webview with a credit card entry form (with standard <input type="text" /> fields). In different versions of Android I get different keyboards. Kit-Kat seems to not show Prev / Next keys when inside the form.
On the web side, do I have any influence over this?
If not, what
should I recommend to the developer for the Android side?
Example without Prev / Next:
Same webview, with Prev / Next:
You can control the keyboard from the WebView, but as other answers suggest it may not work with every keyboard ever made. Despite that, I typically find most mainstream keyboards have implemented the behaviour I want.
The WebView has a method called onCreateInputConnection. You can hook into this method and add (and/or remove) flags to the inputType and/or imeOptions. There are many flags available to you.
Check out the EditorInfo options, in particular IME_FLAG_NAVIGATE_NEXT and IME_FLAG_NAVIGATE_PREVIOUS. See usage below (which removes the prev/next flags from the keyboard options):
#Override
public InputConnection onCreateInputConnection(EditorInfo outAttrs) {
InputConnection inputConnection = super.onCreateInputConnection(outAttrs);
outAttrs.imeOptions = outAttrs.imeOptions & ~EditorInfo.IME_FLAG_NAVIGATE_NEXT &
~EditorInfo.IME_FLAG_NAVIGATE_PREVIOUS;
return inputConnection;
}
Another thing you could try is to hide the entire suggestions bar using the InputType flags TYPE_TEXT_FLAG_NO_SUGGESTIONS. See example below (which adds the "no suggestions" flag to the input type):
#Override
public InputConnection onCreateInputConnection(EditorInfo outAttrs) {
InputConnection inputConnection = super.onCreateInputConnection(outAttrs);
outAttrs.inputType = outAttrs.inputType | InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS;
return inputConnection;
}
There are many other flags available to have a play with to customise the IME directly from the WebView. Refer the developer to the linked pages and you should hopefully be able to achieve the behaviour you are after on most keyboards.
You do have some minimal control, but not that much. The type of the control (passowrd, numeric, text) will be sent to the soft keyboard and used to change how things are displayed. However, the choices the keyboard makes based on those options are keyboard specific- the Google keyboard reacts differently than Swype, which reacts differently than Swiftkey, which reacts differently than the Samsung keyboard, etc. You can't really count on a specific behavior.
Tried on Android Studio 3.0 (SDK API 26), the answer https://stackoverflow.com/a/23462658/3286489 crashes. After search further found this working.
#Override
public InputConnection onCreateInputConnection(EditorInfo outAttrs) {
InputConnection inputConnection = new BaseInputConnection(this, true);
outAttrs.imeOptions = outAttrs.imeOptions & ~EditorInfo.IME_FLAG_NAVIGATE_NEXT &
~EditorInfo.IME_FLAG_NAVIGATE_PREVIOUS;
return inputConnection;
}
And
#Override
public InputConnection onCreateInputConnection(EditorInfo outAttrs) {
InputConnection inputConnection = new BaseInputConnection(this, true);
outAttrs.inputType = outAttrs.inputType | InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS;
return inputConnection;
}