现在的位置: 首页 > 编程语言 > 正文

代码混淆错误

2017年11月14日 编程语言 ⁄ 共 4965字 ⁄ 字号 评论关闭

代码混淆时的错误如下:

<span style="color:#ff0000;"><span style="font-size:14px;">[2014-08-18 14:35:01 - MicroLectureWorkshop] Proguard returned with error code 1. See console
[2014-08-18 14:35:01 - MicroLectureWorkshop] Note: there were 6 duplicate class definitions.
[2014-08-18 14:35:01 - MicroLectureWorkshop] Warning: library class android.content.res.XmlResourceParser extends or implements program class org.xmlpull.v1.XmlPullParser
[2014-08-18 14:35:01 - MicroLectureWorkshop] Warning: library class android.content.Intent depends on program class org.xmlpull.v1.XmlPullParser
[2014-08-18 14:35:01 - MicroLectureWorkshop] Warning: library class android.content.IntentFilter depends on program class org.xmlpull.v1.XmlSerializer
[2014-08-18 14:35:01 - MicroLectureWorkshop] Warning: library class android.content.IntentFilter depends on program class org.xmlpull.v1.XmlPullParser
[2014-08-18 14:35:01 - MicroLectureWorkshop] Warning: library class android.content.res.ColorStateList depends on program class org.xmlpull.v1.XmlPullParser
[2014-08-18 14:35:01 - MicroLectureWorkshop] Warning: library class android.graphics.drawable.AnimationDrawable depends on program class org.xmlpull.v1.XmlPullParser
[2014-08-18 14:35:01 - MicroLectureWorkshop] Warning: library class android.graphics.drawable.BitmapDrawable depends on program class org.xmlpull.v1.XmlPullParser
[2014-08-18 14:35:01 - MicroLectureWorkshop] Warning: library class android.graphics.drawable.ClipDrawable depends on program class org.xmlpull.v1.XmlPullParser
[2014-08-18 14:35:01 - MicroLectureWorkshop] Warning: library class android.graphics.drawable.Drawable depends on program class org.xmlpull.v1.XmlPullParser
[2014-08-18 14:35:01 - MicroLectureWorkshop] Warning: library class android.graphics.drawable.Drawable depends on program class org.xmlpull.v1.XmlPullParser
[2014-08-18 14:35:01 - MicroLectureWorkshop] Warning: library class android.graphics.drawable.Drawable depends on program class org.xmlpull.v1.XmlPullParser
[2014-08-18 14:35:01 - MicroLectureWorkshop] Warning: library class android.graphics.drawable.InsetDrawable depends on program class org.xmlpull.v1.XmlPullParser
[2014-08-18 14:35:01 - MicroLectureWorkshop] Warning: library class android.graphics.drawable.LayerDrawable depends on program class org.xmlpull.v1.XmlPullParser
[2014-08-18 14:35:01 - MicroLectureWorkshop] Warning: library class android.graphics.drawable.ShapeDrawable depends on program class org.xmlpull.v1.XmlPullParser
[2014-08-18 14:35:01 - MicroLectureWorkshop] Warning: library class android.graphics.drawable.ShapeDrawable depends on program class org.xmlpull.v1.XmlPullParser
[2014-08-18 14:35:01 - MicroLectureWorkshop] Warning: library class android.graphics.drawable.StateListDrawable depends on program class org.xmlpull.v1.XmlPullParser
[2014-08-18 14:35:01 - MicroLectureWorkshop] Warning: library class android.util.Xml depends on program class org.xmlpull.v1.XmlPullParser
[2014-08-18 14:35:01 - MicroLectureWorkshop] Warning: library class android.util.Xml depends on program class org.xmlpull.v1.XmlSerializer
[2014-08-18 14:35:01 - MicroLectureWorkshop] Warning: library class android.util.Xml depends on program class org.xmlpull.v1.XmlPullParser
[2014-08-18 14:35:01 - MicroLectureWorkshop] Warning: library class android.view.LayoutInflater depends on program class org.xmlpull.v1.XmlPullParser
[2014-08-18 14:35:01 - MicroLectureWorkshop] Warning: library class android.view.LayoutInflater depends on program class org.xmlpull.v1.XmlPullParser
[2014-08-18 14:35:01 - MicroLectureWorkshop]       You should check if you need to specify additional program jars.
[2014-08-18 14:35:01 - MicroLectureWorkshop] Warning: there were 21 instances of library classes depending on program classes.
[2014-08-18 14:35:01 - MicroLectureWorkshop]          You must avoid such dependencies, since the program classes will
[2014-08-18 14:35:01 - MicroLectureWorkshop]          be processed, while the library classes will remain unchanged.
[2014-08-18 14:35:01 - MicroLectureWorkshop] java.io.IOException: Please correct the above warnings first.
[2014-08-18 14:35:01 - MicroLectureWorkshop] 	at proguard.Initializer.execute(Initializer.java:321)
[2014-08-18 14:35:01 - MicroLectureWorkshop] 	at proguard.ProGuard.initialize(ProGuard.java:211)
[2014-08-18 14:35:01 - MicroLectureWorkshop] 	at proguard.ProGuard.execute(ProGuard.java:86)
[2014-08-18 14:35:01 - MicroLectureWorkshop] 	at proguard.ProGuard.main(ProGuard.java:492)</span>
</span>

原因,系统自带的和我们的库里边的类冲突了,换句话说同名类。我们删掉就可以了

<span style="color:#ff0000;"><span style="font-size:14px;">org.xmlpull.v1 我们找下这个包在哪个库下边。。、</span></span>
<span style="color:#ff0000;"><span style="font-size:14px;">有时候,我们的工程引用了好多第三方的库,而第三方库又引用了别的jar包,那么咋找了。。。看下图找起来方便点。</span></span>
<span style="color:#ff0000;"><span style="font-size:14px;">所有的关联jar包都在这里。点开就能看到对应的包名了。。</span></span>
<span style="color:#ff0000;"><span style="font-size:14px;"><img src="http://img.blog.csdn.net/20140818145849693?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvc2FsbWFuaXQ=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="" />
</span></span>
<span style="color:#ff0000;"><span style="font-size:14px;">
</span></span>

如上,我们看到了就是那个ksoap的问题。。

找到他,鼠标放到库后边可以看到路径的额。。

我们要做的恨简单,右键,解压缩。。然后点击去找到那2个类,删掉,然后在把解压的东西压缩。。我们的压缩软件没有jar这个后缀的,,随便了压缩成.zip的,完事自己改下后缀就好了。。。 全部弄完,工程clean下。。记得那个引用这个jar的第三方库也clean下。。最好

最好,好了。。。

抱歉!评论已关闭.