안드로이드 스튜디오 처음 프로젝트 생성시 activity layout 이 안보이는 현상이 발견되었다. 원래대로라면 Hello World 가 저 레이아웃에 보여줘야 하는데....

The following classes could not be instantiated:
- android.support.v7.widget.ActionBarContainer (Open Class, Show Exception, Clear Cache)
- android.support.v7.widget.ActionBarContextView (Open Class, Show Exception, Clear Cache)
- android.support.v7.app.WindowDecorActionBar (Open Class, Show Exception, Clear Cache)

 Tip: Use View.isInEditMode() in your custom views to skip code or show sample data when shown in the IDE.  If this is an unexpected error you can also try to build the project, then manually refresh the layout.

위와 같은 에러 내용인데 리빌드도 하고 layout을 다시 리프레시도 해봤지만 소용이 없었는데 원인을 찾았다.


styles.xml 가
parent="Theme.AppCompat.Light.DarkActionBar"
이렇게 되어있는 부분을
parent="Base.Theme.AppCompat.Light.DarkActionBar"
이렇게 앞에 Base.
 를 붙여줘야한다.

그렇게 변경하고 확인해보니 정상적으로 레이아웃이 표기됨이 확인된다.

 

 

+ Recent posts