使用ActionBarSherlock的Maven错误Android项目

时间:2012-11-16 05:08:46

标签: android maven actionbarsherlock

我正在使用Maven和android maven插件来构建我的Android项目。

我正在尝试使用Maven为ActionBarSherlock添加依赖项。

<dependency>
  <groupId>com.actionbarsherlock</groupId>
  <artifactId>actionbarsherlock</artifactId>
  <version>4.2.0</version>
  <type>apklib</type>
</dependency>

我已将我的pom.xml编译器版本指定为1.6

<artifactId>maven-compiler-plugin</artifactId>
  <configuration>
  <source>1.6</source>
  <target>1.6</target>
</configuration>

我依赖Maven的Android库的正确版本:

<dependency>
  <groupId>com.google.android</groupId>
  <artifactId>android</artifactId>
  <version>4.1.1.4</version>
  <scope>provided</scope>
</dependency>

我正在使用Android的API级别16,它是: - Maven中央回购的最高价 - 用于构建ActionBarSherlock 4.2.0版本的版本

错误的代表部分在这里:

\target\unpack\apklibs\com.actionbarsherlock_actionbarsherlock_apklib_4.2.0\res\values-v14\abs__styles.xml:4: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.ActionBar'.
\target\unpack\apklibs\com.actionbarsherlock_actionbarsherlock_apklib_4.2.0\res\values-v14\abs__styles.xml:6: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.ActionBar.Solid'.
\target\unpack\apklibs\com.actionbarsherlock_actionbarsherlock_apklib_4.2.0\res\values-v14\abs__styles.xml:8: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.Light.ActionBar'.
\target\unpack\apklibs\com.actionbarsherlock_actionbarsherlock_apklib_4.2.0\res\values-v14\abs__styles.xml:10: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.Light.ActionBar.Solid'.
\target\unpack\apklibs\com.actionbarsherlock_actionbarsherlock_apklib_4.2.0\res\values-v14\abs__styles.xml:12: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.Light.ActionBar.Solid.Inverse'.
    etc...

1 个答案:

答案 0 :(得分:4)

确保您声明了android-maven-plugin的平台版本。

<plugin>
    <groupId>com.jayway.maven.plugins.android.generation2</groupId>
    <artifactId>android-maven-plugin</artifactId>
    <version>3.4.0</version>
    <configuration>
        <sdk>
            <platform>16</platform>
        </sdk>
    </configuration>
</plugin>