Android Question Publish on Tv Store

fishwolf

Well-Known Member
Licensed User
Longtime User
I'm tring to publish a simple app for TV Google store, but i have this error:

Gli APK o i file Android App Bundles in this channel need function: android.software.leanback.

but i have this in manifest
B4X:
AddActivityText(TvActivity,
                <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LEANBACK_LAUNCHER" />
                </intent-filter>)

Any suggestion?
 

JohnC

Expert
Licensed User
Longtime User
ChatGPT says...

The error message you're encountering indicates that your app needs to declare the use of the android.software.leanback feature in its manifest. While you've correctly added the LEANBACK_LAUNCHER category in your activity's intent filter, you also need to specify the leanback feature to comply with the Google TV Store requirements.

Here's how you can fix the issue:

  1. Add the Leanback Feature to Your Manifest:
    In your B4A project's manifest editor, add the following line outside of any activity tags:

    B4X:
    <uses-feature android:name="android.software.leanback" android:required="true" />
    • Setting android:required="true" means your app is specifically designed for Android TV devices.
    • If you want your app to be available on both TV and non-TV devices, you can set android:required="false".
  2. Ensure Your Activity Intent Filter Is Correct:

    You've already added the LEANBACK_LAUNCHER category, which is good. Just make sure it's correctly formatted in your manifest:

    B4X:
    <activity android:name=".TvActivity">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LEANBACK_LAUNCHER" />
        </intent-filter>
    </activity>
  3. Double-Check the Manifest Structure:
    Make sure that the <uses-feature> tag is placed correctly in the manifest, usually directly under the <manifest> tag and before the <application> tag.
    Example of How Your Manifest Should Look:

    B4X:
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
        package="your.package.name">
    
        <uses-feature android:name="android.software.leanback" android:required="true" />
    
        <application
            android:allowBackup="true"
            android:label="@string/app_name"
            android:supportsRtl="true"
            android:theme="@style/AppTheme">
    
            <activity android:name=".TvActivity">
                <intent-filter>
                    <action android:name="android.intent.action.MAIN" />
                    <category android:name="android.intent.category.LEANBACK_LAUNCHER" />
                </intent-filter>
            </activity>
    
            <!-- Other activities and services -->
    
        </application>
    </manifest>

    Additional Tips:
    • Test on an Android TV Device: Before publishing, test your app on an actual Android TV device or emulator to ensure it behaves as expected.
    • Review Google Play Requirements: Make sure your app complies with all other requirements for Android TV apps on the Google Play Store.
    • By adding the <uses-feature> tag for android.software.leanback, you inform the Google Play Store that your app is intended for Android TV devices, which should resolve the error you're experiencing.
 
Upvote 0

agraham

Expert
Licensed User
Longtime User
Have you seen this example?
 
Upvote 0

fishwolf

Well-Known Member
Licensed User
Longtime User
ChatGPT says...

The error message you're encountering indicates that your app needs to declare the use of the android.software.leanback feature in its manifest. While you've correctly added the LEANBACK_LAUNCHER category in your activity's intent filter, you also need to specify the leanback feature to comply with the Google TV Store requirements.

Here's how you can fix the issue:

  1. Add the Leanback Feature to Your Manifest:
    In your B4A project's manifest editor, add the following line outside of any activity tags:

    B4X:
    <uses-feature android:name="android.software.leanback" android:required="true" />
    • Setting android:required="true" means your app is specifically designed for Android TV devices.
    • If you want your app to be available on both TV and non-TV devices, you can set android:required="false".
  2. Ensure Your Activity Intent Filter Is Correct:

    You've already added the LEANBACK_LAUNCHER category, which is good. Just make sure it's correctly formatted in your manifest:

    B4X:
    <activity android:name=".TvActivity">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LEANBACK_LAUNCHER" />
        </intent-filter>
    </activity>
  3. Double-Check the Manifest Structure:
    Make sure that the <uses-feature> tag is placed correctly in the manifest, usually directly under the <manifest> tag and before the <application> tag.
    Example of How Your Manifest Should Look:

    B4X:
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
        package="your.package.name">
    
        <uses-feature android:name="android.software.leanback" android:required="true" />
    
        <application
            android:allowBackup="true"
            android:label="@string/app_name"
            android:supportsRtl="true"
            android:theme="@style/AppTheme">
    
            <activity android:name=".TvActivity">
                <intent-filter>
                    <action android:name="android.intent.action.MAIN" />
                    <category android:name="android.intent.category.LEANBACK_LAUNCHER" />
                </intent-filter>
            </activity>
    
            <!-- Other activities and services -->
    
        </application>
    </manifest>

    Additional Tips:
    • Test on an Android TV Device: Before publishing, test your app on an actual Android TV device or emulator to ensure it behaves as expected.
    • Review Google Play Requirements: Make sure your app complies with all other requirements for Android TV apps on the Google Play Store.
    • By adding the <uses-feature> tag for android.software.leanback, you inform the Google Play Store that your app is intended for Android TV devices, which should resolve the error you're experiencing.
i have used this app SampleTv as base for start

i have this maniferst after suggestion, but the error is already returned
B4X:
<?xml version="1.0" encoding="utf-8"?>
<manifest
    xmlns:android="http://schemas.android.com/apk/res/android"
    package="my package"
    android:versionCode="15"
    android:versionName="1.5"
    android:installLocation="auto">
    
    <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="34"/>
                    <supports-screens android:largeScreens="true"
                                      android:normalScreens="true"
                                      android:smallScreens="true"
                                      android:xlargeScreens="true"
                                      android:anyDensity="true"/>
    <uses-feature android:name="android.software.leanback" android:required="false" />
                    <uses-feature android:name="android.hardware.touchscreen" android:required="true" />
    <uses-permission android:name="android.permission.INTERNET"/>
    <application
        android:name="androidx.multidex.MultiDexApplication"
        android:icon="@drawable/icon"
        android:label="App Name"
        android:banner="@drawable/banner">
        <activity
            android:windowSoftInputMode="stateHidden"
            android:launchMode="singleTop"
            android:name=".main"
            android:label="App Name"
            android:screenOrientation="landscape"
            android:exported="true">
            <intent-filter>
               <action android:name="android.intent.action.MAIN" />
               <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
            
            <intent-filter>
                                <action android:name="android.intent.action.MAIN" />
                                <category android:name="android.intent.category.LEANBACK_LAUNCHER" />
                            </intent-filter>
        </activity>
        <activity
            android:windowSoftInputMode="stateHidden"
            android:launchMode="singleTop"
            android:name=".menu"
            android:label="App Name"
            android:screenOrientation="landscape"
            android:exported="true">
        </activity>
        <activity
            android:windowSoftInputMode="stateHidden"
            android:launchMode="singleTop"
            android:name=".profile"
            android:label="App Name"
            android:screenOrientation="landscape"
            android:exported="true">
        </activity>
        <activity
            android:windowSoftInputMode="stateHidden"
            android:launchMode="singleTop"
            android:name=".tvactivity"
            android:label="App Name"
            android:screenOrientation="landscape"
            android:exported="true">
        </activity>
        <receiver
            android:name=".httputils2service"
            android:exported="true">
        </receiver>
    </application>
</manifest>
 
Upvote 0

fishwolf

Well-Known Member
Licensed User
Longtime User
Have you seen this example?
i have used this similar sample, on TV work fine

Sample

i have try the maniferst but the error is already returned
 
Upvote 0
Top