Janin zah
Janin zah

Reputation: 201

Installed Eclipse Android SDK Package (Latest Version: API Level 20), can't run programs that was woking before

I downloaded Eclipse indigo with ADT 22.06.2 a little over a month ago. I had a few projects that compiled and produced apps that apparently ran on BlueStacks.

Today, I downloaded Eclipse juno with ADT 23.02 .1259578.

I imported one of the projects that were working with the Eclipse indigo. Its stylesheets generates the following errors:

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

and

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

They occur in the following three stylesheets( they're the originals that came with one of “Hello World” type examples from Google's site for Android app developers):

<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="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>



<resources>

<!--
    Base application theme for API 11+. This theme completely replaces
    AppBaseTheme from res/values/styles.xml on API 11+ devices.
-->
<style name="AppBaseTheme" parent="Theme.AppCompat.Light">
    <!-- API 11 theme customizations can go here. -->
</style>

</resources>


<resources>

<!--
    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.
-->
<style name="AppBaseTheme" parent="Theme.AppCompat.Light.DarkActionBar">
    <!-- API 14 theme customizations can go here. -->
</style>

</resources>

Apparently, importing the “android-support-v7-appcompat” [the version which came with the new Eclipse package] doesn't help.

When I import my project, I get two (not three) identical errors. They are:

[2014-07-27 18:27:00 - HOGLES200043] Unable to resolve target 'android-19' [2014-07-27 18:27:00 - HOGLES200043] Unable to resolve target 'android-19'

The manifest for this project is the following:

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

<uses-sdk
    android:minSdkVersion="8"
    android:targetSdkVersion="15" />

<uses-feature
    android:glEsVersion="0x00020000" android:required="true" />


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

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

</manifest>

Is there something I'm missing here?

Thanks for your help.

Upvotes: 0

Views: 655

Answers (1)

Janin zah
Janin zah

Reputation: 201

Apparently, just importing libraries isn't enough when they have resources. I followed the following procedure to a T (found at Google's site for Android app developers), and I can compile the project and the app runs like before:

=================================================================================

Adding libraries with resources

To add a Support Library with resources (such as v7 appcompat for action bar) to your application project:

Using Eclipse

Create a library project based on the support library code:

Make sure you have downloaded the Android Support Library using the SDK Manager.
Create a library project and ensure the required JAR files are included in the project's build path:
    Select File > Import.
    Select Existing Android Code Into Workspace and click Next.
    Browse to the SDK installation directory and then to the Support Library folder. For example, if you are adding the appcompat project, browse to <sdk>/extras/android/support/v7/appcompat/.
    Click Finish to import the project. For the v7 appcompat project, you should now see a new project titled android-support-v7-appcompat.
    In the new library project, expand the libs/ folder, right-click each .jar file and select Build Path > Add to Build Path. For example, when creating the the v7 appcompat project, add both the android-support-v4.jar and android-support-v7-appcompat.jar files to the build path.
    Right-click the library project folder and select Build Path > Configure Build Path.
    In the Order and Export tab, check the .jar files you just added to the build path, so they are available to projects that depend on this library project. For example, the appcompat project requires you to export both the android-support-v4.jar and android-support-v7-appcompat.jar files.
    Uncheck Android Dependencies.
    Click OK to complete the changes.

You now have a library project for your selected Support Library that you can use with one or more application projects.

Add the library to your application project:

In the Project Explorer, right-click your project and select Properties.
In the category panel on the left side of the dialog, select Android.
In the Library pane, click the Add button.
Select the library project and click OK. For example, the appcompat project should be listed as android-support-v7-appcompat.
In the properties window, click OK.

Note: If you are using the android-support-v7-mediarouter support library, you should note that it depends on the android-support-v7-appcompat library. In order for the v7 mediarouter library to compile, you must import both library projects into your development workspace. Then follow the procedure above to add the v7 appcompat project as a library to the v7 mediarouter library project.

From:

https://developer.android.com/tools/support-library/setup.html

Upvotes: 1

Related Questions