Android app export error

I am trying to export an android app to publish to google.

My project includes some library dependencies that might cause this problem because it works great for my other apps that don't have dependencies.

I am setting up keystore, password, alias, etc. At the end, when I click 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 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 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 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 see what the problem is?

+3


source to share


1 answer


This is a ProGuard bug, it is not related to your keystore.

ProGuard is a tool that compresses, obfuscates and optimizes your code after compilation, but it can be tricky to set up correctly



From your logarithm, it appears that you are using a library that is not suitable for Android as it uses classes not provided by Android ( javax.microedition.io.*

) and duplicates some of those already provided by the framework ( org.xmlpull.v1.*

)

Check if the application runs when packaged without protection. If so, you will need to correct the proguard config in the file proguard-project.txt

. If not, you need to find another library or change the one you are using to make it android compatible

+2


source







All Articles