alibaba / alibaba/flutter_boost

java.lang.NullPointerException: Attempt to invoke virtual method 'void io.flutter.plugin.editing.TextInputPlugin.onProvideAutofillVirtualStructure(android.view.ViewStructure, int)' on a null object reference

Open
#2,062 13 comments 0 reactions 0 assignees View on GitHub
Dominant language
Dart
Stars
7.2k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Description

### 请描述遇到的问题,以及您所期望的正确的结果

1、update flutter version from 3.3.9 to 3.16.9
2、Open the phone settings and turn on the application password book function
3、create a viewpage fragment, one is native fragment and has edit, other is flutter fragment and init
then,
When you click on the edit box of the native fragment, it will inevitably collapse and appear.

crash log:
java.lang.NullPointerException: Attempt to invoke virtual method 'void io.flutter.plugin.editing.TextInputPlugin.onProvideAutofillVirtualStructure(android.view.ViewStructure, int)' on a null object reference
at io.flutter.embedding.android.FlutterView.onProvideAutofillVirtualStructure(FlutterView.java:1525)
at android.view.View.dispatchProvideStructure(View.java:10364)
at android.view.View.dispatchProvideAutofillStructure(View.java:10356)
at android.view.ViewGroup.dispatchProvideAutofillStructure(ViewGroup.java:3708)
at android.view.ViewGroup.dispatchProvideAutofillStructure(ViewGroup.java:3728)
at android.view.ViewGroup.dispatchProvideAutofillStructure(ViewGroup.java:3728)
at android.app.assist.AssistStructure$WindowNode.(AssistStructure.java:527)
at android.app.assist.AssistStructure.(AssistStructure.java:2345)
at android.app.ActivityThread.handleRequestAssistContextExtras(ActivityThread.java:4101)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2427)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:240)
at android.os.Looper.loop(Looper.java:351)
at android.app.ActivityThread.main(ActivityThread.java:8423)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:584)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1013)

### 请说明如何操作会遇到上述问题

一定要开启密码本:
![image](https://github.com/alibaba/flutter_boost/assets/9548501/77a5ccd7-e3fd-4659-a9ea-01b172b92952)

最好是pad或者折叠屏手机:
![click_1](https://github.com/alibaba/flutter_boost/assets/9548501/505c2f1a-70dd-4002-80db-14ac5b796d87)
![click_2](https://github.com/alibaba/flutter_boost/assets/9548501/91405447-453f-48e7-a391-e753b4b2d73d)
![click_3](https://github.com/alibaba/flutter_boost/assets/9548501/ffe616c1-d418-47a2-9223-b3a96698431d)

### 在下面填入关键复现代码

demo:
[mtp_test_demo.zip](https://github.com/user-attachments/files/15605037/mtp_test_demo.zip)

### 复现的平台

Both

### Flutter SDK版本

3.16.9

### FlutterBoost版本

5.0.1

### 是否延迟初始化FlutterBoost

No

### 解决方案

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the crash with Flutter SDK 3.16.9 and FlutterBoost 5.0.1 using the provided demo, an Android pad or foldable device, and the password-book setting enabled. Inspect FlutterView.java around line 1525 and the TextInputPlugin.onProvideAutofillVirtualStructure call; done means the native edit box no longer crashes when the Flutter fragment is present.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, dart
Domain
mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.