Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by CrowbarSka · Apr 23, 2016 at 05:44 PM · androidlibrariesjar

Android plugin conflict: Unable to convert classes into dex format

I am trying to integrate Mobile Social Plugin (https://www.assetstore.unity3d.com/en/#!/content/15066) into my Android game. I already have several other plugins including Admob Ads and Google Play Games services and Unity IAP.

I did have some problems getting it to work and the support team helped me in this thread: http://forum.unity3d.com/threads/released-mobile-social-plugin.229961/page-7#post-2601452

They emailed me a google-play-services.jar file to put in my project, which I did.

Now when I try to build I get this error:

 Build failure
 Unable to convert classes into dex format. See the Console for details.

The console spits out this (edited & updated 14th July):

 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="E:/Matt/AppData/Local/Android/sdk\tools" -Dfile.encoding=UTF8 -jar "C:\Program Files\Unity\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\sdktools.jar" -
 stderr[
 Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/ads/AdRequest;
 Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/ads/AdRequest$ErrorCode;
 Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/ads/AdRequest$Gender;
 Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/ads/AdSize;
 Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/ads/mediation/AbstractAdViewAdapter;
 Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/ads/mediation/AbstractAdViewAdapter$1;
 Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/ads/mediation/AbstractAdViewAdapter$zza;
 Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/ads/mediation/AbstractAdViewAdapter$zzb;
 Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/ads/mediation/AbstractAdViewAdapter$zzc;

I've emailed the support team again but just wanted to open this up to you kind folks to see if I can speed this up. I'm tantalisingly close to hitting beta just as soon as I can get this working!

I've done some digging around and from what I can see this is caused by conflicts with some JAR files in my project. Some people have said they delete a support jar and it works, while others are deleting duplicate classes within the jar.

This is the full list of all .jar files in my entire project:

alt text

How can I find out where the problem lies and what steps to take to solve it?

jars.png (19.9 kB)
Comment
Add comment · Show 7
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image CrowbarSka · Apr 23, 2016 at 11:30 PM 0
Share

Update: I've also tried going through the google-play-services.jar and removing any class that spits out a build error. Eventually it just dumped me back to the starting problem where my AP$$anonymous$$ crashes on launch.

avatar image vijays60 · Jul 08, 2016 at 12:24 PM 0
Share

Any update on this @CrowbarSka, i am stuck with the same problem removing classes / or jars is not helping.

avatar image CrowbarSka vijays60 · Jul 08, 2016 at 12:53 PM 0
Share

I got some help from the plugin developer, but unfortunately I don't know exactly how they fixed it.

I recently updated to Unity 5.3.5f1 and the issue has reappeared, so I'm back in the same boat. I'll be having another look at it next week.

Sorry I can't be more help at the moment.

avatar image vijays60 CrowbarSka · Jul 08, 2016 at 01:14 PM 0
Share

Thanks for your help @CrowbarSka, i followed most of the answers posted in the forum but i couldn't solve this, no duplicate jars and no duplicate class files also, Lastly I just gave a try by switching Unity IAP 'OFF' and back 'ON' for some strange reason it worked its starting building fine for me so I'm not sure how.

Show more comments
avatar image pravinbudharap · Dec 13, 2016 at 07:00 AM 0
Share

hi i have the same problem if you solve this problem so can you sen me the solution ??

avatar image liortal pravinbudharap · Dec 13, 2016 at 07:03 AM 0
Share

see my answer below. you have duplicate libraries in your project.

3 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by FallingRocketGames · Feb 01, 2019 at 12:04 AM

This happened to me as I installed Unity Monetization 3.0, I was getting a smiliar Dex error message and supposedly this happens whenever you have duplicate files in your library, problem was I didn't have any duplicates at least on my assetsgame folder BUT there is a folder under Project called Packages and there was a folder called com.unity.ads the route for me was C:\Users\myuser\AppData\Local\cache\packages\packages.unity.com\ and it was the cause of my problem when I put show in explorer there was a folder called com.unity.ads@2.0.8

Solution for me was to erase that folder, after that compiling was not an issue at all, hope this is useful despite the time.

alt text


unitydexerror.jpg (20.7 kB)
Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by liortal · Jul 15, 2016 at 09:12 AM

This issue you're experiencing happens due to multiple native Android plugins containing the same compiled Java classes (e.g: JARs, .AARs or Android library projects). These plugins contain compiled java classes, and for some reason, in your scenario, the build process is attempting to add 2 or more of the same java class to the final output package.

Sometimes, it will be easy to resolve the issue just by finding out if you have 2 or more JAR files with the same name (that contain the same classes). Unfortunately, JARs and AARs can contain dependant libraries internally, meaning that you won't be able to find out where the duplicate is so easily.

According to the error message, the problem is with duplicated classes that are related to Google ads. This can give you a lead on where to look for the answer.

NOTE: In some cases, it can get a bit tricky to find out why the build fails. If all else fails, I offer a service on Fiverr to help fix Android related build issues (due to manifest merging, conflicting plugins, etc). Check it out if you're unable to resolve your issues !

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by cherucole · Apr 17, 2019 at 10:15 AM

I had this problem too and was able to solve it through the steps below. First study the error e.g Landroid/support/v4/accessibilityservice ... means that you have a file/library called 'android-support-v4...' or 'android.support.v4...' that is causing this problems. Just look for a .jar file with that name and delete it. alt text If the file name isn't called that, you need to decompile the .jar file online to view its contents online here http://www.javadecompilers.com you can then inspect the format of the jar file and see whether it conforms to the error that you were getting in unity. See picture below for details

Good luck!


screenshot-2019-04-17-at-131055.png (52.5 kB)
Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

64 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How can I upgrade my Android Jar Dependencies? 1 Answer

Any resource for creating jar without extending UnityActivityPlayer? 1 Answer

How to read assetbunde from Application.datapath on android 0 Answers

Read NFC tag from Unity3d android 1 Answer

Integrating .jar file with unity 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges