Google Play warning about missing leanback intent

后端 未结 1 1665
温柔的废话
温柔的废话 2021-02-09 20:41

When updating our app on Google Play I get

You opted-in to Android TV but your APK or Android App Bundle does not have the Leanback intent

Thi

相关标签:
1条回答
  • 2021-02-09 21:18

    Finally I found out the answer!

    If you want to support AndroidTV you cannot lock orientation inside manifest.

    android:screenOrientation="landscape"
    android:screenOrientation="portrait"
    

    Instead, you can use below code (or something similar) inside Activity's onCreate

    requestedOrientation =
            if (isPhoneDevice()) ActivityInfo.SCREEN_ORIENTATION_PORTRAIT
            else ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE
    

    If there is no locking orientation logic in your manifest maybe some lib adds it. Decompile your apk using apk tool and then verify generated manifest. You can replace it with this code:

    <activity
                android:name="com.yoursite.SampleActivity"
                tools:replace="android:screenOrientation"
                tools:node="merge"
                android:screenOrientation="sensor"/>
    

    I hope it will help :)

    EDIT: I found out another problem.

    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
    

    You cannot use ACCESS_WIFI_STATE permission on Android TV.

    0 讨论(0)
提交回复
热议问题