Search code examples
androideclipseactionbarsherlockandroid-holo-everywhere

Unable to execute dex error in console window


I would like to build an app which uses HoloEverywhere. I import HoloEverywhere and ActionBarSherlock as described in this manual.

Then I create a new project, according to the following steps:

  1. Create a new Android project
  2. Right Click on project -> Properties -> Android -> Add, add both ActionBarSherlock and HoloEverywhere
  3. Change the Android Manifest to following

    <application android:theme="@style/Holo.Theme"

  4. And change the MainActivity imports to org.holoeverywhere.app.*

import org.holoeverywhere.app.Activity; import android.os.Bundle;

public class MainActivity extends Activity {

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
}

}

How when I run the "App", eclipse tells me this error in the console window:

[2013-05-15 07:45:17 - Dex Loader] Unable to execute dex: Multiple dex files define Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoVersionImpl; [2013-05-15 07:45:17 - MyApp] Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoVersionImpl;

What's the problem?


Solution

  • Remove YourProject/libs/android-support-v4.jar.
    ABS already have a this library, but older (r7 instead of latest r12).

    You should manually replace support library from contrib/ActionBarSherlock/actionbarsherlock/libs/android-support-v4.jar by HoloEverywhere/support-library/android-support-v4-r12.jar