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 配置。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章