• Register
1 vote
100 views

Problem :

I am very new to google play games services and Admob plugin. Currently I am trying to build the APK using google play games services and Admob plugin but it is not working for me. I am facing below error.

CommandInvokationFailure: Unable to convert classes into dex format.
C:/Program Files/Java/jdk1.8.0_121\bin\java.exe -Xmx2048M -Dcom.android.sdkmanager.toolsdir="C:/Users/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/android/gms/internal/zzbyb;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/internal/zzbyc;
2 errors; aborting
]

Please Note: I am using Unity 5.6.1f1 (64-bit)

Please help me in fixing above error.

8 5 2
3,230 points

Please log in or register to answer this question.

2 Answers

1 vote

Solution :

I had recently helped couple of people to fix above error.

The error starts appearing if you have any duplicate plugins in the project;

Please find below listed scenarios for your help:

If you have included the same plugin more than once under different folders of your project.

If you have included the same plugin more than once with different versions.

If your plugin contains some other dependencies embedded inside it and they are already included in your project in other form.

To fix this issue you should look up for any duplicate Android plugins in the project and try to eliminate the duplicates by keeping only one copy. From your error message which you have posted I can surely say that the issue here is related to your Google play services libraries. So you should try to look into the libraries which are named play-services-xxxx.aar.

8 4
5,680 points
0 votes

When the unity builds your project for Andriod, then it has to invoke several tools from the Andriod SDK. It converts all of your native code for Andriod into a file format called DEX.

All of Andriod plugins are built on a single package using that tool. The problem starts a few plugins have the same compiled java code in them. This will cause the DEX tool to fail within an error.

This means that the classes with those names were already included in another library. So, they cannot be added again.

Possible Causes:

This error occurs when you have duplicate plugins in your project. This can happen in different scenarios.

Examples:

Here are some examples;

  • The same plugin is included more than once, under different folders of the project.
  • The same plugin can be included more than once with different versions.
  • A plugin contains other dependencies “embedded” inside it. But these dependencies are already included in the project in some form.

Solution:

You should have to look at duplicate plugins in your project and eliminate them. From the error message you posted, the issue is related to Google Play services libraries. You should look into that library named play-services-xxxx-aar.

11 5 2
3,890 points

Related questions

0 votes
1 answer 11 views
11 views
Problem: the ad size and ad unit id must be set before loadad is called.
asked Feb 21 charles mathews 3.8k points
0 votes
2 answers 968 views
968 views
Problem : I want to upload the finished android app to a android market but I am getting below error: “You need to use a different package name because "com.example" is restricted.”
asked Jan 22, 2020 jwilliam 3.9k points
0 votes
1 answer 9 views
0 votes
1 answer 46 views
46 views
Problem: I am trying to understand UNITY C#. I am facing the below error A field initializer cannot reference the nonstatic field unity. If tried to get the list from another script. Please find below my code. //Excerpt from a script where I get a component ... list in the other script  (TM) public List<GameObject> TilesL = new List<GameObject>(); Kindly help me in fixing above unity error.
asked Jul 20, 2020 Raphael Pacheco 4.9k points
0 votes
1 answer 5 views
5 views
Problem: error while retrieving information from server df-dferh-01
asked Feb 19 Dan phillip 1.9k points
0 votes
1 answer 6 views
6 views
Problem: please check your network connection and try again android.
asked Feb 19 Dan phillip 1.9k points
0 votes
1 answer 11 views
11 views
Problem could not find method google() for arguments [] on repository container.
asked Feb 9 charles mathews 3.8k points
0 votes
1 answer 14 views
14 views
Problem: object reference not set to an instance of an object unity.
asked Feb 19 Dan phillip 1.9k points
0 votes
1 answer 13 views
13 views
Problem: trying to send command for object without authority.
asked Feb 18 Shovo210 3.1k points