Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I'm using Android Studio and I have the same res-resolving issue in the my <code>values/styles.xml</code>.</p> <p>It says it cannot resolve <code>@style/Theme.AppCompat.Light</code>, but at compile-time <em>(gradle)</em> and runtime everything works fine <em>(Android 2.3.3 &amp; 4.3)</em>.</p> <p>I'd like to get rid of the warning that the res cannot be resolved.</p> <p><strike><strong>How can I tell Android Studio that this res can be found in the appcompat-v7 repo?</strong></strike><br> <em>(This question was related to a bug in Android Studio that has already been fixed.)</em></p> <hr> <p>Below you see what I did. I hope this will help. Suggestions appreciated.<br> <em>The source for the appcompat library can found on <a href="https://github.com/android/platform_frameworks_support/tree/master/v7/appcompat">github</a>.</em></p> <h3>Gradle integration:</h3> <pre><code>dependencies { ... compile group:'com.android.support', name:'appcompat-v7', version:'18.0.+' ... } </code></pre> <h3>Style-files:</h3> <p>values/styles.xml:</p> <pre><code>&lt;resources&gt; &lt;!-- Base application theme, dependent on API level. This theme is replaced by AppBaseTheme from res/values-vXX/styles.xml on newer devices. --&gt; &lt;style name="AppBaseTheme" parent="android:Theme.Holo.Light"&gt; &lt;!-- Theme customizations available in newer API levels can go in res/values-vXX/styles.xml, while customizations related to backward-compatibility can go here. --&gt; &lt;/style&gt; &lt;!-- Application theme. --&gt; &lt;style name="AppTheme" parent="@style/Theme.AppCompat.Light"&gt; &lt;item name="actionBarStyle"&gt;@style/ActionBar.Solid.Custom&lt;/item&gt; &lt;/style&gt; &lt;style name="ActionBar.Solid.Custom" parent="@style/Widget.AppCompat.Light.ActionBar.Solid"&gt; &lt;item name="background"&gt;@drawable/ab_solid_custom&lt;/item&gt; &lt;item name="displayOptions"&gt;homeAsUp|showHome|showCustom&lt;/item&gt; &lt;/style&gt; &lt;/resources&gt; </code></pre> <p>values-v14/styles.xml:</p> <pre><code>&lt;resources&gt; &lt;!-- Base application theme for API 14+. This theme completely replaces AppBaseTheme from BOTH res/values/styles.xml and res/values-v11/styles.xml on API 14+ devices. --&gt; &lt;style name="AppBaseTheme" parent="android:Theme.Holo.Light"&gt; &lt;!-- API 14 theme customizations can go here. --&gt; &lt;/style&gt; &lt;!-- Application theme. --&gt; &lt;style name="AppTheme" parent="@style/Theme.AppCompat.Light"&gt; &lt;item name="android:actionBarStyle"&gt;@style/ActionBar.Solid.Custom&lt;/item&gt; &lt;/style&gt; &lt;style name="ActionBar.Solid.Custom" parent="@android:style/Widget.Holo.Light.ActionBar.Solid"&gt; &lt;item name="android:background"&gt;@drawable/ab_solid_custom&lt;/item&gt; &lt;item name="android:displayOptions"&gt;homeAsUp|showHome|showCustom&lt;/item&gt; &lt;/style&gt; &lt;/resources&gt; </code></pre> <p>MainActivity <em>(only the extend is mandatory)</em>:</p> <pre><code>public class MainActivity extends ActionBarActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Views.inject(this); setupNavigationDrawer(); } } </code></pre> <p>AndroidManifest.xml <em>(setting android:theme is mandatory)</em>:</p> <pre><code> &lt;activity android:name="com.example.app.MainActivity" android:theme="@style/AppTheme" android:label="@string/app_name" &gt; &lt;intent-filter&gt; &lt;action android:name="android.intent.action.MAIN" /&gt; &lt;category android:name="android.intent.category.LAUNCHER" /&gt; &lt;/intent-filter&gt; &lt;/activity&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload