3

I am trying to export my android application in order to publish on Google play.

My project includes some library dependencies that may cause this problem, because it is perfectly working for my other apps which do not have dependencies.

I set the keystore, password, alias and etc. At the end when I click on the finish button, it generates this error in the console:

[2013-02-12 13:48:25 - WorkOrder] Proguard returned with error code 1. See console
[2013-02-12 13:48:25 - WorkOrder] Note: there were 5 duplicate class definitions.
[2013-02-12 13:48:25 - WorkOrder] Warning: library class android.content.res.XmlResourceParser extends or implements program class org.xmlpull.v1.XmlPullParser
[2013-02-12 13:48:25 - WorkOrder] Warning: org.ksoap2.transport.ServiceConnectionMidp: can't find referenced class javax.microedition.io.Connector
[2013-02-12 13:48:25 - WorkOrder] Warning: org.ksoap2.transport.ServiceConnectionMidp: can't find referenced class javax.microedition.io.HttpConnection
[2013-02-12 13:48:25 - WorkOrder] Warning: org.ksoap2.transport.ServiceConnectionMidp: can't find referenced class javax.microedition.io.HttpConnection
[2013-02-12 13:48:25 - WorkOrder] Warning: org.ksoap2.transport.ServiceConnectionMidp: can't find referenced class javax.microedition.io.HttpConnection
[2013-02-12 13:48:25 - WorkOrder] Warning: org.ksoap2.transport.ServiceConnectionMidp: can't find referenced class javax.microedition.io.HttpConnection
[2013-02-12 13:48:25 - WorkOrder] Warning: org.ksoap2.transport.ServiceConnectionMidp: can't find referenced class javax.microedition.io.HttpConnection
[2013-02-12 13:48:25 - WorkOrder] Warning: org.ksoap2.transport.ServiceConnectionMidp: can't find referenced class javax.microedition.io.HttpConnection
[2013-02-12 13:48:25 - WorkOrder] Warning: org.ksoap2.transport.ServiceConnectionMidp: can't find referenced class javax.microedition.io.Connector
[2013-02-12 13:48:25 - WorkOrder] Warning: org.ksoap2.transport.ServiceConnectionMidp: can't find referenced class javax.microedition.io.HttpConnection
[2013-02-12 13:48:25 - WorkOrder] Warning: library class android.content.Intent depends on program class org.xmlpull.v1.XmlPullParser
[2013-02-12 13:48:25 - WorkOrder] Warning: library class android.content.IntentFilter depends on program class org.xmlpull.v1.XmlSerializer
[2013-02-12 13:48:25 - WorkOrder] Warning: library class android.content.IntentFilter depends on program class org.xmlpull.v1.XmlPullParser
[2013-02-12 13:48:25 - WorkOrder] Warning: library class android.content.res.ColorStateList depends on program class org.xmlpull.v1.XmlPullParser
[2013-02-12 13:48:25 - WorkOrder] Warning: library class android.graphics.drawable.AnimationDrawable depends on program class org.xmlpull.v1.XmlPullParser
[2013-02-12 13:48:25 - WorkOrder] Warning: library class android.graphics.drawable.BitmapDrawable depends on program class org.xmlpull.v1.XmlPullParser
[2013-02-12 13:48:25 - WorkOrder] Warning: library class android.graphics.drawable.ClipDrawable depends on program class org.xmlpull.v1.XmlPullParser
[2013-02-12 13:48:25 - WorkOrder] Warning: library class android.graphics.drawable.ColorDrawable depends on program class org.xmlpull.v1.XmlPullParser
[2013-02-12 13:48:25 - WorkOrder] Warning: library class android.graphics.drawable.Drawable depends on program class org.xmlpull.v1.XmlPullParser
[2013-02-12 13:48:25 - WorkOrder] Warning: library class android.graphics.drawable.Drawable depends on program class org.xmlpull.v1.XmlPullParser
[2013-02-12 13:48:25 - WorkOrder] Warning: library class android.graphics.drawable.Drawable depends on program class org.xmlpull.v1.XmlPullParser
[2013-02-12 13:48:25 - WorkOrder] Warning: library class android.graphics.drawable.LayerDrawable depends on program class org.xmlpull.v1.XmlPullParser
[2013-02-12 13:48:25 - WorkOrder] Warning: library class android.graphics.drawable.ShapeDrawable depends on program class org.xmlpull.v1.XmlPullParser
[2013-02-12 13:48:25 - WorkOrder] Warning: library class android.graphics.drawable.ShapeDrawable depends on program class org.xmlpull.v1.XmlPullParser
[2013-02-12 13:48:25 - WorkOrder] Warning: library class android.util.Xml depends on program class org.xmlpull.v1.XmlPullParser
[2013-02-12 13:48:25 - WorkOrder] Warning: library class android.util.Xml depends on program class org.xmlpull.v1.XmlSerializer
[2013-02-12 13:48:25 - WorkOrder] Warning: library class android.util.Xml depends on program class org.xmlpull.v1.XmlPullParser
[2013-02-12 13:48:25 - WorkOrder] Warning: library class android.view.LayoutInflater depends on program class org.xmlpull.v1.XmlPullParser
[2013-02-12 13:48:25 - WorkOrder] Warning: library class android.view.LayoutInflater depends on program class org.xmlpull.v1.XmlPullParser
[2013-02-12 13:48:25 - WorkOrder] Warning: there were 9 unresolved references to classes or interfaces.
[2013-02-12 13:48:25 - WorkOrder]          You may need to specify additional library jars (using '-libraryjars').
[2013-02-12 13:48:25 - WorkOrder] Warning: there were 20 instances of library classes depending on program classes.
[2013-02-12 13:48:25 - WorkOrder]          You must avoid such dependencies, since the program classes will
[2013-02-12 13:48:25 - WorkOrder]          be processed, while the library classes will remain unchanged.
[2013-02-12 13:48:25 - WorkOrder] java.io.IOException: Please correct the above warnings first.
[2013-02-12 13:48:25 - WorkOrder]   at proguard.Initializer.execute(Initializer.java:321)
[2013-02-12 13:48:25 - WorkOrder]   at proguard.ProGuard.initialize(ProGuard.java:211)
[2013-02-12 13:48:25 - WorkOrder]   at proguard.ProGuard.execute(ProGuard.java:86)
[2013-02-12 13:48:25 - WorkOrder]   at proguard.ProGuard.main(ProGuard.java:492)

this is the proguard.cfg:

##---------------Begin: proguard configuration common for all Android apps ----------
-dontoptimize
#-dontobfuscate
-dontwarn sun.misc.Unsafe, org.mockito.**, org.junit.**, org.objenesis.instantiator.sun.**, org.mockito.stubbing.Answer, org.mockito.invocation.InvocationOnMock, com.google.common.collect.MinMaxPriorityQueue, org.apache.**

#Use 5 step of optimization 
-optimizationpasses 5

#When not preverifing in a case-insensitive filing system, such as Windows. This tool will unpack your processed jars,(if using windows you should then use):
-dontusemixedcaseclassnames

#Specifies not to ignore non-public library classes. As of version 4.5, this is the default setting
-dontskipnonpubliclibraryclasses
-dontskipnonpubliclibraryclassmembers

#Preverification is irrelevant for the dex compiler and the Dalvik VM, so we can switch it off with the -dontpreverify option.
-dontpreverify

#Specifies to write out some more information during processing. If the program terminates with an exception, this option will print out the entire stack trace, instead of just the exception message.
-verbose

#The -optimizations option disables some arithmetic simplifications that Dalvik 1.0 and 1.5 can't handle. Note that the Dalvik VM also can't handle aggressive overloading (of static fields).
#To understand or change this check http://proguard.sourceforge.net/index.html#/manual/optimizations.html
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*

#To repackage classes on a single package
#-repackageclasses ''

#Uncomment if using annotations to keep them.
#-keepattributes *Annotation*

#Keep classes that are referenced on the AndroidManifest
-keep public class * extends android.app.Activity
#-keep public class * extends android.app.TabActivity { *; }
#-keep public class * extends android.widget.TabHost  { *; }
-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




#To maintain custom components names that are used on layouts XML.
#Uncomment if having any problem with the approach below
#-keep public class custom.components.package.and.name.**


#To remove debug logs:
-assumenosideeffects class android.util.Log {
    public static *** d(...);
    public static *** v(...);
    public static *** w(...);
}

#To avoid changing names of methods invoked on layout's onClick.
# Uncomment and add specific method names if using onClick on layouts
#-keepclassmembers class * {
# public void onClickButton(android.view.View);
#}

#Maintain java native methods 
-keepclasseswithmembernames class * {
    native <methods>;
}


#To maintain custom components names that are used on layouts XML:
-keep public class * extends android.view.View {
    public <init>(android.content.Context);
}
-keep public class * extends android.view.View {
    public <init>(android.content.Context, android.util.AttributeSet);
}
-keep public class * extends android.view.View {
    public <init>(android.content.Context, android.util.AttributeSet, int);
}

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

#To keep parcelable classes (to serialize - deserialize objects to sent through Intents)
-keep class * implements android.os.Parcelable {
  public static final android.os.Parcelable$Creator *;
}

#Keep the R
-keepclassmembers class **.R$* {
    public static <fields>;
}

###### ADDITIONAL OPTIONS NOT USED NORMALLY

#To keep callback calls. Uncomment if using any
#http://proguard.sourceforge.net/index.html#/manual/examples.html#callback
#-keep class mypackage.MyCallbackClass {
#   void myCallbackMethod(java.lang.String);
#}

#Uncomment if using Serializable 
#-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();
#}
##---------------End: proguard configuration common for all Android apps ----------


#Keep classes that are sent across the wire as JSON
-keep public class se.speedup.provider.sync.authentication.CustomerAuthentication  { *; }
-keep public class se.speedup.demo.workorder.model.ObjectEntries { *; }
-keep public class se.speedup.demo.workorder.model.ObjectPropertyValue { *; }
-keep public class se.speedup.demo.workorder.model.FileInfo { *; }
-keep public class se.speedup.demo.workorder.model.PhotoInfo { *; }

-keep public class se.speedup.demo.workorder.model.** { *; }
-keep public class * implements se.speedup.util.market.NonObfuscatable

#-keep public class se.speedup.fastinspec.authentication.AccountActivity { *; }
#-keep public class se.speedup.errorreport.utils.GsonUserInfo { *; }
#-keep public class se.speedup.errorreport.utils.GsonPhotoInfo { *; }
#-keep public class se.speedup.provider.masterdata.MasterdataDataProvider { *; }
#-keep public class se.speedup.util.accounts.CoreAccountConstants { *; }
#-keep public class se.speedup.util.accounts.** { *; }
#-keep public class se.speedup.provider.masterdata.** { *; }
#-keep public class se.speedup.fastinspec.authentication.** { *; }
#-keep public class se.speedup.errorreport.utils.** { *; }
#-keep public class se.speedup.util.networkoperations.** { *; }




#===
#-keep public class se.speedup.demo.workorder.model.*
#-keep public class se.speedup.provider.sync.*
#-keep public class se.speedup.provider.sync.gson.*
#-keep public class se.speedup.provider.sync.account.*
#-keep public class se.speedup.provider.sync.authentication.*
#-keep public class se.speedup.errorreport.utils.gson.*
#-keep public class se.speedup.fastinspec.authentication.*
#=== 
#-keep public class se.speedup.demo.workorder.model.** { *; }
#-keep public class se.speedup.provider.sync.** { *; }
#-keep public class se.speedup.provider.sync.gson.** { *; }
#-keep public class se.speedup.provider.sync.account.** { *; }
#-keep public class se.speedup.provider.sync.authentication.** { *; }
#-keep public class se.speedup.errorreport.utils.gson.** { *; }
#-keep public class se.speedup.fastinspec.authentication.** { *; }

##---------------Begin: used in stack trace  ----------
-printmapping out.map
-renamesourcefileattribute SourceFile
-keepattributes SourceFile,LineNumberTable
##---------------End: used in stack trace  ----------


##---------------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

# 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  ----------

and the project.properties:

android.library.reference.1=..\\ObjectModuleDataProvider
proguard.config=proguard.cfg
# Project target.
target=Google Inc.:Google APIs:17
android.library.reference.2=../SherlockLibrary

Can you figure out what the problem is?

4

1 回答 1

2

这是一个 ProGuard 错误,未链接到您的密钥库。

ProGuard是一种在编译后对代码进行压缩、混淆和优化的工具,但可能难以正确配置

从您的 logcat 看来,您使用的库似乎不适合 Android,因为它使用 Android 未提供的类 ( javax.microedition.io.*) 并复制了框架 ( org.xmlpull.v1.*)已经提供的一些类

检查您的应用程序是否在没有 proguard 的情况下打包运行。如果是,您将需要更正proguard-project.txt文件中的 proguard 配置。如果没有,您需要找到另一个库,或者修改您正在使用的库以使其与 android 兼容

于 2013-02-12T13:02:22.327 回答