7

theme.xml:

<style name="Theme.App.ActionBar" parent="style/Widget.AppCompat.Light.ActionBar.Solid.Inverse">
    <!-- Support library compatibility -->
    <!--<item name="elevation">0dp</item>-->
</style>

Error:(160, 5) error: invalid parent reference 'style/Widget.AppCompat.Light.ActionBar.Solid.Inverse'.

APP model: buding.gradle like this:

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'

}

I add com.android.support:appcompat-v7:26.1.0, but whay it is still like this.

I am new to android, what's the point of this.

thank you for your help.

Kotliner
  • 153
  • 2
  • 11
  • 1
    Please read this question https://stackoverflow.com/questions/28877156/no-resource-found-that-matches-the-given-name-androidstyle-widget-appcompat-l?answertab=active#tab-top – Hamlet Leon Jul 20 '18 at 17:44

3 Answers3

14

For Android 2.1 and higher

<style name="MyActionBar" parent="@style/Widget.AppCompat.Light.ActionBar.Solid.Inverse">

For Android 3.0 and higher only

<style name="MyActionBar" parent="@android:style/Widget.Holo.Light.ActionBar.Solid.Inverse">
Mohammed Hamed
  • 859
  • 7
  • 7
1

I also experienced same issue, I tried the following: @android:style/Widget.Holo.Light.ActionBar.Solid.Inverse

the app worked but having a transparent (white) app bar.

So I used this: @style/Widget.AppCompat.Light.ActionBar.Solid.Inverse

it worked perfectly; as designed.

Striped
  • 2,544
  • 3
  • 25
  • 31
0

Had the same Problem. This worked for me:

<style name="MyActionBar" parent="@android:style/Widget.Holo.Light.ActionBar.Solid.Inverse">
Milo
  • 3,365
  • 9
  • 30
  • 44
Erand
  • 1
  • 3