Hi guys, I am using the Facebook SDK in my project and I want also to integrate Facebook’s Audience Network SDK. The problem at first that both SDKs come with Android Support libraries, so when I try to build the project the process breaks when converting from java to dex:
CommandInvokationFailure: Unable to convert classes into dex format. See the Console for details.
C:/Program Files/Java/jdk1.8.0_92\bin\java.exe -Xmx2048M -Dcom.android.sdkmanager.toolsdir="C:/Android/sdk ools" -Dfile.encoding=UTF8 -jar "C:\Program Files\Unity\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\sdktools.jar" -
stderr[
Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat;
....]
I try to fix this by removing this library from one of the two SDKs, but in both cases I get another error:
Error building Player: CommandInvokationFailure: Unable to convert classes into dex format. See the Console for details.
C:/Program Files/Java/jdk1.8.0_92\bin\java.exe -Xmx2048M -Dcom.android.sdkmanager.toolsdir="C:/Android/sdk ools" -Dfile.encoding=UTF8 -jar "C:\Program Files\Unity\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\sdktools.jar" -
stderr[
trouble writing output: Too many method references: 65909; max is 65536.
You may try using --multi-dex option.
References by package:
6 android.accessibilityservice
5 android.accounts
12 android.animation
...... (It keeps going with a long list)
I just have no idea on what is causing this second error. Curiously though, if I remove the library from both SDKs, the project will build, but I guess the SDKs won’t work properly.
Any clues?
Thanks!