截圖顯示構建/運行報錯,錯誤信息指向 XML 布局文件某行。
XML 屬性值中包含句號 . 的引用(如 @string/app_name、@dimen/margin_10dp、@color/primary_dark),**誤寫成逗號 ,** 導致解析失敗。例如:
<!-- 錯誤 -->
<TextView android:text="@string,app_name" />
<!-- 正確 -->
<TextView android:text="@string/app_name" />
@xxx/yyy 格式引用,**斜槠 / 不可寫成逗號 ,、分號 ;、空格**。android:background="@drawable,bg"、style="@style,AppTheme"、android:icon="@mipmap,ic_launcher"。Error: No resource found that matches the given name (at 'text' with value '@string,app_name'),按資源類型/名稱定位。@str 觸發補全,自動生成正確語法。./gradlew lint 靜態檢查,捕獲此類低級錯誤。