报错信息:
android.view.InflateException: Binary XML file line #132: Error inflating class fragment
Caused by: java.lang.IllegalArgumentException: Binary XML file line #132: Duplicate id xxx, tag null, or parent id xxx with another fragment for xxx.xxxFragment
问题背景:
编译工具 : androidStudio 3.6.1
引用版本 : androidX
compileSdkVersion 30
minSdkVersion 19
targetSdkVersion 30
xml布局引用多个fragment,代码如下
<!--子类布局引用的多个fragment中的其中一个-->
<fragment
android:id="@+id/fragment_file"
android:name="xxx.xxxFragment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:layout="@layout/layout_attachment_files" />