Unity打包报错Ignoring InnerClasses attribute......

问题

Unity打包Android报错,在Converting Java classes to dex-format的时候提示Unable to convert classes into dex format. See the Console for details.
日志输出如下

stderr[
warning: Ignoring InnerClasses attribute for an anonymous inner class
(xx) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
......

分析

从Android工程复制过来的libs文件夹里的东西和Unity的有冲突,通常是含有和Unity的classes.jar相同内容的jar文件。
解决办法:

解决办法

检查 Assets\Plugins\Android 下是否有jar重复,比如a.jar和b.jar,虽然文件名字不同,但是里面的类是相同的,这种也会出现上面的报错。
检查下Assets\Plugins\Android\libs目录中是否放置了Unity的classes.jar文件 ,如果有,删掉。
检查AndroidManifest.xml 配置。

你可能感兴趣的:(Unity3D,android,sdk,unity,android,jar,libs,innerclasses)