简体   繁体   中英

PhoneGap App not running in Android Emulator

I am trying to build/run the PhoneGap 2.0 sample application (\\Phonegap 2.0\\lib\\android\\example). I have exported the app into .apk file and installed on mobile. This is WORKING on the actual mobile device but NOT in the Android Emulator. I just cannot see the App Icon so as to start the App. I have looked in the home screen and the App section. I have tried stuff like locking and unlocking the emulator but nothing works.

I have created an Eclipse Workspace on D:\\Eclipse 3.7.2 and Created an Android Project form Existing Code through Eclipse from the \\Phonegap 2.0\\lib\\android\\example folder.

  1. Windows 7 64 Bit
  2. JAVA SDK - jdk-7u5-windows-i586.exe (32Bit). Installation looks like this:
    • C:\\Program Files (x86)\\Java\\jdk1.7.0_05
    • C:\\Program Files (x86)\\Java\\jre7\\
    • I had to rename the java.exe in the C:\\Program Files (x86)\\Java\\jre7\\ folder for Android SDK to find the java.exe in the C:\\Program Files (x86)\\Java\\jdk1.7.0_05 folder. I had to do it even though I had set an Environment Variable called JAVA_HOME to C:\\Program Files (x86)\\Java\\jdk1.7.0_05\\bin\\java.exe
  3. Android SDK - android-sdk_r20.0.1-windows which is installed on the machine (not extracted via zip file).
  4. Installed the following through the Android SDK Manager:
    • Tools
      • Android SDK Tools
      • Android SDK Platform Tools
    • Android 4.0.3 (API 15)
      • Documentation for Android SDK
      • SDK Platform
      • Samples for SDK
      • ARM EABI v7a System Image
      • Google APIs
      • Source for Android SDK
    • Extras
      • Android Support Library
      • Google USB Drivers
  5. Created AVD through the Android Virtual Device Manager with the following properties:
    • Target - Android 4.0.3 - API Level 15
    • CPU/ABI - ARM (armeabi-v7a)
    • SD Card Size - 128 MB
    • Build-in - WVGA800
  6. Eclipse IDE - Eclipse Indigo Classic 3.7.2 (eclipse-SDK-3.7.2-win32).zip
  7. Eclipse ADT Plugin 20.0.2
  8. PhoneGap 2.0.0.zip

I was required to the run the application twice. First time it gave me an error. The next time it was running and shows the emulator.

Log shows:

[2012-08-08 19:26:10 - org.apache.cordova.example.cordovaExample] ------------------------------
[2012-08-08 19:26:10 - org.apache.cordova.example.cordovaExample] Android Launch!
[2012-08-08 19:26:10 - org.apache.cordova.example.cordovaExample] The connection to adb is down, and a severe error has occured.
[2012-08-08 19:26:10 - org.apache.cordova.example.cordovaExample] You must restart adb and Eclipse.
[2012-08-08 19:26:10 - org.apache.cordova.example.cordovaExample] Please ensure that adb is correctly located at 'C:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe' and can be executed.
[2012-08-08 19:26:25 - org.apache.cordova.example.cordovaExample] ------------------------------
[2012-08-08 19:26:25 - org.apache.cordova.example.cordovaExample] Android Launch!
[2012-08-08 19:26:25 - org.apache.cordova.example.cordovaExample] adb is running normally.
[2012-08-08 19:26:25 - org.apache.cordova.example.cordovaExample] Performing org.apache.cordova.example.cordovaExample activity launch
[2012-08-08 19:26:25 - org.apache.cordova.example.cordovaExample] Automatic Target Mode: launching new emulator with compatible AVD 'MyAVD4.0.3'
[2012-08-08 19:26:25 - org.apache.cordova.example.cordovaExample] Launching a new emulator with Virtual Device 'MyAVD4.0.3'

Please help!

Please ensure that adb is correctly located.The adb tool has moved to platform-tools/

If you don't see this directory in your SDK, launch the SDK and AVD Manager (execute the android tool) and install "Android SDK Platform-tools". Follow this tutorial.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM