James Funk
James Funk

Reputation: 264

Cannot use android:Theme.AppCompat.Light

I've ready pretty much every question on here, answered or no, and followed all of the steps, to no avail. I am using Eclipse to use Google App Engine. This is what I've done:

-Added android-support-v4.jar to my libs folder -Added android-support-v7-appcompat.jar to my libs folder -Right click project >> Properties >> Libraries tab; Click "Add JARs..." >> browse to libs folder and select those two JARs -Select "Order and Export" tab; checked both of those JARs; unchecked "Android Dependencies"; Click "OK"

This is my styles.xml file:

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

</resources>

This is my AndroidManifest.xml:

<?xml version="1.0" encoding="utf-8" standalone="no"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.appengine"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
    android:minSdkVersion="11"
    android:targetSdkVersion="19" />

<uses-permission android:name="android.permission.INTERNET" />

<permission
    android:name="com.appengine.permission.C2D_MESSAGE"
    android:protectionLevel="signature" />

<uses-permission android:name="com.appengine.permission.C2D_MESSAGE" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.USE_CREDENTIALS" />

<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name=".MainActivity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

    <service android:name=".GCMIntentService" />

    <receiver
        android:name="com.google.android.gcm.GCMBroadcastReceiver"
        android:permission="com.google.android.c2dm.permission.SEND" >
        <intent-filter>
            <action android:name="com.google.android.c2dm.intent.RECEIVE" />

            <category android:name="com.appengine" />
        </intent-filter>
        <intent-filter>
            <action android:name="com.google.android.c2dm.intent.REGISTRATION" />

            <category android:name="com.appengine" />
        </intent-filter>
    </receiver>

    <activity
        android:name=".RegisterActivity"
        android:launchMode="singleTop" />
    <activity
        android:name=".SendData"
        android:launchMode="singleTop"
        android:value="android.support.v7.app.ActionBarActivity" />
</application>

When I attempt to run the project (USB connected Galaxy S4, currently running 4.4.2) I get:

G:\workspace\appengine\res\values\styles.xml:7: error: Error retrieving parent for item: No resource found that matches the given name 'android:Theme.AppCompat.Light'.

I've been fighting this for a few days now, can anyone save me from giving up the life of a developer?

Upvotes: 1

Views: 550

Answers (2)

SteelBytes
SteelBytes

Reputation: 6965

you can't just add the v7 jar to your libs folder. you need to make a library project for v7 and link your project to that.

read the section 'Adding libraries with resources' on https://developer.android.com/tools/support-library/setup.html

PS, but the v4 jar can simply be dropped in the libs folder.

Upvotes: 0

inmyth
inmyth

Reputation: 9050

I have never referenced any theme with android namespace.

Usually it's

<style name="AppTheme" parent="@style/Theme.AppCompat.Light">

or just:

<style name="AppTheme" parent="Theme.AppCompat.Light">

Upvotes: 3

Related Questions