I am getting compilation fail error while maven build my pom.xml
file.
Compilation error is:
error reading C:\Users\amrit\.m2\repository\com\google\android\support-v4\r6\support-v4-r6.jar; invalid LOC header (bad signature).
Does anyone know how to fix this problem?
Below is my pom.xml
file:
<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>
I am not able to fix this problem. Any sort of help will be appreciated.
That error means that the locally cached .jar
is corrupt. Please delete C:\Users\amrit.m2\repository\com\google\android\support-v4\r6\support-v4-r6.jar
and allow Maven to re-download the file.
If the error still occurs then the source repository where Maven is downloading the .jar
from is bad. Consider switching Maven repositories or changing to a different version of the library - r7
(if you can), for example:
<dependency>
<groupId>com.google.android</groupId>
<artifactId>support-v4</artifactId>
<version>r7</version>
</dependency>
Or manually downloading the .jar
from a Maven repository like http://mvnrepository.com/artifact/com.google.android/support-v4/r6
Note: Google aren't responsible for adding those libraries to the Maven repositories, which is why a) they are not kept up to date and b) why (sometimes) they are corrupt - see Android support library setup with maven
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With