No resource found - Theme.AppCompat.Light.DarkActi

2019-01-02 18:04发布

I used ActionBar Style Generator, and now trying to use into my app, but getting :

error: Error retrieving parent for item: No resource found that matches the given name '@style/ Theme.AppCompat.Light.DarkActionBar'.

i am using android-support-v7-appcompat.jar lib inside libs folder

my target is to make my app compatible 2.3 or above

13条回答
只若初见
2楼-- · 2019-01-02 18:17

Using Visual Studio 2015 (Windows7) + Xamarin had this error and after trying multiple things (installing packages, download android_m2repository_r10.zip...) ended removing the full Xamarin folder inside

C:\Users\<my user>\AppData\Local

After that, Rebuild the application in VS and errors disappeared.

查看更多
明月照影归
3楼-- · 2019-01-02 18:21
  1. Update your SDK in the manager and be sure to include Android support library in extra's
  2. Go to SDK in file explorer (Finder on mac) track down the extra's folder (..\sdk\extras\android\support\v7\appcompat\res\values on Windows). Somewhere in there is a themes.xml and themes_base.xml. Copy both of these files.
  3. In your project paste the files into 'values' directory
查看更多
低头抚发
4楼-- · 2019-01-02 18:22

For anyone out there using VS2015, I was getting this error too, and it turns out I hadn't added the library to the project...

Install-Package Xamarin.Android.Support.v7.AppCompat
查看更多
像晚风撩人
5楼-- · 2019-01-02 18:23

I had this same problem. None of the solutions listed here helped my situation. As it turns out, I was importing the parent folder for a project into Android Studio 1.5, rather than the project folder itself. This threw Gradel into a tizzy. Solution was to import the project folder instead.

查看更多
姐姐魅力值爆表
6楼-- · 2019-01-02 18:24

In my case, I took an android project from one computer to another and had this problem. What worked for me was a combination of some of the answers I've seen:

  • Remove the copy of the appcompat library that was in the libs folder of the workspace
  • Install sdk 21
  • Change the project properties to use that sdk build enter image description here
  • Set up and start an emulator compatible with sdks 21
  • Update the Run Configuration to prompt for device to run on & choose Run

Mine ran fine after these steps.

查看更多
冷夜・残月
7楼-- · 2019-01-02 18:27
dependencies {

    compile 'com.android.support:appcompat-v7:23.0.0'

}

This worked for me... in Android Studio...

查看更多
登录 后发表回答