Log in or register to post comments

Unable to convert classes into dex format.

March 7, 2014 - 6:09am #1

I'm working on a project using Unity 4.3 Pro and Vuforia 2.8. The project builds and works alright on iOS, but when I try to export an Android APK the built fails with the following error:

Error building Player: CommandInvokationFailure: Unable to convert classes into dex format. See the Console for details.
java -Xmx1024M -Dcom.android.sdkmanager.toolsdir="/Applications/android-sdk-macosx/tools" -Dfile.encoding=UTF8 -jar "/Applications/Unity/Unity.app/Contents/BuildTargetTools/AndroidPlayer/sdktools.jar" -
 
stderr[
 
UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.IllegalArgumentException: already added: Lcom/qualcomm/QCAR/BuildConfig;
at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:122)
at com.android.dx.dex.file.DexFile.add(DexFile.java:161)
at com.android.dx.command.dexer.Main.processClass(Main.java:685)
at com.android.dx.command.dexer.Main.processFileBytes(Main.java:634)
at com.android.dx.command.dexer.Main.access$600(Main.java:78)
at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:572)
at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:284)
at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:166)
at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:229)
at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:158)
at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)
at com.android.dx.command.dexer.Main.processOne(Main.java:596)
at com.android.dx.command.dexer.Main.processAllFiles(Main.java:498)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:264)
at com.android.dx.command.dexer.Main.run(Main.java:230)
at com.android.dx.command.dexer.Main.main(Main.java:199)
at com.android.dx.command.Main.main(Main.java:103)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at SDKMain.main(SDKMain.java:129)
1 error; aborting
]
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$1.class...
processing com/unity3d/player/b$2.class...
processing com/unity3d/player/b.class...
processing com/unity3d/player/c.class...
processing com/unity3d/player/d$1.class...
processing com/unity3d/player/d$2.class...
processing com/unity3d/player/d.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$1.class...
processing com/unity3d/player/j.class...
processing com/unity3d/player/NativeLoader.class...
processing com/unity3d/player/k.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/l.class...
processing com/unity3d/player/m$1.class...
processing com/unity3d/player/m$2.class...
processing com/unity3d/player/m$3.class...
processing com/unity3d/player/m.class...
processing com/unity3d/player/n.class...
processing com/unity3d/player/o.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.class...
processing com/unity3d/player/UnityPlayerActivity.class...
processing com/unity3d/player/UnityPlayerNativeActivity.class...
processing com/unity3d/player/UnityPlayerProxyActivity.class...
processing com/unity3d/player/p.class...
processing com/unity3d/player/q$1.class...
processing com/unity3d/player/q.class...
processing com/unity3d/player/WWW.class...
processing org/fmod/FMODAudioDevice$a.class...
processing org/fmod/FMODAudioDevice.class...
processing org/fmod/a.class...
processing archive plugins/./QCAR.jar...
processing com/qualcomm/QCAR/BuildConfig.class...
processing com/qualcomm/QCAR/QCAR.class...
processing com/qualcomm/ar/pl/BuildConfig.class...
processing com/qualcomm/ar/pl/CameraPreview.class...
processing com/qualcomm/ar/pl/DebugLog.class...
processing com/qualcomm/ar/pl/ARHttpParams.class...
processing com/qualcomm/ar/pl/SurfaceManager$1.class...
processing com/qualcomm/ar/pl/RenderManager$1.class...
processing com/qualcomm/ar/pl/SystemTools.class...
processing com/qualcomm/ar/pl/ARHttpResponse.class...
processing com/qualcomm/ar/pl/ARHttpRequest.class...
processing com/qualcomm/ar/pl/CameraPreview$1.class...
processing com/qualcomm/ar/pl/RenderManager$FixedFrameRateRunner.class...
processing com/qualcomm/ar/pl/ARHttpClient$HttpResponseCallable.class...
processing com/qualcomm/ar/pl/FileTools$AssetFileInfo.class...
processing com/qualcomm/ar/pl/ImageTools.class...
processing com/qualcomm/ar/pl/RenderManager$RenderRequestWatcher.class...
processing com/qualcomm/ar/pl/ARHttpClient$HttpResponseWatcher.class...
processing com/qualcomm/ar/pl/FileTools.class...
processing com/qualcomm/ar/pl/SurfaceManager.class...
processing com/qualcomm/ar/pl/SensorController.class...
processing com/qualcomm/ar/pl/ARHttpClient.class...
processing com/qualcomm/ar/pl/CameraPreview$CameraCacheInfo.class...
processing com/qualcomm/ar/pl/RenderManager.class...
processing com/qualcomm/ar/pl/SensorController$SensorCacheInfo.class...
processing com/qualcomm/ar/pl/CameraSurface.class...
processing archive plugins/./QCARUnityPlayer.jar...
ignored resource META-INF/MANIFEST.MF
processing com/qualcomm/QCARUnityPlayer/BuildConfig.class...
processing com/qualcomm/QCARUnityPlayer/DebugLog.class...
processing com/qualcomm/QCARUnityPlayer/OrientationUtility.class...
processing com/qualcomm/QCARUnityPlayer/QCARPlayerNativeActivity$1.class...
processing com/qualcomm/QCARUnityPlayer/QCARPlayerNativeActivity$UnityInitializer.class...
processing com/qualcomm/QCARUnityPlayer/QCARPlayerNativeActivity.class...
processing com/qualcomm/QCARUnityPlayer/QCARPlayerSharedActivity$1.class...
processing com/qualcomm/QCARUnityPlayer/QCARPlayerSharedActivity$IUnityInitializer.class...
processing com/qualcomm/QCARUnityPlayer/QCARPlayerSharedActivity$InitQCARTask.class...
processing com/qualcomm/QCARUnityPlayer/QCARPlayerSharedActivity$InitUnityTask.class...
processing com/qualcomm/QCARUnityPlayer/QCARPlayerSharedActivity.class...
processing archive plugins/./Vuforia.jar...
processing com/qualcomm/vuforia/CylinderTarget.class...
processing com/qualcomm/vuforia/BuildConfig.class...
processing com/qualcomm/vuforia/ImageTargetBuilder.class...
processing com/qualcomm/vuforia/Vuforia$1.class...
processing com/qualcomm/vuforia/Vuforia$UpdateCallbackInterface.class...
processing com/qualcomm/vuforia/Type.class...
processing com/qualcomm/vuforia/Vec3I.class...
processing com/qualcomm/vuforia/CameraDevice$CAMERA.class...
processing com/qualcomm/vuforia/Obb2D.class...
processing com/qualcomm/vuforia/VideoBackgroundConfig.class...
processing com/qualcomm/vuforia/TrackableSource.class...
processing com/qualcomm/vuforia/RectangleInt.class...
processing com/qualcomm/vuforia/VirtualButton.class...
processing com/qualcomm/vuforia/Vuforia.class...
processing com/qualcomm/vuforia/WordList.class...
processing com/qualcomm/vuforia/VirtualButton$SENSITIVITY.class...
processing com/qualcomm/vuforia/PIXEL_FORMAT.class...
processing com/qualcomm/vuforia/MultiTargetResult.class...
processing com/qualcomm/vuforia/Matrix44F.class...
processing com/qualcomm/vuforia/TextTracker$UP_DIRECTION.class...
processing com/qualcomm/vuforia/DataSet$STORAGE_TYPE.class...
processing com/qualcomm/vuforia/INIT_FLAGS.class...
processing com/qualcomm/vuforia/VuforiaConstants.class...
processing com/qualcomm/vuforia/VideoMode.class...
processing com/qualcomm/vuforia/DataSet.class...
processing com/qualcomm/vuforia/VIDEO_BACKGROUND_REFLECTION.class...
processing com/qualcomm/vuforia/TrackableResult$STATUS.class...
processing com/qualcomm/vuforia/WordResult.class...
processing com/qualcomm/vuforia/Word.class...
processing com/qualcomm/vuforia/Tool.class...
processing com/qualcomm/vuforia/CylinderTargetResult.class...
processing com/qualcomm/vuforia/MarkerTracker.class...
processing com/qualcomm/vuforia/VirtualButtonResult.class...
processing com/qualcomm/vuforia/Area.class...
processing com/qualcomm/vuforia/TextTracker.class...
processing com/qualcomm/vuforia/CameraDevice.class...
processing com/qualcomm/vuforia/VideoBackgroundTextureInfo.class...
processing com/qualcomm/vuforia/VuforiaJNI.class...
processing com/qualcomm/vuforia/MarkerResult.class...
processing com/qualcomm/vuforia/TargetSearchResult.class...
processing com/qualcomm/vuforia/ImageTracker.class...
processing com/qualcomm/vuforia/Tracker.class...
processing com/qualcomm/vuforia/Frame.class...
processing com/qualcomm/vuforia/ImageTargetResult.class...
processing com/qualcomm/vuforia/Vec2F.class...
processing com/qualcomm/vuforia/Marker$MARKER_TYPE.class...
processing com/qualcomm/vuforia/TrackerManager.class...
processing com/qualcomm/vuforia/CameraCalibration.class...
processing com/qualcomm/vuforia/Vec4F.class...
processing com/qualcomm/vuforia/Vec4I.class...
processing com/qualcomm/vuforia/WordList$STORAGE_TYPE.class...
processing com/qualcomm/vuforia/TargetFinder.class...
processing com/qualcomm/vuforia/Area$TYPE.class...
processing com/qualcomm/vuforia/CameraDevice$MODE.class...
processing com/qualcomm/vuforia/WordList$FILTER_MODE.class...
processing com/qualcomm/vuforia/State.class...
processing com/qualcomm/vuforia/CameraDevice$FOCUS_MODE.class...
processing com/qualcomm/vuforia/Renderer.class...
processing com/qualcomm/vuforia/UpdateCallback.class...
processing com/qualcomm/vuforia/ImageTargetBuilder$FRAME_QUALITY.class...
processing com/qualcomm/vuforia/HINT.class...
processing com/qualcomm/vuforia/Matrix34F.class...
processing com/qualcomm/vuforia/Rectangle.class...
processing com/qualcomm/vuforia/Vec3F.class...
processing com/qualcomm/vuforia/NonCopyable.class...
processing com/qualcomm/vuforia/ImageTarget.class...
processing com/qualcomm/vuforia/Marker.class...
processing com/qualcomm/vuforia/Vec2I.class...
processing com/qualcomm/vuforia/MultiTarget.class...
processing com/qualcomm/vuforia/Trackable.class...
processing com/qualcomm/vuforia/TrackableResult.class...
processing com/qualcomm/vuforia/Image.class...
processing com/qualcomm/QCAR/BuildConfig.class...
]

Do you have any idea how to fix this?

Unable to convert classes into dex format.

October 18, 2018 - 11:15am #5

Hi,

I had the same error and got rid off it by removing the following files from the Assets\Plugins\Android folder:

Vuforia.jar

VuforiaPlayer.jar

libs folder

Hope that helps.

Unable to convert classes into dex format.

January 21, 2017 - 5:43am #4

Did you figure it out? I am facing the exact same issue right now. 

already added lcom/qualcomm/qcarunityplayer/debug log

February 19, 2016 - 11:40pm #3

I got same issue while making build for android. Then I realised that there were two copies of "QCARUnityPlayer" file in "\Assets\Plugins\Android". there namming was "QCARUnityPlayer" and "QCARUnityPlayer 1". So I deleted the "QCARUnityPlayer" file from project and renamed  "QCARUnityPlayer 1" to  "QCARUnityPlayer" (Besause the suffix "1" at the end of second file would be for Updated file). 

That did trick for me. :) ;)

Unable to convert classes into dex format.

March 7, 2014 - 6:20am #2

Sounds like an issue with your Unity and/or Android installation; 

there is a thread in the Unity website about the same issue:

http://forum.unity3d.com/threads/197061-Unable-to-convert-classes-to-dex-format-Android-issue

 

Log in or register to post comments