![](/img/trans.png)
[英]How to use com.android.support.AppCompatActivity when using com.google.android.material:material:1.0.0-alpha3?
[英]"MissingRegistered" Lint warnings when using com.google.android.material.* UI components
我正試圖擺脫我的 Android 項目中的 Lint 警告。 這樣做我會遇到以下類型的我不理解的警告消息:
app\src\main\res\layout-land\event_settings_fragment.xml:25: Error: Class referenced in the layout file, com.google.android.material.textfield.TextInputLayout, was not found in the project or the libraries [MissingRegistered]
<com.google.android.material.textfield.TextInputLayout
^
我的應用程序似乎運行良好,所以com.google.android.material.textfield.TextInputLayout
類應該在項目中可用? 請注意,我確實在所有com.google.android.material.*
類上收到此警告。
失蹤登記
摘要:缺少注冊課程
優先級:8 / 10 嚴重性:錯誤
類別:正確性
注意:默認情況下禁用此問題!
您可以通過添加 --enable MissingRegistered 來啟用它
如果在清單或布局文件中引用了一個類,它也必須存在於項目中(或項目包含的庫之一)。此檢查有助於發現注冊名稱中的拼寫錯誤,或嘗試重命名或移動類而不正確更新清單文件。
請參閱: http ://tools.android.com/tips/lint-checks
如果您確保布局文件運行沒有問題,您可以禁用檢查:
app/build.gradle
android{
lintOptions{
disable "MissingRegistered"
}
}
或在布局文件中添加tools:ignore="MissingRegistered"
以禁止檢查。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.