Eclipse ADT中的Proguard错误代码1

时间:2014-06-23 22:08:56

标签: java android eclipse

我知道之前已经问过Proguard的问题,我一直试图通过搜索stackoverflow和Google来解决它,并且已经解决了很多问题,但我无法再进一步了解。

Proguard returned with error code 1. See console
      You should check if you need to specify additional program jars.
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
    at proguard.evaluation.Variables.<init>(Variables.java:48)
    at proguard.evaluation.Variables.<init>(Variables.java:59)
    at proguard.evaluation.TracedVariables.<init>(TracedVariables.java:61)
    at proguard.optimize.evaluation.PartialEvaluator.evaluateSingleInstructionBlock(PartialEvaluator.java:800)
    at proguard.optimize.evaluation.PartialEvaluator.evaluateInstructionBlock(PartialEvaluator.java:602)
    at proguard.optimize.evaluation.PartialEvaluator.evaluateInstructionBlockAndExceptionHandlers(PartialEvaluator.java:560)
    at proguard.optimize.evaluation.PartialEvaluator.visitCodeAttribute0(PartialEvaluator.java:264)
    at proguard.optimize.evaluation.PartialEvaluator.visitCodeAttribute(PartialEvaluator.java:181)
    at proguard.optimize.evaluation.EvaluationShrinker.isVariableInitializationNecessary(EvaluationShrinker.java:1784)
    at proguard.optimize.evaluation.EvaluationShrinker.access$1300(EvaluationShrinker.java:45)
    at proguard.optimize.evaluation.EvaluationShrinker$MyVariableInitializationMarker.visitVariableInstruction(EvaluationShrinker.java:675)
    at proguard.classfile.instruction.VariableInstruction.accept(VariableInstruction.java:306)
    at proguard.optimize.evaluation.EvaluationShrinker.visitCodeAttribute0(EvaluationShrinker.java:285)
    at proguard.optimize.evaluation.EvaluationShrinker.visitCodeAttribute(EvaluationShrinker.java:122)
    at proguard.classfile.attribute.CodeAttribute.accept(CodeAttribute.java:101)
    at proguard.classfile.ProgramMethod.attributesAccept(ProgramMethod.java:79)
    at proguard.classfile.attribute.visitor.AllAttributeVisitor.visitProgramMember(AllAttributeVisitor.java:95)
    at proguard.classfile.util.SimplifiedVisitor.visitProgramMethod(SimplifiedVisitor.java:91)
    at proguard.classfile.ProgramMethod.accept(ProgramMethod.java:71)
    at proguard.classfile.ProgramClass.methodsAccept(ProgramClass.java:504)
    at proguard.classfile.visitor.AllMethodVisitor.visitProgramClass(AllMethodVisitor.java:47)
    at proguard.classfile.ProgramClass.accept(ProgramClass.java:346)
    at proguard.classfile.ClassPool.classesAccept(ClassPool.java:116)
    at proguard.optimize.Optimizer.execute(Optimizer.java:425)
    at proguard.ProGuard.optimize(ProGuard.java:306)
    at proguard.ProGuard.execute(ProGuard.java:115)
    at proguard.ProGuard.main(ProGuard.java:492)

它说关于指定其他程序罐,我唯一知道的是Google Play服务作为链接库,我使用了Googles API网站和android-support-v4.jar

的例外情况

这是我的proguard-project.txt(原谅乱七八糟),请注意我有可序列化的类:

# To enable ProGuard in your project, edit project.properties
# to define the proguard.config property as described in that file.
#
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in ${sdk.dir}/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the ProGuard
# include property in project.properties.
#
# For more details, see
#   http://developer.android.com/guide/developing/tools/proguard.html

# Add any project specific keep options here:

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
#   public *;
#}
-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontpreverify
-verbose
-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

#keep all classes that might be used in XML layouts
-keep public class * extends android.view.View
-keep public class * extends android.app.Fragment
-keep public class * extends android.support.v4.Fragment

#keep all public and protected methods that could be used by java reflection
-keepclassmembernames class * {
    public protected <methods>;
}

-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);
}


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

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

-keep class * extends java.util.ListResourceBundle {
    protected Object[][] getContents();
}

-keep public class com.google.android.gms.common.internal.safeparcel.SafeParcelable {
    public static final *** NULL;
}

-keepnames @com.google.android.gms.common.annotation.KeepName class *
-keepclassmembernames class * {
    @com.google.android.gms.common.annotation.KeepName *;
}

-keepnames class * implements android.os.Parcelable {
    public static final ** CREATOR;
}

-keepclassmembers class * implements java.io.Serializable {
    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();
}

-libraryjars libs/android-support-v4.jar
-dontwarn **CompatHoneycomb
-dontwarn android.support.**
-keep class android.support.v4.** { *; }

我非常感谢为什么它不起作用的一小线索。

1 个答案:

答案 0 :(得分:0)

我创建了一个新项目并将我的源代码复制到现在可以正常工作:)

现在问题是我的广告已经消失,但这是一个不同的问题