ERROR: Application requires API version 2. Device API version is 1

by JP » Fri, 29 May 2009 10:33:39 GMT

Sponsored Links
 You're running Android 1.0 on the device, which is API version 1.
Unless you think your target audience is still on 1.0 for one reason
or another, I'd recommend you update your device to at least 1.1, or
better yet, straight to 1.5. They have version numbers 2 and 3
Now if you absolutely need to cover 1.0, you have to drop
minSdkVersion to 1.


Other Threads

1. How to run the unit tests of the APIDemo at the command prompt


In the source of ApiDemos, it said:
 * To run just this suite from the command line:
 * $ adb shell am instrument -w \
 *   -e class \

So I get the error 'device not found'
$ cd /Users/meryl/Programs/android-sdk-mac_x86-1.0_r2/samples/ApiDemos/

$ /Users/meryl/Programs/android-sdk-mac_x86-1.0_r2/tools/adb shell am
instrument -w -e class
error: device not found

The location of my source is in /Users/meryl/Programs/android-sdk-
and the bin directory is where eclipse puts the class files.

Can you please tell me how to get the command line execution to work?

Thank you.


2. ANN: DroidEx Android device projector, version

In response to the "[android-developers] Re: Rendering the G1 screen on
a computer screen  via VNC software?" thread, I tossed together a quick
and very dirty DroidEx.

DroidEx provides a window with a constantly-refreshing view of a device
connected to the host computer. You can use this for demonstrating
software that requires a G1/ADP1 instead of an emulator.

To get it, download the 3K JAR file from:


To run it, you need to put it and the ddmslib.jar from your SDK tools/
folder on the classpath and invoke com.commonsware.droidex.DroidEx, such as:

java -cp

It also requires that the adb daemon be running, such as a development

It assumes there is precisely one device plugged in or emulator running.
All it does is open a window showing you the contents of that device's
or emulator's screen. It refreshes ~6 times/second, so it's not the
smoothest thing going, but at that speed it doesn't seem to drag the G1
down very much.

It also suffers from the following:

-- The screen-capture logic in Android proper seems to occasionally miss
updates for some reason. I've seen this with DDMS and hierarchyviewer
too, so I'm assuming it's something in the Android firmware. Hence,
sometimes DroidEx will appear to be a movement behind (e.g., you clicked
up in a list, and DroidEx still shows the previous one as the selected item)

-- Once, adb or the device seemed to reject DroidEx part-way through a
projection session, causing the image to freeze on DroidEx's window and
a bunch of error messages to be logged to stderr. Closing and reopening
DroidEx was sufficient to clear up this condition.

Also, this was compiled against 1.0r2's version of ddmslib.jar, so it
may or may not work with other versions of the SDK.

It is far from perfect, but it may be better than pointing a {*filter*} at a
device for device-based demos. However, as the saying goes, "your
mileage may vary". I disclaim all warranties, will not be responsible if
your use of DroidEx rips a hole in the space-time continuum, etc.

If there's sufficient interest, and I have time, I'll clean up the
extremely ugly code (~100 lines) and post it somewhere.

If you have questions or comments regarding DroidEx, head over to the
CW-Android Google Group, and post 'em there:


Or, reply to this message.

Mark Murphy (a Commons Guy)
_The Busy Coder's Guide to Android Development_ Version 2.0 Published!


3. Need help in running the android junit test case for andriod APIDemo in eclipse

4. Rendering the G1 screen on a computer screen via VNC software?

5. Install Android on Windows/Ubuntu Possible?

6. Problems in running ADT on eclipse on Mac

7. How to run the 'AllTests' of ApiDemos in the android sdk sample