Nininea
Nininea

Reputation: 2739

lint throws missingLeanbackSupport for android application

I upgraded compile and target sdk to API 33, it seems there are a lot of changes in manifest, I'm constantly getting lint error - missingLeanbackSupport,

/bitrise/src/app/src/main/AndroidManifest.xml:2: Error: Expecting an activity to have android.intent.category.LEANBACK_LAUNCHER intent filter [MissingLeanbackLauncher]

while I have disabled it in manifest, but still

  <uses-feature
    android:name="android.software.leanback"
    android:required="false" />
<uses-feature
    android:name="android.hardware.touchscreen"
    android:required="true" />

is there any way to disable Android tv support from code? If I use LEANBACK_LAUNCHER for my splash screen it can't be run api 33 (but it works on 32 and below)

 <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> ...

is there any way beside ignoring this error in lint ?

Upvotes: 0

Views: 198

Answers (1)

Kostek
Kostek

Reputation: 282

I had run some tests and it appeared to me that having 'androidx.leanback:leanback:1.0.0' dependency in your build.gradle (:app) file or

<uses-feature
    android:name="android.software.leanback"
    android:required="false" />

in your AndroidManifest.xml file causes lint to suspect that you are deploying TV module and therefore it is forcing you to define LEANBACK_LAUNCHER.

Check if it is your case and delete them from your code.

Upvotes: 0

Related Questions