简体   繁体   English

Eclipse ADT中的Proguard错误代码1

[英]Proguard Error Code 1 in Eclipse ADT

I know Proguard questions have been asked before and I have been trying to resolve it by just searching through stackoverflow and Google, and have resolved lots of issues but I cannot get any further. 我知道以前曾经问过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)

It says about specifying additional program jars, the only things I've got are Google Play services as a linked library, and I have used the exceptions from Googles API site, and android-support-v4.jar 它说了关于指定其他程序jar的信息,我唯一得到的是将Google Play服务作为链接库,而且我使用了Googles API网站和android-support-v4.jar的异常

Here is my proguard-project.txt (excuse the mess), please note I have serializable classes: 这是我的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.** { *; }

I would greatly appreciate even a small clue as to why it's not working. 我什至不胜感激,甚至对于它为什么不起作用的小提示。

I created a new project and copied my source into and it works now :) 我创建了一个新项目并将其源代码复制到其中,并且现在可以正常工作了:

Problem now is my adverts have disappeared, but that's a different issue 现在的问题是我的广告不见了,但这是另一个问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM