[英]Android Application working in Android 2 but throws exception in Android 4
[英]lint throws missingLeanbackSupport for android application
我將編譯和目標 sdk 升級到 API 33,清單中似乎有很多變化,我不斷收到 lint 錯誤 - missingLeanbackSupport
,
/bitrise/src/app/src/main/AndroidManifest.xml:2: 錯誤:期望一個活動有 android.intent.category.LEANBACK_LAUNCHER 意圖過濾器 [MissingLeanbackLauncher]
雖然我在清單中禁用了它,但仍然
<uses-feature
android:name="android.software.leanback"
android:required="false" />
<uses-feature
android:name="android.hardware.touchscreen"
android:required="true" />
有沒有辦法從代碼中禁用 Android 電視支持? 如果我將 LEANBACK_LAUNCHER 用於啟動畫面,則無法運行 api 33(但它適用於 32 及以下版本)
<activity
android:name=".splash.SplashActivity"
android:autoRemoveFromRecents="true"
android:exported="true"
android:launchMode="singleTask">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LEANBACK_LAUNCHER" />
</intent-filter> ...
除了忽略 lint 中的這個錯誤,還有什么辦法嗎?
我已經運行了一些測試,在我看來你的 build.gradle (:app) 文件中有'androidx.leanback:leanback:1.0.0'
依賴項或者
<uses-feature
android:name="android.software.leanback"
android:required="false" />
在您的 AndroidManifest.xml 文件中,lint 會懷疑您正在部署 TV 模塊,因此它會強制您定義 LEANBACK_LAUNCHER。
檢查這是否是您的情況並將它們從您的代碼中刪除。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.