佈局或代碼中引用 @string/xxx 或 R.string.xxx,但 res/values/strings.xml 中未定義該字串,編譯/運行時報 ResourceNotFoundException。
res/values/strings.xml。app_name、btn_login)。<string name="xxx">顯示文字</string>。values-zh/strings.xml 等限定資源目錄導致預設環境找不到。strings.xml 管理,禁止硬編碼在佈局/代碼中。Refactor > Rename 重命名資源,自動同步所有引用。./gradlew lint 檢測缺失資源。