alibaba / alibaba/flutter_boost

PlateFormView中引入Fragment一直报错

Open
#1,571 1 comment 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

## Steps to Reproduce

1、把example下的NativeView里面的TextView换成fragment 会报错,在构造方法中加入:
LayoutInflater inflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
view = (View) inflater.inflate(R.layout.ih_activity_test, null, true);

2、ih_activity_test中的内容:

3、getView的return改为view
@NonNull
@Override
public View getView() {
return view;
}

4、报错内容为:

Unhandled Exception: PlatformException(error, Binary XML file line #7 in com.idlefish.flutterboost.example:layout/ih_activity_test: Binary XML file line #7 in com.idlefish.flutterboost.example:layout/ih_activity_test: Error inflating class fragment, null, android.view.InflateException: Binary XML file line #7 in com.idlefish.flutterboost.example:layout/ih_activity_test: Binary XML file line #7 in com.idlefish.flutterboost

纠结了一周,麻烦请看看

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in the example's NativeView implementation and inspect the ih_activity_test layout, NativeFragment, and getView() path described in the report. Reproduce the fragment inflation failure in the Android example, then verify the example can load the fragment without the reported InflateException.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.