본문 바로가기
개발/Android Error

[Error] Expectiong android:screenOrientation="unspecified" or "fullSensor"

by JhDroid 2021. 1. 5.
728x90

에러 메시지

Expectiong android:screenOrientation="unspecified" or "fullSensor" for this activity
so the user can use the application in any orientation and provide a greate experience
on Chrome OS devices

 

문제

  • Android Studio 3.6.0 업데이트 이후 발생

 

해결

  • 이번 문제는 사용자 경험을 위한 Lint 경고로 아래 방법 중 프로젝트에 맞는(원하는) 방법을 사용하면 된다

 

  • 방법 1 : AndroidMenifest에 ignore 설정
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    tools:ignore="LockedOrientationActivity"
    package="com.jhdroid.blog.sample">

 

  • 방법 2 : AndroidMenifest <activity>의 screenOrientation 설정 변경
<activity android:name=".MainActivity"
    android:screenOrientation="unspecified"> <!--or fullSensor-->

    <intent-filter>
        <action android:name="android.intent.action.MAIN" />

        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
</activity>
  • 단, 이 경우 가로, 세로 화면을 모두 대응해야 한다.

 

  • 방법 3 : Android Studio에서 Chrome OS Disable 설정

 

 

* 글에 틀린 부분이 있으면 댓글 부탁드립니다 :D

728x90