- Home /
Multiple plugin conflict
At present I am facing problem by using multiple plugin. I have integrated three plugin into same project named as
Admob Ads
Mobile Social Plugin
IABCombo
First I have first two plugins implemented and everything works fine next I add third plugin, it now showing following message when I try to build it in android. Following image represent generated message.
As per my analysis for this problem is that: Unity combine all jar files classes and then use it. So at present there are multiple copies of classes exist after adding third plugin.
I can't able to figure out how to handle this problem?? Provide some guidance about this problem because I know there are lots of developer facing same problem.
Answer by liortal · Aug 08, 2014 at 09:20 PM
First off, for general knowledge, DEX is the process that takes code files (whether it's your code, or code that is provided in libraries) and converts it into the DEX format (Dalvik Executable).
Libraries are only used for convenience during development: when you build your game, there's no notion of libraries anymore - it's all just compiled code.
For this reason, when 2 or more plugins reference the same library (contain 2 copies of a referenced JAR) or define a class with the same name, a conflict occurs, causing this error.
For example: if you are using 2 plugins in your Unity project and both contain a copy of GooglePlayServices.jar, DEX will fail to build your game, since it will try to process multiple copies of the same class.
In your case, it is not clear whether this is the case (multiple copies of the same jar) or whether it's multiple copies of the same class.
The first one is easier to spot (look for multiple copies of the same JAR). the 2nd one is trickier but it will help if you provided some more information (e.g: is there any extra information in the Unity console? the DEX tool should provide the name of the class that causes the failure for example).
NOTE: In some cases, it gets tricky to find out why the build fails. If all else fails, I offer my help to fix Android related build issues (due to manifest merging, conflicting plugins, etc). Check it out if you're unable to resolve your issues !
Thanks for this nice explanation. I think in my case, there are multiple copies of class file exist among jar files. So how to track these problem as per your consideration?
One more thing I up vote your answer for clear explanation.
Is there any more information in the unity console? usually the DEX tool should tell you exactly what's causing the error. For example, see this: http://answers.unity3d.com/questions/672365/unable-to-convert-classes-into-dex-format.html
The error shown in the console is
stderr[ UNEXPECTED TOP-LEVEL EXCEPTION: java.lang.IllegalArgumentException: a*lready added: Landroid/support/v4/hardware/display/Display$$anonymous$$anagerCompat;*
In your case it should also show what class was already added and is attempted to be re-added to the DEX.
Thanks for your help. Now I clearly understand problem that cause this type of error and successfully solved that one.
I modify jar file content and then used new one that conflict with other jar files.
When I want to build I have the same error. (unable to convert classes into dex format) Here is the error: http://pastebin.com/kS7rESRe I can't figure out what's the problem...I deleted same .jar files. Anyone can help me?
The link doesn't work. do you have any duplicate libraries?
Thanks it helped. I had an issue after upgrading Fabrics where for some reason it kept the old associated jar files (ie crashlytics, crashlytics-core, beta, fabric, answers) on top of the new ones. After a search in my project for the respective .jar files, I deleted the old versions.
Answer by Butnaru · Apr 12, 2016 at 04:41 PM
I once had that problem with Google Play Game Services and Facebook SDK v7.4.0 there was 2 files support-v4-23.0.0 and support-v4-23.1.1 so i just remove the last one and it worked
Thank YOU very $$anonymous$$UCH!!! been looking for this 2 days!
Hey! I have the exact same problem, unfortunately I haven't been able to solve it yet as I can't delete my support-v4-23.4.0.aar file?!?! any suggestions? Every time I delete it and restart Unity it just appears again!
Thanks, -Andrew
Answer by aliakbo · May 17, 2016 at 02:49 PM
We had Chartboost and Google Play services in our project and the issue for us was this line in the Chartboost android manifest that was duplicate in other manifests.
<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
deleting it fixed our issue.
i have the same issue i cannot find this line in chartboost android manifest, but i had found in plugin/android/android manifest/under required by chartboost this line was there. then i deleted that line and builded it again same error
Answer by smallbit · Aug 07, 2014 at 10:36 AM
I once had that problem with Google Play Game Services and chartboost ads. The problem lies precisely where you think. The chartboost ads classes were in conflict with those from google play (same name classes for ads). Hence the ads were displayed only via chartboost, the solution was to remove them from the other jar (Google play games). I just changed google play games jar to zip, and opened it in total commander (jar is like zip, you can use any software), than i removed ads folder (could not recall the exact name), changed extension back to jar, and voila I could build without problems :)
Another similar problem on dex classes that I once had,was that I got new plugin that required the newest JDK, hence JDK update solve the issue. The best would be if you will copy full error message from console.
Full error message represented in following image
Also I want to ask one more question that I read in some post. Whether I have to do anything with UnityPlayerNativeActivity? Any sub classing related stuff? or this is totally unrelated here.
in total commander you can use ctrl+pagedown to enter any compressed file without changing it to zip
Answer by Bilgisoft · Sep 04, 2016 at 11:20 PM
Thanks Butnaru thats true. worked.
Please help if anyone knows about this issue
CommandInvokationFailure: Unable to convert classes into dex format. C:/Program Files/Java/jdk1.8.0_162\bin\java.exe -Xmx2048$$anonymous$$ -Dcom.android.sdkmanager.toolsdir="G:/android-sdks\tools" -Dfile.encoding=UTF8 -jar "C:\UNity 5.6.3\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\sdktools.jar" -
stderr[ Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat; Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/app/ActivityCompat; Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/app/ActivityCompat$1; Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/app/ActivityCompat$OnRequestPermissionsResultCallback; Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/app/ActivityCompat$SharedElementCallback21Impl; Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/app/Activity$$anonymous$$anagerCompat; Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/app/ActivityOptionsCompat; Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/app/AppOps$$anonymous$$anagerCompat; Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/app/BundleUtil;
UNEXPECTED TOP-LEVEL EXCEPTION: java.lang.RuntimeException: Translation has been interrupted at com.android.dx.command.dexer.$$anonymous$$ain.processAllFiles($$anonymous$$ain.java:615) at com.android.dx.command.dexer.$$anonymous$$ain.run$$anonymous$$onoDex($$anonymous$$ain.java:313) at com.android.dx.command.dexer.$$anonymous$$ain.runDx($$anonymous$$ain.java:291) at com.android.dx.command.dexer.$$anonymous$$ain.main($$anonymous$$ain.java:247) at com.android.dx.command.$$anonymous$$ain.main($$anonymous$$ain.java:94) at sun.reflect.Native$$anonymous$$ethodAccessorImpl.invoke0(Native $$anonymous$$ethod) at sun.reflect.Native$$anonymous$$ethodAccessorImpl.invoke(Native$$anonymous$$ethodAccessorImpl.java:62) at sun.reflect.Delegating$$anonymous$$ethodAccessorImpl.invoke(Delegating$$anonymous$$ethodAccessorImpl.java:43) at java.lang.reflect.$$anonymous$$ethod.invoke($$anonymous$$ethod.java:498) at SD$$anonymous$$$$anonymous$$ain.main(SD$$anonymous$$$$anonymous$$ain.java:130) Caused by: java.lang.InterruptedException: Too many errors at com.android.dx.command.dexer.$$anonymous$$ain.processAllFiles($$anonymous$$ain.java:607) ... 9 more ]
i have imported chartboost sdk and its giving error of unable to convert classes into dex format,If anybody knows please help me 0out.Thanlkyou
CommandInvokationFailure: Unable to convert classes into dex format. C:/Program Files/Java/jdk1.8.0_162\bin\java.exe -Xmx2048$$anonymous$$ -Dcom.android.sdkmanager.toolsdir="G:/android-sdks\tools" -Dfile.encoding=UTF8 -jar "C:\UNity 5.6.3\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\sdktools.jar" -
stderr[ Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat; Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/app/ActivityCompat; Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/app/ActivityCompat$1; Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/app/ActivityCompat$OnRequestPermissionsResultCallback; Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/app/ActivityCompat$SharedElementCallback21Impl; Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/app/Activity$$anonymous$$anagerCompat; Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/app/ActivityOptionsCompat; Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/app/AppOps$$anonymous$$anagerCompat; Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/app/BundleUtil;
UNEXPECTED TOP-LEVEL EXCEPTION: java.lang.RuntimeException: Translation has been interrupted at com.android.dx.command.dexer.$$anonymous$$ain.processAllFiles($$anonymous$$ain.java:615) at com.android.dx.command.dexer.$$anonymous$$ain.run$$anonymous$$onoDex($$anonymous$$ain.java:313) at com.android.dx.command.dexer.$$anonymous$$ain.runDx($$anonymous$$ain.java:291) at com.android.dx.command.dexer.$$anonymous$$ain.main($$anonymous$$ain.java:247) at com.android.dx.command.$$anonymous$$ain.main($$anonymous$$ain.java:94) at sun.reflect.Native$$anonymous$$ethodAccessorImpl.invoke0(Native $$anonymous$$ethod) at sun.reflect.Native$$anonymous$$ethodAccessorImpl.invoke(Native$$anonymous$$ethodAccessorImpl.java:62) at sun.reflect.Delegating$$anonymous$$ethodAccessorImpl.invoke(Delegating$$anonymous$$ethodAccessorImpl.java:43) at java.lang.reflect.$$anonymous$$ethod.invoke($$anonymous$$ethod.java:498) at SD$$anonymous$$$$anonymous$$ain.main(SD$$anonymous$$$$anonymous$$ain.java:130) Caused by: java.lang.InterruptedException: Too many errors at com.android.dx.command.dexer.$$anonymous$$ain.processAllFiles($$anonymous$$ain.java:607) ... 9 more ]
Your answer
Follow this Question
Related Questions
DLL plugins unsupported for Android Application Building 0 Answers
Help Understanding the Use of Unity with Android 1 Answer
Call native android constructor 2 Answers
A node in a childnode? 1 Answer