Yasin Mansour
Yasin Mansour

Reputation: 119

phonegap run android not working and no error message

I had worked with Phonegap for a period of time and it workd good but yesterday I got stuck in a problem with installing the app on my device using command line:

\>>phonegap run android  
it return
[phonegap] executing 'cordova run android'...
[phonegap] completed 'cordova run android'
and no error message

But nothing happened the app as it does not get installed in my device nor open the emulator.

I try to create new project, update Phonegap, update android platform, update SDK and uninstall the phonegap and re-install it but nothing changed.

Upvotes: 10

Views: 14482

Answers (5)

Sjoerd Pottuit
Sjoerd Pottuit

Reputation: 2327

With phonegap run android --verbose you can get more info. I encountered the same problem. Maybe not the same error.

Command: phonegap run android --verbose

ERROR running one or more of the platforms: Error: cmd: Command failed with exit code 1

You may not have the required environment or OS to run this project

When I ran the command below I saw another error.

Command: cordova build android --release

FAILURE: Build failed with an exception.

What went wrong:

Execution failed for task ':processReleaseManifest'.

Manifest merger failed : uses-sdk:minSdkVersion 10 cannot be smaller than version 14 declared in library C:\Users\Username....\platforms\android\build\intermediates\exploded-aar\android\CordovaLib\unspecified\release\AndroidManifest.xml

Suggestion: use tools:overrideLibrary="org.apache.cordova" to force usage

Changing the minSdkVersion in the config.xml to 14 worked. It is the same solution as 3than's solution. Only the number is different.

<preference name="android-minSdkVersion" value="14" />

Upvotes: 1

  • installing ant using command

    brew install ant

  • running the following command in /platforms/android/

    android update project --name <project_name> --target <target> --path <path>

solved the problem for me.

Upvotes: 0

rashidnk
rashidnk

Reputation: 4292

I had the same problem, apk not installed on the device with cordova run android command, i did some research and found a solution.

Open a new terminal window and navigate to your outputs /apk folder

for me it is /NetBeansProjects/CordovaProjects/JQT/platforms/android/build/outputs/apk$

then run the command adb install -r android-debug.apk

it gave the following message

4927 KB/s (1842130 bytes in 0.365s)
    pkg: /data/local/tmp/android-debug.apk
Success
rm failed for -f, No such file or directory

the apk was successfully installed. you can try the same

Upvotes: 0

3than
3than

Reputation: 101

I was having the exact same problem. Adding this line to the config.xml file solved it for me:

<preference name="android-minSdkVersion" value="10" />

I found this solution after running it as a Cordova command cordova run android instead of a Phonegap command. The Cordova command gave the error below error:

Manifest merger failed : uses-sdk:minSdkVersion 7 cannot be smaller than version 10 declared in library C:\Users\ecarriger\Desktop\test\platforms\android\build\intermediates\exploded-aar\android\CordovaLib\unspecified\debug\AndroidManifest.xml

Changing the minSdkVersion to 10 in the Android manifest that the error pointed to didn't work because the run process overwrites it.

Upvotes: 10

Saks
Saks

Reputation: 21

This was happening to me also and I was going nuts for last couple of days trying to figure out and it finally worked. Here is what I did to make it work:

  1. Install Apache Ant (see http://ant.apache.org/manual/install.html)
  2. Under Android SDK Manager, scroll to the bottom and look for Emulator Accelerator under Extras folder (It was specifically called Intel x86 Emulator Accelerator on my machine).

Once installed, I restarted the command window (Administrator mode) and now it worked.

You may also try to type cordova run android which is where I saw the Apache Ant server error.

Upvotes: 2

Related Questions