sam
sam

Reputation: 5599

Error launching first test application: Android Packaging Problem?

Conversion to Dalvik format failed: Unable to execute dex: 
wrapper was not properly loaded first   
[project]       
Android Packaging Problem

I've never worked with Java or eclipse before, I'm following this introductory guide and all searches via google return no helpful results. I'm guessing the problem is I have built Android stuff with eclipse properly but I have no idea, I followed this guide to the letter and everything went as it explains it should.

Here is what I have compiled Any ideas what caused this problem, or is it specific to the guide? If so I'll post on their help page.

I have tried doing project -> source -> clean up, but that didn't fix anything.

Edit:

I went to Project -> Android tools -> Dex bytecode and it reported:

DexDump: missing classex.dex for project. Please compile first.

So I guess that's my problem! Not sure how to solve though.

Upvotes: 17

Views: 26660

Answers (16)

Ved
Ved

Reputation: 8777

I had the same problem but I resolved it using following steps(using eclipse helios and windows XP ) :-

  • Right click on eclipse.exe.

  • click on Run As...

  • Uncheck the checkbox before "protect my computer from unauthorized activity". And it is running for me as expected ! hope it will also run for you.

Upvotes: 0

sofie
sofie

Reputation: 86

As I said, I had the same problem so I tried all the different versions and then I stopped filling in the SDK-version number and finally it did not complain anymore about the wrapper. After that it was totally fine to write the SDK-version when I created new projects.

Hope it works out for you too.

Upvotes: 7

J.G.Sebring
J.G.Sebring

Reputation: 5964

Recently got this when failing upgrade using adb-manager with eclipse open (win32). As eclipse was open, upgrade failed. Then returning to my project this problem occured.

Was solved by closing eclipse, restart as administrator and cleaned project.

Upvotes: 0

sami
sami

Reputation: 733

Had the same problem - occurred after I tried downloading Android platform v2.3.3 (was using 3.1 and 3.2 earlier) and it interrupted in the middle - restarted eclipse and cleaned all projects and rebuilt and the problem went away

Upvotes: 1

Jonathan Allard
Jonathan Allard

Reputation: 19269

I had installed Eclipse using the files provided by Windows' native ZIP extractor. I deleted the files and took them from 7-Zip instead. Now the error is gone. So maybe using another ZIP extraction tool will help.

Upvotes: 0

jsnfwlr
jsnfwlr

Reputation: 3798

Under windows 7, rather than run eclipse as an admin, change the permissions on the eclipse folder so the creator/owner has full control, and do the same with the folder the android SDK is installed into.

Upvotes: 0

Yogesh Agarwal
Yogesh Agarwal

Reputation: 2630

Running it as Administrator has solved this issue for me..

Upvotes: 1

Jeremi
Jeremi

Reputation: 111

Had the same problem (running on Windows 7). I resolved it by running Eclipse with Administrator privileges.

Upvotes: 5

AlexRobinson
AlexRobinson

Reputation: 11

Had the same HelloWorld problem with Ubuntu 64 Lucid / Eclipse 3.5.2 from Ubuntu repository. Restarting Eclipse did the trick, though I notice it still fusses about API level requirement when HelloWorld is run.

Upvotes: 1

Dave
Dave

Reputation: 6104

Had the exact same problem the other night. Upgraded to Helios (3.6) and it went away, quite possibly as a side-effect.

Upvotes: 0

kaleemullah
kaleemullah

Reputation: 91

Go to Project -> Clean

It will rebuilt workspace and fix the errors if any.

Upvotes: 9

Tyler Levine
Tyler Levine

Reputation: 393

I had the same problem earlier today. Google was largely unhelpful.

I fixed it by removing the project from eclipse, then re-importing it.

According to this bug report the problem is caused by upgrading to version 9 of the SDK.

Upvotes: 1

sorivevol
sorivevol

Reputation: 41

try to run eclipse under administrator permission. Problem may be resolve.

I think you installed the SDK in "Program Files" folder . So for do something inside, must have administrator permission.

Upvotes: 4

Daniel Trebbien
Daniel Trebbien

Reputation: 39228

One thing that may help is to create a new test Android project.

  1. In Eclipse, select File → New → Android Project.
  2. Set the project name to "Test3", check Android 2.3 for the build target, type "com.example.android.apps.test3" for the package name, and type "Test3Activity" in the "Create Activity:" text box. The form should look like:

    Screenshot of the resulting New Android Project form

  3. Click Finish.

  4. Expand the entry for "Test3" in the Package Explorer. Navigate to res/values/strings.xml. Double click on the entry for strings.xml:

    Screenshot of "Test3" in the Package Explorer

  5. Set the text content of the string element having name "app_name" to "Test3":

    Screenshot of XML editor with the described changes to strings.xml

  6. Right click on "Test3" in the Package Explorer and select Run As → Android Application. The emulator should open and after a long while, you should see:

    Screenshot of the Test3 app running within the emulator

If these steps do not work, then you probably have an error in your installation.

Try it out and let me know.

Upvotes: 3

Wrenbjor
Wrenbjor

Reputation: 158

Here are a few things to check:

Make sure you have the latest version oF Eclipse (Helios) Make sure that you have the Android SDK plug-in for Eclipse.

Now if you have done that... Make sure that any classes you add (Each screen you view on Android is a class and is called an Activity) are in your androidmanifext.xml file See http://wrenbjor.com/2011/01/12/the-androidmanifest-xml-file/ for help on understanding this process.

otherwise make sure there are no red x's in your code or it wont work.

If you still have problems post some code and we can try to help.

Upvotes: 0

Joey
Joey

Reputation: 152

At what point in this tutorial/guide are you running into this problem and did you make sure to include your package information in each file or ie com.something.somethingelse at the top of your class or classes?

Perhaps a registry error or maybe even a problem with activity implementation.

Please post your code if this did not start you in the right direction.

Upvotes: 0

Related Questions