在Unity3D游戏中使用everyplay unity sdk时的java.lang.IllegalArgumentException

时间:2015-04-24 20:16:31

标签: java android unity3d dex

我尝试导入everyplay包并将其与我的游戏集成,但它的R $ .class与我自己项目的R $ .class冲突。我猜问题是Everplay Android SDK,有资源文件(xmls,...等),还有everyplay.jar,似乎那些android资源文件也是生成的,它们生成R $ .class,这些冲突使用我原来的Unity Androidgame R $ .Class,在尝试构建项目时,我收到以下Dex错误:

  BuildPipeline.BuildPlayer failed, error=Error building Player: CommandInvokationFailure: Unable to convert classes into dex format. See the Console for details.
     C:\Program Files\Java\jdk1.7.0_51\bin\java.exe -Xmx1024M -Dcom.android.sdkmanager.toolsdir="C:/Program Files (x86)/android-sdk\tools" -Dfile.encoding=UTF8 -jar "C:/Program Files (x86)/Unity4.5/Editor/Data/BuildTargetTools/AndroidPlayer\sdktools.jar" -

     stderr[

     UNEXPECTED TOP-LEVEL EXCEPTION:
     java.lang.IllegalArgumentException: already added: Lcom/asgatech/app/R$attr;
         at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:122)
 at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:122)
     at com.android.dx.dex.file.DexFile.add(DexFile.java:161)
     at com.android.dx.command.dexer.Main.processClass(Main.java:732)
     at com.android.dx.command.dexer.Main.processFileBytes(Main.java:673)
     at com.android.dx.command.dexer.Main.access$300(Main.java:83)
     at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:602)
     at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:284)
     at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:166)
     at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:229)
     at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:158)
     at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)
     at com.android.dx.command.dexer.Main.processOne(Main.java:632)
     at com.android.dx.command.dexer.Main.processAllFiles(Main.java:510)
     at com.android.dx.command.dexer.Main.runMonoDex(Main.java:280)
     at com.android.dx.command.dexer.Main.run(Main.java:246)
     at com.android.dx.command.dexer.Main.main(Main.java:215)
     at com.android.dx.command.Main.main(Main.java:106)
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
     at java.lang.reflect.Method.invoke(Method.java:606)
     at SDKMain.main(SDKMain.java:129)
 1 error; aborting

正如你在Unity项目中看到的那样,everyplay插件有自己的资源,等等。 enter image description here

0 个答案:

没有答案