playgameservices / play-games-plugin-for-unity

Google Play Games plugin for Unity
Other
3.46k stars 967 forks source link

GPGS and ChartBoost integration: Unable to convert classes into dex format #1123

Open lconeill opened 8 years ago

lconeill commented 8 years ago

Hi,

I'm trying to build an apk that has the ChartBoost for unity plugin and the playgameservices for unity plugin. Both of these plugins, by themselves, build and function properly, however, when I put them together I get the following error during build:

I've read previous posts about having duplicate jar files or duplicate classes in the jar files but after checking the jars, it doesn't seem like the case. From some other issue posts, I commented out Assets\GooglePlayGames\Editor\GPGSUpgrader.cs (line 98), to stop the deletion of google-play-services_lib, deleted the aar files and tried building with no luck (different error though).

Let me know if any further info is required.

Thanks!

CommandInvokationFailure:` Unable to convert classes into dex format. See the Console for details.
C:\Program Files\Java\jdk1.8.0_60\bin\java.exe -Xmx2048M -Dcom.android.sdkmanager.toolsdir="C:/Program Files (x86)/Android/android-sdk\tools" -Dfile.encoding=UTF8 -jar "C:\Program Files\Unity\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\sdktools.jar" -

stderr[

UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.RuntimeException: Exception parsing classes
    at com.android.dx.command.dexer.Main.processClass(Main.java:752)
    at com.android.dx.command.dexer.Main.processFileBytes(Main.java:718)
    at com.android.dx.command.dexer.Main.access$1200(Main.java:85)
    at com.android.dx.command.dexer.Main$FileBytesConsumer.processFileBytes(Main.java:1645)
    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:672)
    at com.android.dx.command.dexer.Main.processAllFiles(Main.java:574)
    at com.android.dx.command.dexer.Main.runMonoDex(Main.java:311)
    at com.android.dx.command.dexer.Main.run(Main.java:277)
    at com.android.dx.command.dexer.Main.main(Main.java:245)
    at com.android.dx.command.Main.main(Main.java:106)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at SDKMain.main(SDKMain.java:129)
Caused by: com.android.dx.cf.iface.ParseException: bad class file magic (cafebabe) or version (0034.0000)
    at com.android.dx.cf.direct.DirectClassFile.parse0(DirectClassFile.java:472)
    at com.android.dx.cf.direct.DirectClassFile.parse(DirectClassFile.java:406)
    at com.android.dx.cf.direct.DirectClassFile.parseToInterfacesIfNecessary(DirectClassFile.java:388)
    at com.android.dx.cf.direct.DirectClassFile.getMagic(DirectClassFile.java:251)
    at com.android.dx.command.dexer.Main.parseClass(Main.java:764)
    at com.android.dx.command.dexer.Main.access$1500(Main.java:85)
    at com.android.dx.command.dexer.Main$ClassParserTask.call(Main.java:1684)
    at com.android.dx.command.dexer.Main.processClass(Main.java:749)
    ... 19 more
ignacioambrois commented 8 years ago

I am having the same problem, have you found any solution?

lconeill commented 8 years ago

Hey maverick21,

I found out that I had a corrupt unitypackage file. If you are using multiple plugins, I would suggest creating a new test project and import the unitypackages one by one and build each time. The package that gives you the dex error is the one that is corrupt. Once you find which one is corrupt, download the package again and try building.

That solved my problem. Hope it helps you.

claywilkinson commented 8 years ago

Is there still a problem, or can this issue be closed?