New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android build failed after upgrading to 0.9.27 using Unity4.6.9,showing"Unable to convert classes into dex format." error #799

Closed
61015ian opened this Issue Nov 13, 2015 · 5 comments

Comments

Projects
None yet
4 participants
@61015ian

61015ian commented Nov 13, 2015

I updated the plugin from 0.9.26 to 0.9.27,but when I tried to build the apk file, it showned "Error building Player: CommandInvokationFailure: Unable to convert classes into dex format. See the Console for details.". I have tried deleting the Plugin and GooglePlayGames folder and reimport the package, but it didn't seem work. However,the compilation success after I degrade the plugin to 0.9.26.
Anyone know why this happen ??

Here is the full error message from the console:


Error building Player: CommandInvokationFailure: Unable to convert classes into dex format. See the Console for details.
C:\Program Files (x86)\Java\jdk1.8.0_60\bin\java.exe -Xmx1024M -Dcom.android.sdkmanager.toolsdir="C:/Users/Ian Chen/AppData/Local/Android/sdk\tools" -Dfile.encoding=UTF8 -jar "C:/Program Files (x86)/Unity/Editor/Data/BuildTargetTools/AndroidPlayer\sdktools.jar" -

stderr[
Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/annotation/WorkerThread;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/annotation/UiThread;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/annotation/BinderThread;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/annotation/RequiresPermission$Read;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/annotation/AnimatorRes;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/annotation/BoolRes;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/annotation/LayoutRes;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/annotation/CallSuper;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/annotation/IntegerRes;

UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.RuntimeException: Translation has been interrupted
at com.android.dx.command.dexer.Main.processAllFiles(Main.java:608)
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:130)
Caused by: java.lang.InterruptedException: Too many errors
at com.android.dx.command.dexer.Main.processAllFiles(Main.java:600)
... 9 more
]
stdout[
processing archive bin\classes.jar...
processing com/unity3d/player/a$1.class...
processing com/unity3d/player/a$2.class...
processing com/unity3d/player/a$a.class...
processing com/unity3d/player/a.class...
processing com/unity3d/player/b.class...
processing com/unity3d/player/c$1.class...
processing com/unity3d/player/c$2.class...
processing com/unity3d/player/c.class...
processing com/unity3d/player/d.class...
processing com/unity3d/player/e$1.class...
processing com/unity3d/player/e$2.class...
processing com/unity3d/player/e.class...
processing com/unity3d/player/f.class...
processing com/unity3d/player/g.class...
processing com/unity3d/player/h.class...
processing com/unity3d/player/i.class...
processing com/unity3d/player/j.class...
processing com/unity3d/player/k$1.class...
processing com/unity3d/player/k.class...
processing com/unity3d/player/NativeLoader.class...
processing com/unity3d/player/l.class...
processing com/unity3d/player/PsmMainActivity.class...
processing com/unity3d/player/PsmUnityActivity.class...
processing com/unity3d/player/ReflectionHelper$1.class...
processing com/unity3d/player/ReflectionHelper$a.class...
processing com/unity3d/player/ReflectionHelper.class...
processing com/unity3d/player/m.class...
processing com/unity3d/player/n$1.class...
processing com/unity3d/player/n$2.class...
processing com/unity3d/player/n$3.class...
processing com/unity3d/player/n.class...
processing com/unity3d/player/o.class...
processing com/unity3d/player/p.class...
processing com/unity3d/player/UnityPlayer$1.class...
processing com/unity3d/player/UnityPlayer$2.class...
processing com/unity3d/player/UnityPlayer$3.class...
processing com/unity3d/player/UnityPlayer$4.class...
processing com/unity3d/player/UnityPlayer$5.class...
processing com/unity3d/player/UnityPlayer$6.class...
processing com/unity3d/player/UnityPlayer$7.class...
processing com/unity3d/player/UnityPlayer$8.class...
processing com/unity3d/player/UnityPlayer$9.class...
processing com/unity3d/player/UnityPlayer$10.class...
processing com/unity3d/player/UnityPlayer$11.class...
processing com/unity3d/player/UnityPlayer$12$1.class...
processing com/unity3d/player/UnityPlayer$12.class...
processing com/unity3d/player/UnityPlayer$13.class...
processing com/unity3d/player/UnityPlayer$14.class...
processing com/unity3d/player/UnityPlayer$15.class...
processing com/unity3d/player/UnityPlayer$16.class...
processing com/unity3d/player/UnityPlayer$17.class...
processing com/unity3d/player/UnityPlayer$18.class...
processing com/unity3d/player/UnityPlayer$19.class...
processing com/unity3d/player/UnityPlayer$a.class...
processing com/unity3d/player/UnityPlayer$b.class...
processing com/unity3d/player/UnityPlayer$c.class...
processing com/unity3d/player/UnityPlayer.class...
processing com/unity3d/player/UnityPlayerActivity.class...
processing com/unity3d/player/UnityPlayerNativeActivity.class...
processing com/unity3d/player/UnityPlayerProxyActivity.class...
processing com/unity3d/player/q.class...
processing com/unity3d/player/r$1.class...
processing com/unity3d/player/r.class...
processing com/unity3d/player/WWW.class...
processing org/fmod/FMODAudioDevice$a.class...
processing org/fmod/FMODAudioDevice.class...
processing org/fmod/a.class...
processing bin\classes.\com\BUProduct\LocalWarfarePortable\R$attr.class...
processing bin\classes.\com\BUProduct\LocalWarfarePortable\R$color.class...
processing bin\classes.\com\BUProduct\LocalWarfarePortable\R$drawable.class...
processing bin\classes.\com\BUProduct\LocalWarfarePortable\R$id.class...
processing bin\classes.\com\BUProduct\LocalWarfarePortable\R$integer.class...
processing bin\classes.\com\BUProduct\LocalWarfarePortable\R$raw.class...
processing bin\classes.\com\BUProduct\LocalWarfarePortable\R$string.class...
processing bin\classes.\com\BUProduct\LocalWarfarePortable\R$style.class...
processing bin\classes.\com\BUProduct\LocalWarfarePortable\R$styleable.class...
processing bin\classes.\com\BUProduct\LocalWarfarePortable\R.class...
processing bin\classes.\com\google\android\gms\R$attr.class...
processing bin\classes.\com\google\android\gms\R$color.class...
processing bin\classes.\com\google\android\gms\R$drawable.class...
processing bin\classes.\com\google\android\gms\R$id.class...
processing bin\classes.\com\google\android\gms\R$integer.class...
processing bin\classes.\com\google\android\gms\R$raw.class...
processing bin\classes.\com\google\android\gms\R$string.class...
processing bin\classes.\com\google\android\gms\R$style.class...
processing bin\classes.\com\google\android\gms\R$styleable.class...
processing bin\classes.\com\google\android\gms\R.class...
processing bin\classes.\com\google\example\games\mainlibproj\R$attr.class...
processing bin\classes.\com\google\example\games\mainlibproj\R$color.class...
processing bin\classes.\com\google\example\games\mainlibproj\R$drawable.class...
processing bin\classes.\com\google\example\games\mainlibproj\R$id.class...
processing bin\classes.\com\google\example\games\mainlibproj\R$integer.class...
processing bin\classes.\com\google\example\games\mainlibproj\R$raw.class...
processing bin\classes.\com\google\example\games\mainlibproj\R$string.class...
processing bin\classes.\com\google\example\games\mainlibproj\R$style.class...
processing bin\classes.\com\google\example\games\mainlibproj\R$styleable.class...
processing bin\classes.\com\google\example\games\mainlibproj\R.class...
processing archive plugins.\android-support-v4.jar...
ignored resource META-INF/
ignored resource META-INF/MANIFEST.MF
ignored resource android/
ignored resource android/support/
ignored resource android/support/v4/
ignored resource android/support/v4/util/
processing android/support/v4/util/MapCollections$ArrayIterator.class...
processing android/support/v4/util/MapCollections$KeySet.class...
processing android/support/v4/util/MapCollections$ValuesCollection.class...
processing android/support/v4/util/Pair.class...
processing android/support/v4/util/Pools.class...
processing android/support/v4/util/MapCollections$EntrySet.class...
processing android/support/v4/util/DebugUtils.class...
processing android/support/v4/util/SimpleArrayMap.class...
processing android/support/v4/util/ArrayMap.class...
processing android/support/v4/util/MapCollections.class...
processing android/support/v4/util/LongSparseArray.class...
processing android/support/v4/util/Pools$Pool.class...
processing android/support/v4/util/Pools$SimplePool.class...
processing android/support/v4/util/LogWriter.class...
processing android/support/v4/util/MapCollections$MapIterator.class...
processing android/support/v4/util/CircularArray.class...
processing android/support/v4/util/SparseArrayCompat.class...
processing android/support/v4/util/ContainerHelpers.class...
processing android/support/v4/util/Pools$SynchronizedPool.class...
processing android/support/v4/util/ArrayMap$1.class...
processing android/support/v4/util/CircularIntArray.class...
processing android/support/v4/util/LruCache.class...
processing android/support/v4/util/TimeUtils.class...
processing android/support/v4/util/AtomicFile.class...
ignored resource android/support/v4/graphics/
processing android/support/v4/graphics/BitmapCompat$BaseBitmapImpl.class...
processing android/support/v4/graphics/BitmapCompatKitKat.class...
ignored resource android/support/v4/graphics/drawable/
processing android/support/v4/graphics/drawable/DrawableCompatHoneycomb.class...
processing android/support/v4/graphics/drawable/DrawableCompatBase.class...
processing android/support/v4/graphics/drawable/DrawableCompatLollipop.class...
processing android/support/v4/graphics/drawable/DrawableCompat$LollipopDrawableImpl.class...
processing android/support/v4/graphics/drawable/DrawableCompatJellybeanMr1.class...
processing android/support/v4/graphics/drawable/DrawableCompatKitKat.class...
processing android/support/v4/graphics/drawable/DrawableCompat$HoneycombDrawableImpl.class...
processing android/support/v4/graphics/drawable/DrawableWrapper.class...
processing android/support/v4/graphics/drawable/DrawableCompatApi22.class...
processing android/support/v4/graphics/drawable/DrawableWrapperHoneycomb.class...
processing android/support/v4/graphics/drawable/RoundedBitmapDrawable.class...
processing android/support/v4/graphics/drawable/DrawableCompat$BaseDrawableImpl.class...
processing android/support/v4/graphics/drawable/DrawableCompat$KitKatDrawableImpl.class...
processing android/support/v4/graphics/drawable/DrawableCompat$MDrawableImpl.class...
processing android/support/v4/graphics/drawable/DrawableCompat$JellybeanMr1DrawableImpl.class...
processing android/support/v4/graphics/drawable/DrawableCompat$DrawableImpl.class...
processing android/support/v4/graphics/drawable/RoundedBitmapDrawableFactory$DefaultRoundedBitmapDrawable.class...
processing android/support/v4/graphics/drawable/DrawableCompatApi23.class...
processing android/support/v4/graphics/drawable/DrawableCompat$LollipopMr1DrawableImpl.class...
processing android/support/v4/graphics/drawable/DrawableWrapperLollipop.class...
processing android/support/v4/graphics/drawable/DrawableCompat.class...
processing android/support/v4/graphics/drawable/DrawableWrapperDonut.class...
processing android/support/v4/graphics/drawable/DrawableWrapperKitKat.class...
processing android/support/v4/graphics/drawable/RoundedBitmapDrawableFactory.class...
processing android/support/v4/graphics/drawable/RoundedBitmapDrawable21.class...
processing android/support/v4/graphics/BitmapCompat$KitKatBitmapCompatImpl.class...
processing android/support/v4/graphics/BitmapCompat$BitmapImpl.class...
processing android/support/v4/graphics/BitmapCompat$HcMr1BitmapCompatImpl.class...
processing android/support/v4/graphics/BitmapCompat$JbMr2BitmapCompatImpl.class...
processing android/support/v4/graphics/ColorUtils.class...
processing android/support/v4/graphics/BitmapCompat.class...
processing android/support/v4/graphics/BitmapCompatJellybeanMR2.class...
processing android/support/v4/graphics/BitmapCompatHoneycombMr1.class...
ignored resource android/support/v4/accessibilityservice/
processing android/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoStubImpl.class...
processing android/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoIcsImpl.class...
processing android/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoJellyBeanMr2.class...
processing android/support/v4/accessibilityservice/AccessibilityServiceInfoCompatJellyBeanMr2.class...
processing android/support/v4/accessibilityservice/AccessibilityServiceInfoCompat.class...
processing android/support/v4/accessibilityservice/AccessibilityServiceInfoCompatIcs.class...
processing android/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoVersionImpl.class...
ignored resource android/support/v4/hardware/
ignored resource android/support/v4/hardware/display/
processing android/support/v4/hardware/display/DisplayManagerCompat$LegacyImpl.class...
processing android/support/v4/hardware/display/DisplayManagerCompat$JellybeanMr1Impl.class...
processing android/support/v4/hardware/display/DisplayManagerJellybeanMr1.class...
processing android/support/v4/hardware/display/DisplayManagerCompat.class...
ignored resource android/support/v4/hardware/fingerprint/
processing android/support/v4/hardware/fingerprint/FingerprintManagerCompat$Api23FingerprintManagerCompatImpl$1.class...
processing android/support/v4/hardware/fingerprint/FingerprintManagerCompatApi23$CryptoObject.class...
processing android/support/v4/hardware/fingerprint/FingerprintManagerCompatApi23$AuthenticationResultInternal.class...
processing android/support/v4/hardware/fingerprint/FingerprintManagerCompatApi23.class...
processing android/support/v4/hardware/fingerprint/FingerprintManagerCompatApi23$1.class...
processing android/support/v4/hardware/fingerprint/FingerprintManagerCompat$CryptoObject.class...
processing android/support/v4/hardware/fingerprint/FingerprintManagerCompat$AuthenticationCallback.class...
processing android/support/v4/hardware/fingerprint/FingerprintManagerCompat$LegacyFingerprintManagerCompatImpl.class...
processing android/support/v4/hardware/fingerprint/FingerprintManagerCompat$AuthenticationResult.class...
processing android/support/v4/hardware/fingerprint/FingerprintManagerCompat$Api23FingerprintManagerCompatImpl.class...
processing android/support/v4/hardware/fingerprint/FingerprintManagerCompatApi23$AuthenticationCallback.class...
processing android/support/v4/hardware/fingerprint/FingerprintManagerCompat.class...
processing android/support/v4/hardware/fingerprint/FingerprintManagerCompat$FingerprintManagerCompatImpl.class...
ignored resource android/support/v4/database/
processing android/support/v4/database/DatabaseUtilsCompat.class...
ignored resource android/support/v4/internal/
ignored resource android/support/v4/internal/view/
processing android/support/v4/internal/view/SupportMenu.class...
processing android/support/v4/internal/view/SupportSubMenu.class...
processing android/support/v4/internal/view/SupportMenuItem.class...
ignored resource android/support/v4/media/
processing android/support/v4/media/TransportMediatorJellybeanMR2$6.class...
processing android/support/v4/media/MediaBrowserServiceCompat$4.class...
processing android/support/v4/media/MediaMetadataCompat$1.class...
processing android/support/v4/media/IMediaBrowserServiceCompatCallbacks.class...
processing android/support/v4/media/MediaBrowserCompat$MediaBrowserImplBase$ServiceCallbacks.class...
processing android/support/v4/media/MediaBrowserCompat$MediaBrowserImplBase$6.class...
processing android/support/v4/media/MediaBrowserCompat$MediaBrowserImplBase$1.class...
processing android/support/v4/media/RatingCompatApi21.class...
processing android/support/v4/media/MediaDescriptionCompatApi21.class...
processing android/support/v4/me

@61015ian 61015ian changed the title from Android build failed after upgrading to 0.9.27 using Unity4.6.9, with "Unable to convert classes into dex format." error to Android build failed after upgrading to 0.9.27 using Unity4.6.9,showing"Unable to convert classes into dex format." error Nov 13, 2015

@claywilkinson

This comment has been minimized.

Show comment
Hide comment
@claywilkinson

claywilkinson Nov 13, 2015

Contributor

This happens when there are duplicate jar/aar files being included in the Plugins directory. The easiest thing to do is remove all the jars from the project and re-import the plugin.

Contributor

claywilkinson commented Nov 13, 2015

This happens when there are duplicate jar/aar files being included in the Plugins directory. The easiest thing to do is remove all the jars from the project and re-import the plugin.

@quangfuky

This comment has been minimized.

Show comment
Hide comment
@quangfuky

quangfuky Nov 15, 2015

I have only 0.9.27 plugins but still "unable to convert classes into dex format". I have all SDK and Java but it won't work

quangfuky commented Nov 15, 2015

I have only 0.9.27 plugins but still "unable to convert classes into dex format". I have all SDK and Java but it won't work

@claywilkinson

This comment has been minimized.

Show comment
Hide comment
@claywilkinson

claywilkinson Nov 19, 2015

Contributor

There is a duplicate jar in your Plugins/Android directory (or subdirectory) somewhere. A guess based on the name of the class in the error message Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/annotation/WorkerThread; would be a jar or aar with "annotation" in the name.

Contributor

claywilkinson commented Nov 19, 2015

There is a duplicate jar in your Plugins/Android directory (or subdirectory) somewhere. A guess based on the name of the class in the error message Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/annotation/WorkerThread; would be a jar or aar with "annotation" in the name.

@claywilkinson

This comment has been minimized.

Show comment
Hide comment
@claywilkinson

claywilkinson Dec 2, 2015

Contributor

@61015ian - Did you get this resolved? Is it OK to close this issue?

Contributor

claywilkinson commented Dec 2, 2015

@61015ian - Did you get this resolved? Is it OK to close this issue?

@loftyy

This comment has been minimized.

Show comment
Hide comment
@loftyy

loftyy Dec 20, 2015

good evening gents,

I'm having the exact same error, please help me

It's been 2 days and i still can't fix it and it has halted my progress. The facebook SDK worked completely fine but when I imported playgames plug-in the game is not building anymore but I can play it on Unity Remote 4.

Here are the screenshots (to make things easier to see) and errors:
note: I have added texts to the screenshot which I think will help so please read them :-)

Screenshot : http://content.screencast.com/users/Loftyy/folders/Jing/media/f1a249d8-9b14-4e71-a701-35edc740a93a/2015-12-21_0022.png

First error: http://pastebin.com/h8pjLkE9
Second error: http://pastebin.com/4rudv7cE

Screenshot : http://content.screencast.com/users/Loftyy/folders/Jing/media/850b2a0d-a2d4-4cba-82d5-9c6a7a9841eb/2015-12-21_0024.png

Screenshot : http://content.screencast.com/users/Loftyy/folders/Jing/media/2ccd7d4d-01c2-43ed-9773-44dda667d4c6/2015-12-21_0025.png

Screenshot : http://content.screencast.com/users/Loftyy/folders/Jing/media/6727ff2f-d5d7-4c03-886b-798d9a8d3607/2015-12-21_0027.png

Screenshot : http://content.screencast.com/users/Loftyy/folders/Jing/media/f92cda78-d1f9-43f7-b748-f38fb9d99716/2015-12-21_0026.png

Screenshot : http://content.screencast.com/users/Loftyy/folders/Jing/media/9b5a8034-769c-4fda-ab22-2176c620d020/2015-12-21_0032.png

Screenshot : http://content.screencast.com/users/Loftyy/folders/Jing/media/3e0d0803-857e-4095-b599-c953fa4e12a0/2015-12-21_0033.png

Video (notice how the files deleted get recreated once the build begins): http://screencast.com/t/e15V2Xy6

loftyy commented Dec 20, 2015

good evening gents,

I'm having the exact same error, please help me

It's been 2 days and i still can't fix it and it has halted my progress. The facebook SDK worked completely fine but when I imported playgames plug-in the game is not building anymore but I can play it on Unity Remote 4.

Here are the screenshots (to make things easier to see) and errors:
note: I have added texts to the screenshot which I think will help so please read them :-)

Screenshot : http://content.screencast.com/users/Loftyy/folders/Jing/media/f1a249d8-9b14-4e71-a701-35edc740a93a/2015-12-21_0022.png

First error: http://pastebin.com/h8pjLkE9
Second error: http://pastebin.com/4rudv7cE

Screenshot : http://content.screencast.com/users/Loftyy/folders/Jing/media/850b2a0d-a2d4-4cba-82d5-9c6a7a9841eb/2015-12-21_0024.png

Screenshot : http://content.screencast.com/users/Loftyy/folders/Jing/media/2ccd7d4d-01c2-43ed-9773-44dda667d4c6/2015-12-21_0025.png

Screenshot : http://content.screencast.com/users/Loftyy/folders/Jing/media/6727ff2f-d5d7-4c03-886b-798d9a8d3607/2015-12-21_0027.png

Screenshot : http://content.screencast.com/users/Loftyy/folders/Jing/media/f92cda78-d1f9-43f7-b748-f38fb9d99716/2015-12-21_0026.png

Screenshot : http://content.screencast.com/users/Loftyy/folders/Jing/media/9b5a8034-769c-4fda-ab22-2176c620d020/2015-12-21_0032.png

Screenshot : http://content.screencast.com/users/Loftyy/folders/Jing/media/3e0d0803-857e-4095-b599-c953fa4e12a0/2015-12-21_0033.png

Video (notice how the files deleted get recreated once the build begins): http://screencast.com/t/e15V2Xy6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment