Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
190 views
in Technique[技术] by (71.8m points)

android - Proguard returned with error code 1. See console

I am receiving this exception while creation of signed apk of my application.

I have 5 library projects added to my project as well.

Any hint how to resolve this issue?

Here is my config file:

-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

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

and here is the exception in console.

    [2012-11-03 16:20:10 - ] Proguard returned with error code 1. See console
[2012-11-03 16:20:10 - ] Note: there were 12 duplicate class definitions.
[2012-11-03 16:20:10 - ] Warning: org.mockito.cglib.transform.AbstractProcessTask: can't find superclass or interface org.apache.tools.ant.Task
[2012-11-03 16:20:10 - ] Warning: library class android.test.AndroidTestCase extends or implements program class junit.framework.TestCase
[2012-11-03 16:20:10 - ] Warning: library class android.test.AndroidTestRunner extends or implements program class junit.runner.BaseTestRunner
[2012-11-03 16:20:10 - ] Warning: library class android.test.InstrumentationTestCase extends or implements program class junit.framework.TestCase
[2012-11-03 16:20:10 - ] Warning: library class android.test.InstrumentationTestSuite extends or implements program class junit.framework.TestSuite
[2012-11-03 16:20:10 - ] Warning: library class android.test.suitebuilder.TestSuiteBuilder$FailedToCreateTests extends or implements program class junit.framework.TestCase
[2012-11-03 16:20:10 - ] Warning: org.mockito.cglib.beans.BeanCopier$Generator: can't find referenced class java.beans.PropertyDescriptor
[2012-11-03 16:20:10 - ] Warning: org.mockito.cglib.beans.BeanCopier$Generator: can't find referenced class java.beans.PropertyDescriptor
[2012-11-03 16:20:10 - ] Warning: org.mockito.cglib.beans.BeanCopier$Generator: can't find referenced class java.beans.PropertyDescriptor
[2012-11-03 16:20:10 - ] Warning: org.mockito.cglib.beans.BeanCopier$Generator: can't find referenced class java.beans.PropertyDescriptor
[2012-11-03 16:20:10 - ] Warning: org.mockito.cglib.beans.BeanCopier$Generator: can't find referenced class java.beans.PropertyDescriptor
[2012-11-03 16:20:10 - ] Warning: org.mockito.cglib.beans.BeanCopier$Generator: can't find referenced class java.beans.PropertyDescriptor
[2012-11-03 16:20:10 - ] Warning: org.mockito.cglib.beans.BeanCopier$Generator: can't find referenced class java.beans.PropertyDescriptor
[2012-11-03 16:20:10 - ] Warning: org.mockito.cglib.beans.BeanCopier$Generator: can't find referenced class java.beans.PropertyDescriptor
[2012-11-03 16:20:10 - ] Warning: org.mockito.cglib.beans.BeanCopier$Generator: can't find referenced class java.beans.PropertyDescriptor
[2012-11-03 16:20:10 - ] Warning: org.mockito.cglib.beans.BeanCopier$Generator: can't find referenced class java.beans.PropertyDescriptor
[2012-11-03 16:20:10 - ] Warning: org.mockito.cglib.beans.BeanCopier$Generator: can't find referenced class java.beans.PropertyDescriptor
[2012-11-03 16:20:10 - ] Warning: org.mockito.cglib.beans.BeanCopier$Generator: can't find referenced class java.beans.PropertyDescriptor
[2012-11-03 16:20:10 - ] Warning: org.mockito.cglib.beans.BeanCopier$Generator: can't find referenced class java.beans.PropertyDescriptor
[2012-11-03 16:20:10 - ] Warning: org.mockito.cglib.beans.BeanGenerator: can't find referenced class java.beans.PropertyDescriptor
[2012-11-03 16:20:10 - ] Warning: org.mockito.cglib.beans.BeanGenerator: can't find referenced class java.beans.PropertyDescriptor
[2012-11-03 16:20:10 - ] Warning: org.mockito.cglib.beans.BeanGenerator: can't find referenced class java.beans.PropertyDescriptor
[2012-11-03 16:20:10 - ] Warning: org.mockito.cglib.beans.BeanGenerator: can't find referenced class java.beans.PropertyDescriptor
[2012-11-03 16:20:10 - ] Warning: org.mockito.cglib.beans.BeanGenerator: can't find referenced class java.beans.PropertyDescriptor
[2012-11-03 16:20:10 - ] Warning: org.mockito.cglib.beans.BeanMapEmitter: can't find referenced class java.beans.PropertyDescriptor
[2012-11-03 16:20:10 - ] Warning: org.mockito.cglib.beans.BeanMapEmitter: can't find referenced class java.beans.PropertyDescriptor
[2012-11-03 16:20:10 - ] Warning: org.mockito.cglib.beans.BeanMapEmitter: can't find referenced class java.beans.PropertyDescriptor
[2012-11-03 16:20:10 - ] Warning: org.mockito.cglib.beans.BeanMapEmitter: can't find referenced class java.beans.PropertyDescriptor
[2012-11-03 16:20:10 - ] Warning: org.mockito.cglib.beans.BeanMapEmitter$1: can't find referenced class java.beans.PropertyDescriptor
[2012-11-03 16:20:10 - ] Warning: org.mockito.cglib.beans.BeanMapEmitter$1: can't find referenced class java.beans.PropertyDescriptor
[2012-11-03 16:20:10 - ] Warning: org.mockito.cglib.beans.BeanMapEmitter$1: can't find referenced class java.beans.PropertyDescriptor
[2012-11-03 16:20:10 - ] Warning: org.mockito.cglib.beans.BeanMapEmitter$2: can't find referenced class java.beans.PropertyDescriptor
[2012-11-03 16:20:10 - ] Warning: org.mockito.cglib.beans.BeanMapEmitter$2: can't find referenced class java.beans.PropertyDescriptor
[2012-11-03 16:20:10 - ] Warning: org.mockito.cglib.beans.BeanMapEmitter$2: can't find referenced class java.beans.PropertyDescriptor
[2012-11-03 16:20:10 - ] Warning: org.mockito.cglib.beans.BeanMapEmitter$2: can't find referenced class java.beans.PropertyDescriptor
[2012-11-03 16:20:10 - ] Warning: org.mockito.cglib.beans.BeanMapEmitter$3: can't find referenced class java.beans.PropertyDescriptor
[2012-11-03 16:20:10 - ] Warning: org.mockito.cglib.beans.BeanMapEmitter$3: can't find referenced class java.beans.PropertyDescriptor
[2012-11-03 16:20:10 - ] Warning: org.mockito.cglib.beans.BeanMapEmitter$3: can't find referenced class java.beans.PropertyDescriptor
[2012-11-03 16:20:10 - ] Warning: org.mockito.cglib.beans.ImmutableBean$Generator: can't find referenced class java.beans.PropertyDescriptor
[2012-11-03 16:20:10 - ] Warning: org.mockito.cglib.core.ReflectUtils: can't find referenced class java.beans.PropertyDescriptor
[2012-11-03 16:20:10 - ] Warning: org.mockito.cglib.core.ReflectUtils: can't find referenced class java.beans.PropertyDescriptor
[2012-11-03 16:20:10 - ] Warning: org.mockito.cglib.core.ReflectUtils: can't find referenced class java.beans.PropertyDescriptor
[2012-11-03 16:20:10 - ] Warning: org.mockito.cglib.core.ReflectUtils: can't find referenced class java.beans.IntrospectionException
[2012-11-03 16:20:10 - ] Warning: org.mockito.cglib.core.ReflectUtils: can't find referenced class java.beans.Introspector
[2012-11-03 16:20:10 - ] Warning: org.mockito.cglib.core.ReflectUtils: can't find referenced class java.beans.Introspector
[2012-11-03 16:20:10 - ] Warning: org.mockito.cglib.core.ReflectUtils: can't find referenced class java.beans.BeanInfo
[2012-11-03 16:20:10 - ] Warning: org.mockito.cglib.core.ReflectUtils: can't find referenced class java.beans.BeanInfo
[2012-11-03 16:20:10 - ] Warning: org.mockito.cglib.core.ReflectUtils: can't find referenced class java.beans.PropertyDescriptor
[2012-11-03 16:20:10 - ] Warning: org.mockito.cglib.core.ReflectUtils: can't find referenced class java.beans.PropertyDescriptor
[2012-11-03 16:20:10 - ] Warning: org.mockito.cglib.core.ReflectUtils: can't find referenced class java.beans.PropertyDescriptor
[2012-11-03 16:20:10 - ] Warning: org.mockito.cglib.core.ReflectUtils: can't find referenced class java.beans.PropertyDescriptor
[2012-11-03 16:20:10 - ] Warning: org.mockito.cglib.core.ReflectUtils: can't find referenced class java.beans.PropertyDescriptor
[2012-11-03 16:20:10 - ] Warning: org.mockito.cglib.core.ReflectUtils: can't find referenced class java.beans.PropertyDescriptor
[2012-11-03 16:20:10 - ] Warning: org.mockito.cglib.core.ReflectUtils: can't find referenced class java.beans.PropertyDescriptor
[2012-11-03 16:20:10 - ] Warning: org.mockito.cglib.core.ReflectUtils: can't find referenced class java.beans.PropertyDescriptor
[2012-11-03 16:20:10 - ] Warning: org.mockito.cglib.core.ReflectUtils: can't find referenced class java.beans.PropertyDescriptor
[2012-11-03 16:20:10 - ] Warning: org.mockito.cglib.core.ReflectUtils: can't find referenced class java.beans.BeanInfo
[2012-11-03 16:20:10 - ] Warning: org.mockito.cglib.core.ReflectUtils: can't find referenced class java.beans.PropertyDescriptor
[2012-11-03 16:20:10 - ] Warning: org.mockito.cglib.core.ReflectUtils: can't find referenced class java.beans.IntrospectionException
[2012-11-03 16:20:10 - ] Warning: org.mockito.cglib.transform.AbstractProcessTask: can't find referenced class org.apache.tools.ant.Task
[2012-11-03 16:20:10 - ] Warning: org.mockito.cglib.transform.AbstractProcessTask: can't find referenced class org.apache.tools.ant.Task
[2012-11-03 16:20:10 - ] Warning: org.mockito.cglib.transform.AbstractProcessTask: can't find referenced method 'org.apache.tools.ant.Project getProject()' in class org.mockito.cglib.transform.AbstractProcessTask
[2012-11-03 16:20:10 - ] Warning: org.mockito.cglib.transform.AbstractProcessTask: can't find referenced class org.apache.tools.ant.types.FileSet
[2012-11-03 16:20:10 - ] Warning: org.mockito.cglib.transform.AbstractProcessTask: can't find referenced class org.apache.tools.ant.types.FileSet
[2012-11-03 16:20:10 - ] Warning: org.mockito.cglib.transform.AbstractProcessTask: can't find referenced class org.apache.tools.ant.DirectoryScanner
[2012-11-03 16:20:10 - ] Warning: org.mockito.cglib.transform.AbstractProcessTask: can't find referenced class org.apache.tools.ant.DirectoryScanner
[2012-11-03 16:20:10 - ] Warning: org.mockito.cglib.transform.AbstractProcessTask: can't find referenced class org.apache.tools.ant.types.FileSet
[2012-11-03 16:20:10 - ] Warning: org.mockito.cglib.transform.AbstractProcessTask: can't find referenced class org.apache.tools.ant.BuildException
[2012-11-03 16:20:10 - ] Warning: org.mockito.cglib.transform.AbstractProcessTask: can't find referenced class org.apache.tools.ant.BuildException
[2012-11-03 16:20:10 - ] Warning: org.mockito.cglib.transform.AbstractProcessTask: can't find referenced class org.apache.tools.ant.types.FileSet
[2012-11-03 16:20:10 - ] Warning: org.mockito.cglib.transform.AbstractProcessTask: can't find referenced class org.apache.tools.ant.types.FileSet
[2012-11-03 16:20:10 - ] Warning: org.mockito.cglib.transform.AbstractProcessTask: can't find referenced class org.apache.tools.ant.types.FileSet
[2012-11-03 16:20:10 - ] Warning: org.mockito.cglib.transform.AbstractProcessTask: can't find referenced class org.apache.tools.ant.DirectoryScanner
[2012-11-03 16:20:10 - ] Warning: org.mockito.cglib.transform.AbstractProcessTask: can't find referenced class org.apache.tools

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Solutions was to ignore warnings as they are internal to lib projects,

I added these settings to config file (proguard-project.txt)

-dontwarn org.mockito.**
-dontwarn sun.reflect.**
-dontwarn android.test.**

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...