radhika
radhika

Reputation: 51

How to resolve Theme.AppCompat.Light error

I am facing a issue after run existing android studio project. Please check error below and let me know how to resolve that.

Error:(54) Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'.

Thanks in advance

Upvotes: 0

Views: 2074

Answers (4)

Kalnode
Kalnode

Reputation: 11394

Ran into same issue as OP, March 2017 Android Studio 2.3.

My build was working fine for months, and this issue came up right after adding a new line to gradle build file. Ultimately making some changes in Gradle and re-sync'ing fixed the issue, but my Gradle ended up being exactly the same as when the issue first came up, strangely.

My original Gradle build dependencies:

    compile 'com.android.support:design:25.1.1'
    compile 'com.android.support:multidex:1.0.1'
    compile 'com.android.support:support-v4:25.1.1'
    compile 'com.android.support:appcompat-v7:25.1.1'
    compile 'com.android.support:gridlayout-v7:25.1.1'
    compile 'com.android.support:cardview-v7:25.1.1'
    compile 'com.android.support:recyclerview-v7:25.1.1'    
    compile 'com.google.android.gms:play-services-location:10.0.0'
    compile 'com.google.android.gms:play-services-maps:10.0.0'       
    compile 'com.google.maps.android:android-maps-utils:0.5'    
    compile 'com.android.volley:volley:1.0.0'
    compile 'com.google.code.gson:gson:2.4'

Then, I simply added a new line:

    compile 'org.scribe:scribe:1.3.5'

This is when the issue appeared, same as OP.

I saw red errors in my styles.xml and wondered "wtf?".

Cleaning and re-building had no affect.

Going back to the Gradle build file, I commented-out that new line. ISSUE RESOLVED! So obviously there was something going on.

For fun, I put that line, uncommented, at the top of this compile list. NO ISSUE!

For fun yet again, I put that line back again to the bottom of the list (like how originally added it). NO ISSUE.... weird!

How Gradle sync'ing responds doesn't seem to be 100% consistent. I did no other changes to my project. All I can say is try toggling and re-ordering things in the compile list.

Upvotes: 0

naixx
naixx

Reputation: 1184

Try to use accroding gradle plugin. I've got the problem with plugin 2.3-beta1 and Studio 2.2.3, when changed to plugin 2.2.3 - everything worked like a charm

Upvotes: 2

Shridutt Kothari
Shridutt Kothari

Reputation: 7394

Our compile SDK version must match the support library's major version.

If you are using version 23 of the support library, you need to compile against version 23 of the Android SDK.

Alternatively you can continue compiling against version 22 of the Android SDK by switching to the latest support library v22.

You can either change it manually in your build.gradle, or you can use the GUI by opening up the project properties and going to the "dependencies" tab.

Or Press Ctrl + Shift + Alt + S to get to the project structure page. Go to the properties tab and change version to 23.0.0 or whatever latest in the build tool area and rebuild your project.

If that doesn't work, go to gradle:app and then

compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.1'

Edit version as shown above and sync gradle.

Upvotes: 1

Chirag Arora
Chirag Arora

Reputation: 816

Please change compileSdkVersion and buildToolsVersion in your gradle file according to your android studio existing running project.

Upvotes: 1

Related Questions