Reputation: 117
I am totally new to Cordova, but now I have installed Cordova with NPM and installed Android SDK and set up an AVD which seems to work perfectly, until I want to emulate my project. Where the actual app for some reason is not loaded into the emulator.
The following action is done:
marvin:HelloWorld$ cordova -d emulate android
cordova library for "android" already exists. No need to download. Continuing.
Wrote out Android application name to "HelloWorld"
Wrote out Android package name to "com.example.hello"
Calling plugman.prepare for platform "android"
Preparing android project...
Processing configuration changes for plugins.
Iterating over installed plugins: []
Writing out cordova_plugins.js...
Running on emulator for platform "android" via command ""/home/marvin/Development/projects/HelloWorld/platforms/android/cordova/run" --emulator" (output to follow)...
Then it start Android emulator up, but the app is not there. Does anybody have a suggestion to fix this issue, so I am capable of actually testing in my emulator?
Thank you in advance.
Upvotes: 4
Views: 28267
Reputation: 455
I just had the same problem, and It was my emulator device that was with the API 15. Just updated to API 17 and the problem solved.
Upvotes: 0
Reputation: 91
I had the same issue. Following solved it for me.
Make sure that API level of your AVD is greater than minSdkVersion specified in config.xml specified in your cordova app.
Upvotes: 1
Reputation: 1602
For me, the app was not starting up because I had a second emulator running in the background. Uninstalling bluestacks (android emulator for windows) fixed the issue in my case. Running "adb logcat" should tell you if you have multiple emulators running.
Upvotes: 0
Reputation: 177
Also make sure your app id doesn't begin with a number or any other character like "_". For example, if your app id is com.4company.MyApp
or com._company.MyApp
it just won't load on the emulator. The first one is because Java doesn't allow names beginning with a number, and the second one I guess it's a Cordova thing.
You should also use adb logcat
to show the emulator errors on the command line.
Upvotes: 0
Reputation: 4292
If anyone still having this issue:
I had a same problem with device being offline.
if ddms is running it looks after connected devices.
adb kill server
and than run ddms
Upvotes: 0
Reputation: 562
Sometimes it works deleting the previously installed version of the app in the emulator. For this you could also launch it with the option "Wipe user data" checked.
Just for the record, none of the other solutions worked for me.
Upvotes: 3
Reputation: 5376
I had the same problem as well; I could run the cordova emulate android
command just fine, and the emulator would eventually start up and function, however, the test app was never installed on the device. I was not getting any errors from the Cordova CLI or the console or anything.
I found that there is a bug report about this issue here: https://issues.apache.org/jira/browse/CB-4285
Two solutions have been found for this issue: 1. Make sure you are using an Oracle JDK and not an IBM JDK, and 2. Make sure the AVD that emulate starts up has a min-target-sdk set to API 10 (Android 2.3.3) or higher. (This was my problem.)
Upvotes: 6
Reputation: 166
I just had the same problem, and I was missing PATH to platform-tools in android sdk folder, after I added it everything was in place.
Upvotes: 8