Common errors in ADT projects and how to fix them

satya - 10/31/2013 9:37:07 AM

I have this information in multiple places. I will consolidate them here soon.

I have this information in multiple places. I will consolidate them here soon.

satya - 10/31/2013 9:37:43 AM

Android Failed to install apk on device emulator timeout

Android Failed to install apk on device emulator timeout

Search for: Android Failed to install apk on device emulator timeout

This is happening quite often lately. This happens when I try to run the app on the emulator. Here is a sample.

satya - 10/31/2013 9:38:32 AM

Sample error message


Uploading TestAsyncTaskWithConfigChanges.apk onto device 'emulator-5554'
Failed to install TestAsyncTaskWithConfigChanges.apk on device 'emulator-5554': timeout
Launch canceled!

satya - 10/31/2013 9:39:17 AM

I had to restart the emulator

and deploy the code with out much delay. If I wait for 30 minutes or so, I get this error.

satya - 12/22/2013 9:04:44 AM

See this link for some other errors I kept track of

See this link for some other errors I kept track of

satya - 12/22/2013 9:07:11 AM

failed to rename and sdk directory during android install in eclipse

failed to rename and sdk directory during android install in eclipse

Search for: failed to rename and sdk directory during android install in eclipse

satya - 12/22/2013 9:08:34 AM

Here is some discussion on SOF on this subject

Here is some discussion on SOF on this subject

satya - 12/22/2013 9:14:08 AM

Some suggestions from there are


Close all other windows except essential
Make sure no one else is using that directory
they try again

Or

Make sure your login on windows have admin privileges

Or

Run elcipse as admin (Right click on the icon and run as admin)

Or

Close eclipse
Run sdkmanager.exe from command line

satya - 12/22/2013 9:15:11 AM

Running sdkmanager.exe from the command line is worth a try

Running sdkmanager.exe from the command line is worth a try

satya - 7/3/2014 1:00:49 PM

Dex Loader Unable to execute dex: java.nio.BufferOverflowException

Dex Loader Unable to execute dex: java.nio.BufferOverflowException

Search for: Dex Loader Unable to execute dex: java.nio.BufferOverflowException

satya - 7/3/2014 1:01:04 PM

Full error

[2014-07-03 12:54:15 - Dex Loader] Unable to execute dex: java.nio.BufferOverflowException. Check the Eclipse log for stack trace.

satya - 7/3/2014 1:04:45 PM

This might be of some help

This might be of some help

satya - 7/3/2014 1:07:42 PM

Setting build target to 19 fixed it

I have installed android 4.4 and the associated tools. So you may need to do this to run on the 4.4 emulator. It may still work on a previous emulator setting even though you have the 4.4 sdk installed and its tool set.

satya - 7/4/2014 11:08:18 AM

Not so fast. this seem to have more info on it

Not so fast. this seem to have more info on it

satya - 7/4/2014 11:15:25 AM

Looks like build tools 19 has a big problem

they are suggesting to revert to build tools 18. what a mess!

satya - 7/4/2014 11:25:13 AM

The dilemma is

If I target API 19 and build for avds that are 19 then it works. I cannot target older AVDs that is the problem at the moment.

satya - 7/4/2014 11:49:22 AM

Multiple suggestions have been floated at SOF


1. Uninstall all SDK Build tools that are older than 18.1.1 and restart eclipse.
2. Or right click on android dependencies under project and eliminate it from the build path
3. Or explicitly change project.properties to add the sdk build tools as 18.1.1
4. In all cases you may want to restart eclipse
5. Or set the build target to more than 16
6. Or just match the build target and the target sdk in the manifest file
..
and more...

satya - 7/4/2014 11:52:06 AM

what i really would have liked to see work even in this case is


Keep the latest 19.x build tools
Just the build version to 18.1.1 for those projects

But doesn't seem to work for my project. But again I didnt have time to restart eclipse and restart the AVD etc.

I will go with build tools 18.1.1 for now

As I am going to migrate to newer eclipse and a new fresh install to test 4.x and above soon.

satya - 7/4/2014 1:03:46 PM

Upgrading eclipse tools to Android KitKat

Here is a way to summarize this problem. If you upgraded Eclipse development tools to KitKat from previous versions, then projects for which the build target is older will fail to get loaded to the AVDs. This will fail with buffer overflow exceptions with Dex Loader.

satya - 7/12/2014 11:15:48 AM

So what happens when you upgrade your android eclipse environment to KitKat (API 19)

You will be forced to set your target build to API 19. If you do this you cannot run probably on older API emulators.

On the API 19 emulator you won't be able to test the device rotation. it is broken.

Don't try to upgrade the tool set to beyond kitkat as it might force you to have a new Eclipse version and a new JDK version

If you have already done this the work around is to scale back "only" the build tools level 18 as indicated above.