Search code examples
androideclipseappcompatactivity

Compiling and using AppCompatActivity in Eclipse


I have the latest Android Support Library, Android Support Repository and Google Repository (Rev. 23.1, 24, 22 respectively) and working with Eclipse Mars.1(4.5.1)

In the process of giving a make-over to an existing app, I am trying to import the v7.AppCompatActivity library, closing all other projects in workspace and silent prayers. ( ;-) )

Observations:

  • I daresay I have been unsuccessful even after following the instructions here to the dot.

  • Ian Lake's blog looks all hunky-dory, but Utopian.

  • Reading up tons of excellent answers on SO did not yet help. No matter what target is set in the project.properties page or what Build Target is set in the Eclipse Project Properties dialog - just cannot seem to get rid of this (and very similar) compile error(s):

    android-support-v7-appcompat\res\values-v23\styles_base.xml:20: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Button.Colored'.

Going by the number of similar questions, I am surely not alone. Pray, can someone kindly throw some light on how to import the v7 support library without going insane?

Thanks in advance!


Solution

  • None of the answers or blogs pointed out the following, except @pkuszewski.

    The above issue resolves on

    • upgrading to Android 6 Marshmallow API 6.0 with the SDK manager
    • setting the Build Target for the AppCompat project to Android 6.0

    Did I hear, "Duh"? :)

    Thanks, @pkuszewski!

    SDK Manager fragment looks like this, post the fix:

    enter image description here