Unity 报错之 Unable to convert classes into dex format.

Unity 报错之 Unable to convert classes into dex format.

我的报错原文:

CommandInvokationFailure: Unable to convert classes into dex format.
C:/Program Files/Java/jdk1.8.0_111\bin\java.exe -Xmx2048M -Dcom.android.sdkmanager.toolsdir=“E:/android-sdk\tools” -Dfile.encoding=UTF8 -jar “E:\program files\Unity\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\sdktools.jar” -
stderr[
warning: Ignoring InnerClasses attribute for an anonymous inner class
(com.alipay.sdk.app.H5AuthActivity$11) 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.
warning: Ignoring InnerClasses attribute for an anonymous inner class
(com.alipay.sdk.app.H5AuthActivity$2) 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.
warning: Ignoring InnerClasses attribute for an anonymous inner class
(com.alipay.sdk.app.H5AuthActivity$3) 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.
warning: Ignoring InnerClasses attribute for an anonymous inner class
(com.alipay.sdk.app.H5AuthActivity$4) 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.
warning: Ignoring InnerClasses attribute for an anonymous inner class
(com.alipay.sdk.app.H5AuthActivity$5) 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.
warning: Ignoring InnerClasses attribute for an anonymous inner class
(com.alipay.sdk.app.H5AuthActivity$6) 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.
warning: Ignoring InnerClasses attribute for an anonymous inner class
(com.alipay.sdk.app.H5AuthActivity$6$1) 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.
warning: Ignoring InnerClasses attribute for an anonymous inner class
(com.alipay.sdk.app.H5AuthActivity$7) 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.
warning: Ignoring InnerClasses attribute for an anonymous inner class
(com.alipay.sdk.app.H5AuthActivity$8) 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.
warning: Ignoring InnerClasses attribute for an anonymous inner class
(com.alipay.sdk.app.H5AuthActivity9)thatdoesntcomewithanassociatedEnclosingMethodattribute.Thisclasswasprobablyproducedbyacompilerthatdidnottargetthemodern.classfileformat.Therecommendedsolutionistorecompiletheclassfromsource,usinganuptodatecompilerandwithoutspecifyingany"target"typeoptions.Theconsequenceofignoringthiswarningisthatreflectiveoperationsonthisclasswillincorrectlyindicatethatitisnotaninnerclass.warning:IgnoringInnerClassesattributeforananonymousinnerclass(com.alipay.sdk.app.H5AuthActivity9) 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. warning: Ignoring InnerClasses attribute for an anonymous inner class (com.alipay.sdk.app.H5AuthActivityMyWebViewClient1)thatdoesntcomewithanassociatedEnclosingMethodattribute.Thisclasswasprobablyproducedbyacompilerthatdidnottargetthemodern.classfileformat.Therecommendedsolutionistorecompiletheclassfromsource,usinganuptodatecompilerandwithoutspecifyingany"target"typeoptions.Theconsequenceofignoringthiswarningisthatreflectiveoperationsonthisclasswillincorrectlyindicatethatitisnotaninnerclass.warning:IgnoringInnerClassesattributeforananonymousinnerclass(com.alipay.sdk.app.H5AuthActivity1) 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. warning: Ignoring InnerClasses attribute for an anonymous inner class (com.alipay.sdk.app.H5AuthActivityMyWebViewClient$11)thatdoesntcomewithanassociatedEnclosingMethodattribute.Thisclasswasprobablyproducedbyacompilerthatdidnottargetthemodern.classfileformat.Therecommendedsolutionistorecompiletheclassfromsource,usinganuptodatecompilerandwithoutspecifyingany"target"typeoptions.Theconsequenceofignoringthiswarningisthatreflectiveoperationsonthisclasswillincorrectlyindicatethatitisnotaninnerclass.warning:IgnoringInnerClassesattributeforananonymousinnerclass(com.alipay.sdk.app.H5AuthActivity1) 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. warning: Ignoring InnerClasses attribute for an anonymous inner class (com.alipay.sdk.app.H5AuthActivityMyWebViewClient$12)thatdoesntcomewithanassociatedEnclosingMethodattribute.Thisclasswasprobablyproducedbyacompilerthatdidnottargetthemodern.classfileformat.Therecommendedsolutionistorecompiletheclassfromsource,usinganuptodatecompilerandwithoutspecifyingany"target"typeoptions.Theconsequenceofignoringthiswarningisthatreflectiveoperationsonthisclasswillincorrectlyindicatethatitisnotaninnerclass.warning:IgnoringInnerClassesattributeforananonymousinnerclass(com.alipay.sdk.app.H5AuthActivity2) 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. warning: Ignoring InnerClasses attribute for an anonymous inner class (com.alipay.sdk.app.H5AuthActivityMyWebViewClient$2) 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.
warning: Ignoring InnerClasses attribute for an anonymous inner class
(com.alipay.sdk.app.H5AuthActivity$1) 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.
warning: Ignoring InnerClasses attribute for an anonymous inner class
(com.alipay.sdk.app.H5AuthActivity$10) 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.
warning: Ignoring InnerClasses attribute for an anonymous inner class
(com.alipay.sdk.app.H5PayActivity1)thatdoesntcomewithanassociatedEnclosingMethodattribute.Thisclasswasprobablyproducedbyacompilerthatdidnottargetthemodern.classfileformat.Therecommendedsolutionistorecompiletheclassfromsource,usinganuptodatecompilerandwithoutspecifyingany"target"typeoptions.Theconsequenceofignoringthiswarningisthatreflectiveoperationsonthisclasswillincorrectlyindicatethatitisnotaninnerclass.warning:IgnoringInnerClassesattributeforananonymousinnerclass(com.alipay.sdk.app.H5PayActivity1) 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. warning: Ignoring InnerClasses attribute for an anonymous inner class (com.alipay.sdk.app.H5PayActivityMyWebChromeClient1)thatdoesntcomewithanassociatedEnclosingMethodattribute.Thisclasswasprobablyproducedbyacompilerthatdidnottargetthemodern.classfileformat.Therecommendedsolutionistorecompiletheclassfromsource,usinganuptodatecompilerandwithoutspecifyingany"target"typeoptions.Theconsequenceofignoringthiswarningisthatreflectiveoperationsonthisclasswillincorrectlyindicatethatitisnotaninnerclass.warning:IgnoringInnerClassesattributeforananonymousinnerclass(com.alipay.sdk.app.H5PayActivity1) 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. warning: Ignoring InnerClasses attribute for an anonymous inner class (com.alipay.sdk.app.H5PayActivityMyWebChromeClient2)thatdoesntcomewithanassociatedEnclosingMethodattribute.Thisclasswasprobablyproducedbyacompilerthatdidnottargetthemodern.classfileformat.Therecommendedsolutionistorecompiletheclassfromsource,usinganuptodatecompilerandwithoutspecifyingany"target"typeoptions.Theconsequenceofignoringthiswarningisthatreflectiveoperationsonthisclasswillincorrectlyindicatethatitisnotaninnerclass.warning:IgnoringInnerClassesattributeforananonymousinnerclass(com.alipay.sdk.app.H5PayActivity2) 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. warning: Ignoring InnerClasses attribute for an anonymous inner class (com.alipay.sdk.app.H5PayActivityMyWebChromeClient3)thatdoesntcomewithanassociatedEnclosingMethodattribute.Thisclasswasprobablyproducedbyacompilerthatdidnottargetthemodern.classfileformat.Therecommendedsolutionistorecompiletheclassfromsource,usinganuptodatecompilerandwithoutspecifyingany"target"typeoptions.Theconsequenceofignoringthiswarningisthatreflectiveoperationsonthisclasswillincorrectlyindicatethatitisnotaninnerclass.warning:IgnoringInnerClassesattributeforananonymousinnerclass(com.alipay.sdk.app.H5PayActivity3) 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. warning: Ignoring InnerClasses attribute for an anonymous inner class (com.alipay.sdk.app.H5PayActivityMyWebChromeClient4)thatdoesntcomewithanassociatedEnclosingMethodattribute.Thisclasswasprobablyproducedbyacompilerthatdidnottargetthemodern.classfileformat.Therecommendedsolutionistorecompiletheclassfromsource,usinganuptodatecompilerandwithoutspecifyingany"target"typeoptions.Theconsequenceofignoringthiswarningisthatreflectiveoperationsonthisclasswillincorrectlyindicatethatitisnotaninnerclass.warning:IgnoringInnerClassesattributeforananonymousinnerclass(com.alipay.sdk.app.H5PayActivity4) 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. warning: Ignoring InnerClasses attribute for an anonymous inner class (com.alipay.sdk.app.H5PayActivityMyWebChromeClient5)thatdoesntcomewithanassociatedEnclosingMethodattribute.Thisclasswasprobablyproducedbyacompilerthatdidnottargetthemodern.classfileformat.Therecommendedsolutionistorecompiletheclassfromsource,usinganuptodatecompilerandwithoutspecifyingany"target"typeoptions.Theconsequenceofignoringthiswarningisthatreflectiveoperationsonthisclasswillincorrectlyindicatethatitisnotaninnerclass.warning:IgnoringInnerClassesattributeforananonymousinnerclass(com.alipay.sdk.app.H5PayActivity5) 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. warning: Ignoring InnerClasses attribute for an anonymous inner class (com.alipay.sdk.app.H5PayActivityMyWebChromeClient6)thatdoesntcomewithanassociatedEnclosingMethodattribute.Thisclasswasprobablyproducedbyacompilerthatdidnottargetthemodern.classfileformat.Therecommendedsolutionistorecompiletheclassfromsource,usinganuptodatecompilerandwithoutspecifyingany"target"typeoptions.Theconsequenceofignoringthiswarningisthatreflectiveoperationsonthisclasswillincorrectlyindicatethatitisnotaninnerclass.warning:IgnoringInnerClassesattributeforananonymousinnerclass(com.alipay.sdk.app.H5PayActivity6) 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. warning: Ignoring InnerClasses attribute for an anonymous inner class (com.alipay.sdk.app.H5PayActivityMyWebViewClient1)thatdoesntcomewithanassociatedEnclosingMethodattribute.Thisclasswasprobablyproducedbyacompilerthatdidnottargetthemodern.classfileformat.Therecommendedsolutionistorecompiletheclassfromsource,usinganuptodatecompilerandwithoutspecifyingany"target"typeoptions.Theconsequenceofignoringthiswarningisthatreflectiveoperationsonthisclasswillincorrectlyindicatethatitisnotaninnerclass.warning:IgnoringInnerClassesattributeforananonymousinnerclass(com.alipay.sdk.app.H5PayActivity1) 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. warning: Ignoring InnerClasses attribute for an anonymous inner class (com.alipay.sdk.app.H5PayActivityMyWebViewClient$11)thatdoesntcomewithanassociatedEnclosingMethodattribute.Thisclasswasprobablyproducedbyacompilerthatdidnottargetthemodern.classfileformat.Therecommendedsolutionistorecompiletheclassfromsource,usinganuptodatecompilerandwithoutspecifyingany"target"typeoptions.Theconsequenceofignoringthiswarningisthatreflectiveoperationsonthisclasswillincorrectlyindicatethatitisnotaninnerclass.warning:IgnoringInnerClassesattributeforananonymousinnerclass(com.alipay.sdk.app.H5PayActivity1) 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. warning: Ignoring InnerClasses attribute for an anonymous inner class (com.alipay.sdk.app.H5PayActivityMyWebViewClient$12)thatdoesntcomewithanassociatedEnclosingMethodattribute.Thisclasswasprobablyproducedbyacompilerthatdidnottargetthemodern.classfileformat.Therecommendedsolutionistorecompiletheclassfromsource,usinganuptodatecompilerandwithoutspecifyingany"target"typeoptions.Theconsequenceofignoringthiswarningisthatreflectiveoperationsonthisclasswillincorrectlyindicatethatitisnotaninnerclass.warning:IgnoringInnerClassesattributeforananonymousinnerclass(com.alipay.sdk.app.H5PayActivity2) 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. warning: Ignoring InnerClasses attribute for an anonymous inner class (com.alipay.sdk.app.H5PayActivityMyWebViewClient$2) 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.
warning: Ignoring InnerClasses attribute for an anonymous inner class
(com.alipay.sdk.app.PayTask$1$2) 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.
warning: Ignoring InnerClasses attribute for an anonymous inner class
(com.alipay.sdk.app.PayTask$2) that doesn’t come with an
associated


遇到这个问题也是困扰了我好久,也在网上看了好多问题总结了几个解决方法:

1).classes.jar冲突,unity编译时默认包含了classes.jar ,所以删除Plugins/Android/libs 下的classes.jar
2).检查 Assets\Plugins\Android 下是否有文件重复
3).AndroidManifest.xml 配置问题,

我遇到的问题是Assets\Plugins\Android 有重复的jar包,,因为我前后导入了两个sdk到工程里面,导致了有公用的jar包重复了,所有会报错。
解决办法:找到两个Assets\Plugins\Androidsdk 的jar包所在目录,一一对比看一下有没有重复的,

Unity 报错之 Unable to convert classes into dex format.

这个像这种只有日期有区别(有的可能是版本号),,留下最新的就可以了,,,完美解决问题。心情豁然开朗啊,,,


看博文的你解决问题了吗?,是不是也遇到了类似这样的问题?,,,若有好的解决方案,请您留言赐教,也便帮助更多的人。
希望此博文对你有所帮助哦。