Search Unity

  1. Unity 2019.1 is now released.
    Dismiss Notice

Unable to convert classes into dex format

Discussion in 'Android' started by Goohan, May 20, 2018.

  1. Goohan

    Goohan

    Joined:
    Jan 18, 2018
    Posts:
    1
    Hello.
    I'm having a problem when i try to building the game.
    I was looking for information - most likely it is a conflict between two plugins Google ADMobd and Chartboost. The solution, as I understand it, is to delete duplicate files in chartboost or admob libs. What do I need to delete?
    Thanks for care. :(

    Error log:
    CommandInvokationFailure: Unable to convert classes into dex format.
    C:/Program Files/Java/jdk1.8.0_171\bin\java.exe -Xmx2048M -Dcom.android.sdkmanager.toolsdir="C:/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: 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/ActivityManagerCompat;
    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/AppOpsManagerCompat;
    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.Main.processAllFiles(Main.java:614)
    at com.android.dx.command.dexer.Main.runMonoDex(Main.java:310)
    at com.android.dx.command.dexer.Main.runDx(Main.java:288)
    at com.android.dx.command.dexer.Main.main(Main.java:244)
    at com.android.dx.command.Main.main(Main.java:95)
    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:498)
    at SDKMain.main(SDKMain.java:130)
    Caused by: java.lang.InterruptedException: Too many errors
    at com.android.dx.command.dexer.Main.processAllFiles(Main.java:606)
    ... 9 more
    ]
    stdout[
    processing archive C:\Users\Public\Documents\Unity Projects\cat2018\Temp\StagingArea\android-libraries\ChartboostSDK\libs\.\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/annotation/
    processing android/support/annotation/AnimRes.class...
    processing android/support/annotation/AnimatorRes.class...
    processing android/support/annotation/AnyRes.class...
    processing android/support/annotation/ArrayRes.class...
    processing android/support/annotation/AttrRes.class...
    processing android/support/annotation/BinderThread.class...
    processing android/support/annotation/BoolRes.class...
    processing android/support/annotation/CallSuper.class...
    processing android/support/annotation/CheckResult.class...
    processing android/support/annotation/ColorInt.class...
    processing android/support/annotation/ColorRes.class...
    processing android/support/annotation/DimenRes.class...
    processing android/support/annotation/DrawableRes.class...
    processing android/support/annotation/FloatRange.class...
    processing android/support/annotation/FractionRes.class...
    processing android/support/annotation/IdRes.class...
    processing android/support/annotation/IntDef.class...
    processing android/support/annotation/IntRange.class...
    processing android/support/annotation/IntegerRes.class...
    processing android/support/annotation/InterpolatorRes.class...
    processing android/support/annotation/Keep.class...
    processing android/support/annotation/LayoutRes.class...
    processing android/support/annotation/MainThread.class...
    processing android/support/annotation/MenuRes.class...
    processing android/support/annotation/NonNull.class...
    processing android/support/annotation/Nullable.class...
    processing android/support/annotation/PluralsRes.class...
    processing android/support/annotation/RawRes.class...
    processing android/support/annotation/RequiresPermission.class...
    processing android/support/annotation/RequiresPermission$Read.class...
    processing android/support/annotation/RequiresPermission$Write.class...
    processing android/support/annotation/Size.class...
    processing android/support/annotation/StringDef.class...
    processing android/support/annotation/StringRes.class...
    processing android/support/annotation/StyleRes.class...
    processing android/support/annotation/StyleableRes.class...
    processing android/support/annotation/TransitionRes.class...
    processing android/support/annotation/UiThread.class...
    processing android/support/annotation/VisibleForTesting.class...
    processing android/support/annotation/WorkerThread.class...
    processing android/support/annotation/XmlRes.class...
    ignored resource android/support/v4/
    ignored resource android/support/v4/accessibilityservice/
    processing android/support/v4/accessibilityservice/AccessibilityServiceInfoCompat.class...
    processing android/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoIcsImpl.class...
    processing android/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoJellyBeanMr2.class...
    processing android/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoStubImpl.class...
    processing android/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoVersionImpl.class...
    processing android/support/v4/accessibilityservice/AccessibilityServiceInfoCompatIcs.class...
    processing android/support/v4/accessibilityservice/AccessibilityServiceInfoCompatJellyBeanMr2.class...
    ignored resource android/support/v4/animation/
    processing android/support/v4/animation/AnimatorCompatHelper.class...
    processing android/support/v4/animation/AnimatorListenerCompat.class...
    processing android/support/v4/animation/AnimatorProvider.class...
    processing android/support/v4/animation/AnimatorUpdateListenerCompat.class...
    processing android/support/v4/animation/DonutAnimatorCompatProvider.class...
    processing android/support/v4/animation/DonutAnimatorCompatProvider$DonutFloatValueAnimator.class...
    processing android/support/v4/animation/DonutAnimatorCompatProvider$DonutFloatValueAnimator$1.class...
    processing android/support/v4/animation/HoneycombMr1AnimatorCompatProvider.class...
    processing android/support/v4/animation/HoneycombMr1AnimatorCompatProvider$AnimatorListenerCompatWrapper.class...
    processing android/support/v4/animation/HoneycombMr1AnimatorCompatProvider$HoneycombValueAnimatorCompat.class...
    processing android/support/v4/animation/HoneycombMr1AnimatorCompatProvider$HoneycombValueAnimatorCompat$1.class...
    processing android/support/v4/animation/ValueAnimatorCompat.class...
    ignored resource android/support/v4/app/
    processing android/support/v4/app/ActionBarDrawerToggle.class...
    processing android/support/v4/app/ActionBarDrawerToggle$1.class...
    processing android/support/v4/app/ActionBarDrawerToggle$ActionBarDrawerToggleImpl.class...
    processing android/support/v4/app/ActionBarDrawerToggle$ActionBarDrawerToggleImplBase.class...
    processing android/support/v4/app/ActionBarDrawerToggle$ActionBarDrawerToggleImplHC.class...
    processing android/support/v4/app/ActionBarDrawerToggle$ActionBarDrawerToggleImplJellybeanMR2.class...
    processing android/support/v4/app/ActionBarDrawerToggle$Delegate.class...
    processing android/support/v4/app/ActionBarDrawerToggle$DelegateProvider.class...
    processing android/support/v4/app/ActionBarDrawerToggle$SlideDrawable.class...
    processing android/support/v4/app/ActionBarDrawerToggleHoneycomb.class...
    processing android/support/v4/app/ActionBarDrawerToggleHoneycomb$SetIndicatorInfo.class...
    processing android/support/v4/app/ActionBarDrawerToggleJellybeanMR2.class...
    processing android/support/v4/app/ActivityCompat.class...
    processing android/support/v4/app/ActivityCompat$1.class...
    processing android/support/v4/app/ActivityCompat$OnRequestPermissionsResultCallback.class...
    processing android/support/v4/app/ActivityCompat$SharedElementCallback21Impl.class...
    processing android/support/v4/app/ActivityCompat21.class...
    processing android/support/v4/app/ActivityCompat21$SharedElementCallback21.class...
    processing android/support/v4/app/ActivityCompat21$SharedElementCallbackImpl.class...
    processing android/support/v4/app/ActivityCompat22.class...
    processing android/support/v4/app/ActivityCompatApi23.class...
    processing android/support/v4/app/ActivityCompatApi23$RequestPermissionsRequestCodeValidator.class...
    processing android/support/v4/app/ActivityCompatHoneycomb.class...
    processing android/support/v4/app/ActivityCompatJB.class...
    processing android/support/v4/app/ActivityManagerCompat.class...
    processing android/support/v4/app/ActivityManagerCompatKitKat.class...
    processing android/support/v4/app/ActivityOptionsCompat.class...
    processing android/support/v4/app/ActivityOptionsCompat$ActivityOptionsImpl21.class...
    processing android/support/v4/app/ActivityOptionsCompat$ActivityOptionsImplJB.class...
    processing android/support/v4/app/ActivityOptionsCompat21.class...
    processing android/support/v4/app/ActivityOptionsCompatJB.class...
    processing android/support/v4/app/AppOpsManagerCompat.class...
    processing android/support/v4/app/AppOpsManagerCompat$1.class...
    processing android/support/v4/app/AppOpsManagerCompat$AppOpsManager23.class...
    processing android/support/v4/app/AppOpsManagerCompat$AppOpsManagerImpl.class...
    processing android/support/v4/app/AppOpsManagerCompat23.class...
    processing android/support/v4/app/BackStackRecord.class...
    processing android/support/v4/app/BackStackRecord$1.class...
    processing android/support/v4/app/BackStackRecord$2.class...
    processing android/support/v4/app/BackStackRecord$3.class...
    processing android/support/v4/app/BackStackRecord$Op.class...
    processing android/support/v4/app/BackStackRecord$TransitionState.class...
    processing android/support/v4/app/BackStackState.class...
    processing android/support/v4/app/BackStackState$1.class...
    processing android/support/v4/app/BaseFragmentActivityDonut.class...
    processing android/support/v4/app/BaseFragmentActivityHoneycomb.class...
    processing android/support/v4/app/BundleUtil.class...
    processing android/support/v4/app/DialogFragment.class...
    processing android/support/v4/app/DialogFragment$DialogStyle.class...
    processing android/support/v4/app/Fragment.class...
    processing android/support/v4/app/Fragment$1.class...
    processing android/support/v4/app/Fragment$InstantiationException.class...
    processing android/support/v4/app/Fragment$SavedState.class...
    processing android/support/v4/app/Fragment$SavedState$1.class...
    processing android/support/v4/app/FragmentActivity.class...
    processing android/support/v4/app/FragmentActivity$1.class...
    processing android/support/v4/app/FragmentActivity$HostCallbacks.class...
    processing android/support/v4/app/FragmentActivity$NonConfigurationInstances.class...
    processing android/support/v4/app/FragmentContainer.class...
    processing android/support/v4/app/FragmentController.class...
    processing android/support/v4/app/FragmentHostCallback.class...
    processing android/support/v4/app/FragmentManager.class...
    processing android/support/v4/app/FragmentManager$BackStackEntry.class...
    processing android/support/v4/app/FragmentManager$OnBackStackChangedListener.class...
    processing android/support/v4/app/FragmentManagerImpl.class...
    processing android/support/v4/app/FragmentManagerImpl$1.class...
    processing android/support/v4/app/FragmentManagerImpl$2.class...
    processing android/support/v4/app/FragmentManagerImpl$3.class...
    processing android/support/v4/app/FragmentManagerImpl$4.class...
    processing android/support/v4/app/FragmentManagerImpl$5.class...
    processing android/support/v4/app/FragmentManagerImpl$AnimateOnHWLayerIfNeededListener.class...
    processing android/support/v4/app/FragmentManagerImpl$FragmentTag.class...
    processing android/support/v4/app/FragmentManagerState.class...
    processing android/support/v4/app/FragmentManagerState$1.class...
    processing android/support/v4/app/FragmentPagerAdapter.class...
    processing android/support/v4/app/FragmentState.class...
    processing android/support/v4/app/FragmentState$1.class...
    processing android/support/v4/app/FragmentStatePagerAdapter.class...
    processing android/support/v4/app/FragmentTabHost.class...
    processing android/support/v4/app/FragmentTabHost$1.class...
    processing android/support/v4/app/FragmentTabHost$DummyTabFactory.class...
    processing android/support/v4/app/FragmentTabHost$SavedState.class...
    processing android/support/v4/app/FragmentTabHost$SavedState$1.class...
    processing android/support/v4/app/FragmentTabHost$TabInfo.class...
    processing android/support/v4/app/FragmentTransaction.class...
    processing android/support/v4/app/FragmentTransaction$Transit.class...
    processing android/support/v4/app/FragmentTransitionCompat21.class...
    processing android/support/v4/app/FragmentTransitionCompat21$1.class...
    processing android/support/v4/app/FragmentTransitionCompat21$2.class...
    processing android/support/v4/app/FragmentTransitionCompat21$3.class...
    processing android/support/v4/app/FragmentTransitionCompat21$4.class...
    processing android/support/v4/app/FragmentTransitionCompat21$EpicenterView.class...
    processing android/support/v4/app/FragmentTransitionCompat21$ViewRetriever.class...
    processing android/support/v4/app/INotificationSideChannel.class...
    processing android/support/v4/app/INotificationSideChannel$Stub.class...
    processing android/support/v4/app/INotificationSideChannel$Stub$Proxy.class...
    processing android/support/v4/app/ListFragment.class...
    processing android/support/v4/app/ListFragment$1.class...
    processing android/support/v4/app/ListFragment$2.class...
    processing android/support/v4/app/LoaderManager.class...
    processing android/support/v4/app/LoaderManager$LoaderCallbacks.class...
    processing android/support/v4/app/LoaderManagerImpl.class...
    processing android/support/v4/app/LoaderManagerImpl$LoaderInfo.class...
    processing android/support/v4/app/NavUtils.class...
    processing android/support/v4/app/NavUtils$NavUtilsImpl.class...
    processing android/support/v4/app/NavUtils$NavUtilsImplBase.class...
    processing android/support/v4/app/NavUtils$NavUtilsImplJB.class...
    processing android/support/v4/app/NavUtilsJB.class...
    processing android/support/v4/app/NoSaveStateFrameLayout.class...
    processing android/support/v4/app/NotificationBuilderWithActions.class...
    processing android/support/v4/app/NotificationBuilderWithBuilderAccessor.class...
    processing android/support/v4/app/NotificationCompat.class...
    processing android/support/v4/app/NotificationCompat$1.class...
    processing android/support/v4/app/NotificationCompat$Action.class...
    processing android/support/v4/app/NotificationCompat$Action$1.class...
    processing android/support/v4/app/NotificationCompat$Action$Builder.class...
    processing android/support/v4/app/NotificationCompat$Action$Extender.class...
    processing android/support/v4/app/NotificationCompat$Action$WearableExtender.class...
    processing android/support/v4/app/NotificationCompat$BigPictureStyle.class...
    processing android/support/v4/app/NotificationCompat$BigTextStyle.class...
    processing android/support/v4/app/NotificationCompat$Builder.class...
    processing android/support/v4/app/NotificationCompat$BuilderExtender.class...
    processing android/support/v4/app/NotificationCompat$CarExtender.class...
    processing android/support/v4/app/NotificationCompat$CarExtender$UnreadConversation.class...
    processing android/support/v4/app/NotificationCompat$CarExtender$UnreadConversation$1.class...
    processing android/support/v4/app/NotificationCompat$CarExtender$UnreadConversation$Builder.class...
    processing android/support/v4/app/NotificationCompat$Extender.class...
    processing android/support/v4/app/NotificationCompat$InboxStyle.class...
    processing android/support/v4/app/NotificationCompat$NotificationCompatImpl.class...
    processing android/support/v4/app/NotificationCompat$NotificationCompatImplApi2<message truncated>
     
  2. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,166
    Your project includes the "Android support" libraries more than once. One copy is named android-support-v4.jar (seen in the log) but i can't see the rest of them, since the log is truncated.

    The solution is to remove duplicate copies and keep only 1.
     
  3. vulh2289

    vulh2289

    Joined:
    Nov 29, 2016
    Posts:
    2
    Mine was because I import both Unity Ads, and Admob so there is conflicts of the jar services.
    What I did was REMOVE all of the jar files in `Plugins/Android`
    Then go to `Assets/Play Service/Android/Force Resolve`
    Hope it helps
     
  4. FallingRocketGames

    FallingRocketGames

    Joined:
    Nov 25, 2016
    Posts:
    4
    I seem to have the same problem but f I delete the files unity keeps reimporting them, I only have the GoogleMobileAds package in my project and I didn't select the plugins part any idea on what's happening?
     
  5. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,166
    The play services resolver probably automatically reimports them automatically
     
  6. mahdiii

    mahdiii

    Joined:
    Oct 30, 2014
    Posts:
    786
    force resolve causes freezing!!
    sometimes I can see failed resolution in the console but when I press resolve android it says "resolution succeeded."
    What the hell!
     
  7. robotekrem55

    robotekrem55

    Joined:
    Oct 12, 2018
    Posts:
    3
    I was using Unity Ads only, I removed it from package manager and imported it again. Then I got a successful build and it shows ads.
     
  8. mahdiii

    mahdiii

    Joined:
    Oct 30, 2014
    Posts:
    786
    I used an old version. It is OK in the old version.(Google Admob)
    The problem is about new Resolver.
     
  9. madzz

    madzz

    Joined:
    Sep 14, 2018
    Posts:
    1
    You must Update Your Sdk Version ..... It Worked For me .....
     
  10. Engeor

    Engeor

    Joined:
    Mar 25, 2014
    Posts:
    13
    If all other solutions fails try to build as Gradle (Player Settings). By this you turn on multidex. The explanation is that with Google Services you easily exceeds number of signatures as you are adding more and more adapters for ad providers.