본문 바로가기
개발Study/Android_APP

xml error

by happy90 2015. 1. 1.
SMALL

어떤 예제어플리케이션을 다운받아서 import시켰는데 다음과 같은 에러가 난다.

../main\res\values\styles.xml:4: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.Light'.

!?!!!?

뭔 테마를 못찾는다고 한다.


해당 파일의 소스코드는 간단했다.


구글링해보니 원인은 target API가 안맞아서 그렇다고 한다만....

나는 그냥 내 프로젝트의 소스를 복사해 넣었다.

기존 : 

<resources>

    <!-- Base application theme. -->

    <style name="AppTheme" parent="Theme.Light">

        <!-- Customize your theme here. -->

    </style>

</resources>

변경 후 :

<resources>

    <!--

        Base application theme, dependent on API level. This theme is replaced

        by AppBaseTheme from res/values-vXX/styles.xml on newer devices.

    -->

    <style name="AppBaseTheme" parent="android:Theme.Light">

        <!--

            Theme customizations available in newer API levels can go in

            res/values-vXX/styles.xml, while customizations related to

            backward-compatibility can go here.

        -->

    </style>

    <!-- Application theme. -->

    <style name="AppTheme" parent="AppBaseTheme">

        <!-- All customizations that are NOT specific to a particular API-level can go here. -->

    </style>

</resources>

에러가 사라졌다. 역시 copy and paste가 진리였다~~!



근데 다른 에러가 생겨서 또 잡아야한다 ....


저 코드가 왜 먹힌건지 이유를 찾아야겠다. 문법을 모르니 뭐 알 수가 있나...

찾으면 포스팅해야겠다.


LIST

댓글