Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Problem running Android ApiDemos in Eclipse

Tags:

android

I created a project from ApiDemo sample code in Eclipse (in Windows 7) as described here: http://developer.android.com/resources/samples/get.html

When I try running the project I get the following output:

[2011-03-23 01:59:39 - ApiDemos] Uploading ApiDemos.apk onto device 'emulator-5554'
[2011-03-23 01:59:44 - ApiDemos] Installing ApiDemos.apk...
[2011-03-23 02:01:24 - ApiDemos] Re-installation failed due to different application signatures.
[2011-03-23 02:01:24 - ApiDemos] You must perform a full uninstall of the application. WARNING: This will remove the application data!
[2011-03-23 02:01:24 - ApiDemos] Please execute 'adb uninstall com.example.android.apis' in a shell.
[2011-03-23 02:01:24 - ApiDemos] Launch canceled!

The emulator then opens and the lock screen appears. I unlock it and open the apps panel and the ApiDemos icon is there meaning it has been installed. I open it and it works fine i.e. all the demos work. My question is why do I get the above errors about reinstallation failure? And why does the launch get cancelled? When I run the adb uninstall command in a cmd window it succeeds and then I run the app again in Eclipse and it installs and launches fine. Whats going on here?

like image 411
twerdster Avatar asked Mar 23 '11 00:03

twerdster


People also ask

How to develop an Android app using Eclipse IDE?

For developing the android application using eclipse IDE, you need to install the Eclipse. you can download it from this location download the Eclipse. Eclipse classic version is recommended but we are using the Eclipse IDE for JavaEE Developers. First of all, download the android SDK.

How to create Hello Android application in Eclipse?

1 Install the JDK 2 Download and install the Eclipse for developing android application 3 Download and Install the android SDK 4 Intall the ADT plugin for eclipse 5 Configure the ADT plugin 6 Create the AVD 7 Create the hello android application

How long does it take to debug apidemos?

[debug] [ADB] Waiting up to 20000ms for activity matching pkg: 'io.appium.android.apis' and activity: 'ApiDemos' to be focused [debug] [ADB] Possible activities, to be checked: 'ApiDemos', 'io.appium.android.apis.ApiDemos'

How do I run an Android app on an Android emulator?

Click on the browse button and locate your SDK directory e.g. my SDK location is C:\Program Files\Android\android-sdk . Click the apply button then OK. For running the android application in the Android Emulator, you need to create and AVD.


1 Answers

When you compile the APK file, it will be signed with your own debug key. This key differs from whichever key had been used to create the previous version of the API demo that you had on your emulator image before.

You cannot replace an existing app with a different key. This is in part to prevent imposter apps from overwriting existing apps.

like image 89
EboMike Avatar answered Sep 29 '22 11:09

EboMike