由于proguard错误,Jenkins构建失败

时间:2014-12-01 12:19:12

标签: android maven jenkins

我在jenkins控制台中收到以下错误。

[ERROR] Failed to execute goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.8.2:proguard (default-proguard) on project ecollect: MojoExecutionException: ANDROID-040-001: Could not execute: Command = /bin/sh -c cd /var/lib/jenkins/jobs/ecollect-with-crop/workspace/ecollect-parent/ecollect && /usr/lib/jvm/java-6-oracle/jre/bin/java -Xmx512M -jar /opt/android-eclipse/adt-bundle/sdk/tools/proguard/lib/proguard.jar @/var/lib/jenkins/jobs/ecollect-with-crop/workspace/ecollect-parent/ecollect/proguard.conf -injars '/var/lib/jenkins/jobs/ecollect-with-crop/workspace/ecollect-parent/ecollect/target/classes' -injars '/var/lib/jenkins/.m2/repository/org/apache/httpcomponents/httpclient-android/4.3.3/httpclient-android-4.3.3.jar(!META-INF/maven/**,!META-INF/MANIFEST.MF)' -injars '/var/lib/jenkins/.m2/repository/org/apache/httpcomponents/httpmime/4.3.3/httpmime-4.3.3.jar(!META-INF/maven/**,!META-INF/MANIFEST.MF)' -injars '/var/lib/jenkins/.m2/repository/com/android/support/support-v4/19.0.1/support-v4-19.0.1.jar(!META-INF/maven/**,!META-INF/MANIFEST.MF)' -injars '/var/lib/jenkins/.m2/repository/com/google/android/gms/google-play-services/13.0.0/google-play-services-13.0.0.jar(!META-INF/maven/**,!META-INF/MANIFEST.MF)' -injars '/var/lib/jenkins/.m2/repository/com/google/code/gson/gson/2.2.4/gson-2.2.4.jar(!META-INF/maven/**,!META-INF/MANIFEST.MF)' -injars '/var/lib/jenkins/.m2/repository/com/innovatics/pdfjet/1.0/pdfjet-1.0.jar(!META-INF/maven/**,!META-INF/MANIFEST.MF)' -libraryjars '/usr/lib/jvm/java-6-oracle/jre/lib/rt.jar' -libraryjars '/usr/lib/jvm/java-6-oracle/jre/lib/jsse.jar' -libraryjars '/usr/lib/jvm/java-6-oracle/jre/lib/jce.jar' -libraryjars '/var/lib/jenkins/.m2/repository/com/google/android/android/4.1.1.4/android-4.1.1.4.jar(!org/xml/**,!org/w3c/**,!java/**,!javax/**)' -libraryjars '/var/lib/jenkins/.m2/repository/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar' -libraryjars '/var/lib/jenkins/.m2/repository/org/apache/httpcomponents/httpclient/4.0.1/httpclient-4.0.1.jar' -libraryjars '/var/lib/jenkins/.m2/repository/org/apache/httpcomponents/httpcore/4.0.1/httpcore-4.0.1.jar' -libraryjars '/var/lib/jenkins/.m2/repository/commons-codec/commons-codec/1.3/commons-codec-1.3.jar' -libraryjars '/var/lib/jenkins/.m2/repository/org/khronos/opengl-api/gl1.1-android-2.1_r1/opengl-api-gl1.1-android-2.1_r1.jar' -libraryjars '/var/lib/jenkins/.m2/repository/xerces/xmlParserAPIs/2.6.2/xmlParserAPIs-2.6.2.jar' -libraryjars '/var/lib/jenkins/.m2/repository/xpp3/xpp3/1.1.4c/xpp3-1.1.4c.jar' -libraryjars '/var/lib/jenkins/.m2/repository/org/json/json/20080701/json-20080701.jar' -outjars

我的proguard配置是:

-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontpreverify
-verbose


##---------------Begin: proguard configuration common for all Android apps ----------
-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontskipnonpubliclibraryclassmembers
-dontpreverify
-verbose
-dump class_files.txt
-printseeds seeds.txt
-printusage unused.txt
-printmapping mapping.txt
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*

-allowaccessmodification
-keepattributes *Annotation*
-renamesourcefileattribute SourceFile
-keepattributes SourceFile,LineNumberTable
-repackageclasses ''

-keep public class * extends android.app.Activity
-keep public class * extends android.app.Application
-keep public class * extends android.app.Service
-keep public class * extends android.content.BroadcastReceiver
-keep public class * extends android.content.ContentProvider
-keep public class * extends android.app.backup.BackupAgentHelper
-keep public class * extends android.preference.Preference
-keep public class com.android.vending.licensing.ILicensingService
-dontnote com.android.vending.licensing.ILicensingService

# Explicitly preserve all serialization members. The Serializable interface
# is only a marker interface, so it wouldn't save them.
-keepclassmembers class * implements java.io.Serializable {
static final long serialVersionUID;
private static final java.io.ObjectStreamField[] serialPersistentFields;
private void writeObject(java.io.ObjectOutputStream);
private void readObject(java.io.ObjectInputStream);
java.lang.Object writeReplace();
java.lang.Object readResolve();
}

# Preserve all native method names and the names of their classes.
-keepclasseswithmembernames class * {
native <methods>;
}

-keepclasseswithmembernames class * {
public <init>(android.content.Context, android.util.AttributeSet);
}

-keepclasseswithmembernames class * {
public <init>(android.content.Context, android.util.AttributeSet, int);
}

# Preserve static fields of inner classes of R classes that might be accessed
# through introspection.
-keepclassmembers class **.R$* {
public static <fields>;
}

# Preserve the special static methods that are required in all enumeration classes.
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}

-keep public class * {
public protected *;
}

-keep class * implements android.os.Parcelable {
public static final android.os.Parcelable$Creator *;
}
##---------------End: proguard configuration common for all Android apps ----------

##---------------Begin: proguard configuration for Gson ----------
# Gson uses generic type information stored in a class file when working with fields. Proguard
# removes such information by default, so configure it to keep all of it.
-keepattributes Signature

# For using GSON @Expose annotation
-keepattributes *Annotation*

# Gson specific classes
-keep class sun.misc.Unsafe { *; }
#-keep class com.google.gson.stream.** { *; }

# Application classes that will be serialized/deserialized over Gson
-keep class com.google.gson.examples.android.model.** { *; }

##---------------End: proguard configuration for Gson ----------

-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*

-keep public class * extends android.app.Activity
-keep public class * extends android.app.Application
-keep public class * extends android.app.Service
-keep public class * extends android.content.BroadcastReceiver
-keep public class * extends android.content.ContentProvider
-keep public class * extends android.app.backup.BackupAgentHelper
-keep public class * extends android.preference.Preference
-keep public class com.android.vending.licensing.ILicensingService

-keepclasseswithmembernames class * {
    native <methods>;
}

-keepclasseswithmembers class * {
    public <init>(android.content.Context, android.util.AttributeSet);
}

-keepclasseswithmembers class * {
    public <init>(android.content.Context, android.util.AttributeSet, int);
}

-keepclassmembers class * extends android.app.Activity {
   public void *(android.view.View);
}

-keepclassmembers enum * {
    public static **[] values();
    public static ** valueOf(java.lang.String);
}

-keep class * implements android.os.Parcelable {
  public static final android.os.Parcelable$Creator *;
}

# adding this in to preserve line numbers so that the stack traces
# can be remapped
-renamesourcefileattribute SourceFile
-keepattributes SourceFile,LineNumberTable
-dontwarn org.apache.http.**
-dontwarn com.google.code.**
-dontwarn com.sumeru.crop.**
-dontwarn org.opencv.**
-dontwarn com.innovatics.**

我正在使用依赖项,

<dependencies>
    <dependency>
        <groupId>org.apache.httpcomponents</groupId>
        <artifactId>httpclient-android</artifactId>
        <version>4.3.3</version>
    </dependency>
    <dependency>
        <groupId>org.apache.httpcomponents</groupId>
        <artifactId>httpmime</artifactId>
        <version>4.3.3</version>
        <exclusions>
            <exclusion>
                <artifactId> httpclient</artifactId>
                <groupId>org.apache.httpcomponents</groupId>
            </exclusion>
        </exclusions>
    </dependency>

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

    </dependency>
    <dependency>
        <groupId>com.android.support</groupId>
        <artifactId>support-v4</artifactId>
        <version>19.0.1</version>
    </dependency>

    <dependency>
        <groupId>com.google.android.gms</groupId>
        <artifactId>google-play-services</artifactId>
        <version>13.0.0</version>
    </dependency>

    <dependency>
        <groupId>com.google.code.gson</groupId>
        <artifactId>gson</artifactId>
        <version>2.2.4</version>
    </dependency>

     <dependency>
        <groupId>com.sumeru.crop</groupId>
        <artifactId>crop-aar</artifactId>
        <version>1.0</version>
        <type>aar</type>
    </dependency> 

</dependencies>

我无法找到这些依赖项的proguard配置。

0 个答案:

没有答案