【ANE问题记录】dx tool failed:warning: Ignoring InnerClasses attribute for an anonymous inner class that doesn’t come with an associated EnclosingMethod attribute. (This class was probably produced by a broken compiler.)
dx tool failed:warning: Ignoring InnerClasses attribute for an anonymous inner class that doesn’t come with an associated EnclosingMethod attribute. (This class was probably produced by a broken compiler.)
…省略 一大串 重复的警告
UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.IllegalArgumentException: already added: Lcom/xm/ane/xxContext;
at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:123)
at com.android.dx.dex.file.DexFile.add(DexFile.java:143)
at com.android.dx.command.dexer.Main.processClass(Main.java:301)
at com.android.dx.command.dexer.Main.processFileBytes(Main.java:278)
at com.android.dx.command.dexer.Main.access$100(Main.java:56)
at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:229)
at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:244)
at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:130)
at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:108)
at com.android.dx.command.dexer.Main.processOne(Main.java:247)
at com.android.dx.command.dexer.Main.processAllFiles(Main.java:183)
at com.android.dx.command.dexer.Main.run(Main.java:139)
at com.android.dx.command.dexer.Main.main(Main.java:120)
at com.android.dx.command.Main.main(Main.java:89)
1 error; aborting
ANE打包完全没问题,然而在对APK进行打包时 出现这个错。说实话 这样的错误应该算是马虎造成的。为啥呢,首先这里针对的打包是 AIR4.0 即支持platform.xml的打包方式
原因在于 在对 <packagedDependencies> 标签 进行jar包配置时 将自己写的jar包(即 as3 和 java通信的桥梁包) 包含了进去 然后就导致了这个问题的存在。
解决方案 当然就是在配置中 将 这个jar去掉 即可
注:本人当初是因为加入了自己写的jar包 后面发现 其实只要是重复的加入jar包 都会出这个问题