Google Play warning about missing leanback intent

后端 未结 1 1676
温柔的废话
温柔的废话 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:

    
    

    I hope it will help :)

    EDIT: I found out another problem.

    
    

    You cannot use ACCESS_WIFI_STATE permission on Android TV.

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