我正在尝试实施Google几天前发布的新ActionBar支持库.在过去,我使用Google Developer's Support Library Setup页面上列出的相同方法成功实现了ActionBarSherlock,没有任何问题- 使用有关如何包含资源的指南(类似于ActionBarSherlock的工作方式).我将库项目作为库加载到我自己的项目中.
我可以告诉图书馆加载正常.当,而不是在我的MainActivity.java延伸活动,我改成了扩展ActionBarActivity(根据谷歌的说明),也不会出现错误 - 它正确导入.
我甚至尝试绕过style.xml文件并添加@style/Theme.AppCompat.Light
到AndroidManifest.xml中两个直接<application>
和<activity>
具有android:theme="@style/ThemeAppCompat.Light"
与导致同样的错误都尝试.
现在问题是我无法让它改变主题,更不用说甚至构建而不会抛出错误.下面是我收到的错误,后面是我更改为使用新主题的style.xml文件.
我有使用Android应用程序的适度经验,并且使用最新版本的支持库和使用API 18(Android 4.3)编译的SDK运行Eclipse.
构建期间收到错误
错误:检索项目的父项时出错:找不到与给定名称"@ style/Theme.AppCompat.Light"匹配的资源.styles.xml/ActBarTest/res/values line 3 Android AAPT问题
style.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme.ProsoftStudio.ACTest" parent="@style/Theme.AppCompat.Light">
</style>
</resources>
Run Code Online (Sandbox Code Playgroud)
有什么建议?这从来都不是ActionBarSherlock的问题.我想继续使用这个新的支持库.几乎看起来.jar正在加载,但不是资源.
android android-theme android-actionbar android-actionbar-compat
当maven构建我的pom.xml
文件时,我收到编译失败错误.
编译错误是:
error reading C:\Users\amrit\.m2\repository\com\google\android\support-v4\r6\support-v4-r6.jar; invalid LOC header (bad signature).
有谁知道如何解决这个问题?以下是我的pom.xml
档案:
<project xmlns = "http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>MyListReq</groupId>
<artifactId>MyListReq</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>AtosList</name>
<dependencies>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>android</artifactId>
<version>4.1.1.4</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>support-v4</artifactId>
<version>r6</version>
</dependency>
</dependencies>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<fork>true</fork>
<executable>C:\Program Files\Java\jdk1.7.0_03\bin\javac.exe
</executable>
</configuration>
</plugin>
<plugin>
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
<artifactId>android-maven-plugin</artifactId>
<configuration>
<sdk>
<path>${env.ANDROID_HOME}</path>
<platform>17</platform>
</sdk>
</configuration>
<extensions>true</extensions>
</plugin>
</plugins>
</build>
Run Code Online (Sandbox Code Playgroud)
我无法解决这个问题.任何形式的帮助将不胜感激.