Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Theme.AppCompat.Light.DarkActionBar - No resource found

Tags:

java

android

adt

How to use properly Android Support Library because i have this error in my manifest file:

android:theme="@style/Theme.AppCompat.Light.DarkActionBar"

error: Error: No resource found that matches the given name 
(at 'theme' with value '@style/Theme.AppCompat.Light.DarkActionBar').
AndroidManifest.xml /ttab   line 39 Android AAPT Problem

My friend did this implementing for me previously on other computer, now i have to do this alone. Please help me:)

I am using ADT

My styles.xml:

<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>

    <style name="Theme.AppCompat.Light">
     <!-- theme customizations here. -->
    </style>


    <style name="Theme.AppCompat.Light.DarkActionBar" parent="Theme.AppCompat.Light">
      <!-- theme customizations here. -->
    </style>


</resources>
like image 336
Jerry Avatar asked Aug 21 '13 18:08

Jerry


3 Answers

In "android-support-v7-appcompat" project:

  • Delete “android-support-v7-appcompat” from Package explorer.
  • Import again and check “Copy into workspace”
  • In Properties -> Android -> in Project build target, uncheck Android 2.2 and check Android 4.1.2
  • In Java build path, uncheck if you have any .jar library, and uncheck the Dependences

In other hand, the project that uses “android-support-v7-appcompat”:

  • In Properties -> Android add the library, but uncheck "IsLibrary”.
  • In Android -> Project build tarjet check Android 4.0.
  • In "Java Build Path" -> Order and Export -> Unchecked the .jar library
  • Finally do a “Project -> Clean” both projects
like image 135
Hernaldo Gonzalez Avatar answered Sep 23 '22 18:09

Hernaldo Gonzalez


If you are using Gradle, then you have a problem with the latest version of the compatibility library.

If you have the following in your build.gradle file with a '+' at the end:

dependencies {
    compile 'com.android.support:appcompat-v7:+'
}

then it may be grabbing a later version of the library than you want.

Changing the dependency to:

dependencies {
    compile 'com.android.support:appcompat-v7:18.0+'
}

may fix your problem.

like image 28
ZenBalance Avatar answered Sep 23 '22 18:09

ZenBalance


Could you please try

android:theme="Theme.AppCompat.Light.DarkActionBar"

instead of

android:theme="@style/Theme.AppCompat.Light.DarkActionBar"
like image 30
Alex Avatar answered Sep 20 '22 18:09

Alex