Cordova loading app into android emulator - android-emulator

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.

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.

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.)

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.

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.

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

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.

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.

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.

Related

My Ionic app works fine on browser but does not open in my phone

my ionic project works fine with ionic serve --lab ,but while copied the.apk file in build folder to my phone and install the app but blank screen appears ,
Please can anyone suggest what might be my problem
my app is using google maps,key is provieded for both app and browser in index.html
Have you tried running it in the emulator ? Since its much easier to see the error logs . Try ionic emulate android -l or ios -l (whichever OS you are building for) and then once the execution starts run the command consolelogs it will log all the activity and you will have a better understanding about why its not working.
+1 for using Chrome Remote Debugging feature. It give you the same output as you would receive from running you app in the browser.
Additionally, I have found that sometimes if your app is already compiled, the ionic CLI doesnt always copy your current files into the APK, and uses the older cached files instead. If you are banging your head against the wall, run the following commands to make sure you have your latest code in your APK.
ionic platform remove android
ionic platform add android
ionic run android
I suggest you use the Chrome Remote Debugging feature. I encountered the same, and looked for answers to my symptom for hours. Once I connected to the chrome remote debugger, I got the console.log back, and noticed there was a problem in my routing setup.
It was a problem with ionic CLI. I've updated it to the latest and reinstalled all dependencies.

Unable to launch Android emulator from Eclipse/Linux

I'm using Eclipse Juno (build 20120920-0800) on openSUSE 12.2 to code Android applications.
I have installed the SDK by uncompressing it into my home directory (if I install the SDK via YaST package I can't download stuff unless I'm root). I installed ADT from Eclipse Marketplace, configured the path of the SDK and configured a couple of emulator configurations.
I can run and debug fine on my phone, and I guess the same applies to my tablet even if I haven't tried yet.
The real problem is that I can't run the emulator. Clicking on the bacarozzo debug icon prompts me to run the application on the device but doesn't show me available emulators.
If I open the device manager I'm shown with the virtual devices I created but I can't just start any. The progress bar reaches the end, I see no emulator screen and if I try to delete the emulator I'm warned that the instance is running... (OK in the screenshot there is only one, I already managed to delete the other)
I urge to test some GUI features in an outdated version of Android. I have done all the field tests of the business logic code in my program on a JB device and I know for sure that code works on any device.
Now I only need to be backward-compatible with preferences and layouts.
How can I start the emulator in Linux?
Just by luck I managed to run the emulator from console
djechelon#RAYNOR:~/android-sdk-linux/tools> ./emulator-arm -avd Emulator_cell
It came to life and Eclipse debug is detecting it as active device

Cannot get Android Emulator to start

I understand there are many threads like mine but I have been trying to get an Android Emulator to work on my Windows XP PC and have encountered nothing but brickwalls. Here is what I've done:
I installed the latest JDK (Version 6 Revision 26) ... no problem
I unpacked "Eclipse" (Version 3.7 - Indigo) ... no problem
I downloaded and unzipped Android SDK ... no problem
I updated Android SDK with Android SDK Tools and two platforms (2.2 and 3.1) ... no problem
I installed the ADT plug-in for Eclipse ... no problem
I configured ADT to point to the Android SDK ... no problems
I created the "Hello World" app from the Android developers site ... no problem
I tried to run it...
And this is where I've been halted. I've tried:
Creating an AVD with default settings in both 3.1 and 2.2 ... no luck
Changing device RAM size ... no luck
Starting the AVD from Android SDK ... no luck
Starting AVD from the command line ... no luck
Starting it with no animation ... no luck
Leaving it to start over night, twice, with different settings ... no luck
I've been perusing websites for hours trying to find other solutions but having absolutely no luck?!?
It basically starts to load, it shows the "A N D R O I D _" animation and then moves to the one where the green "swoosh" moves across the logo and then it just sits there...for hours! If I try and run the "Hello World" app while it's in this state it just fails (obviously.) I don't know if I'm missing something obvious or what?!? I'm happy to uninstall everything and try again but not before I've exhausted reasonable measures to fix what I imagine to be an easy problem to solve?!?
Please try this process.
Close your Eclipse IDE
Restart the IDE and delete the AVD created.
Create the AVD and then relaunch the application.
Please let me know if this process helped you.
Similar issue here:
Newly installed Eclipse and Android SDK. Can't get emulator to work. Hangs on clock screen
Create an APK file (archive for java app for Android), copy to the machine using usb cable or whatever you use, and then just install it. Not the ideal, but it helps.

Appcelerator Titanium: Android SDK doesn't load

I started developing with Titanium and now I really stuck on one part.
I downloaded the Adroid SDK and added the path to Titanium:
/Users/michael/Downloads/android-sdk-mac_86/
I can open e.g. Kitchen Sink in the iPhone Simulator without problems, but when I want to open it in Android then my screen looks like this: Screenshot
Why is down there all the time, even after 2 hours of waiting, the label "loading..." ?
some great advice given here - helped me out.
Switching to TRACE will probably show that Android SDK Platform 1.6 and API 4 is missing.
More info here
1) You can install Android SDK 1.6 (run tools/android from your Android SDK folder and download the older SDK 1.6 from the Google Repository),
and Titanium will detect Android SDK
2) As for Android SDK 2.2, adb moved to platform-tools folder, so you will have to create a link in [your-android-sdk-folder]/tools e.g. :
ln -s ../platform-tools/adb
(full instructions for non-linux here : http://guides.appcelerator.com/en/getting_started.html)
Finally, in the Titanium Test&Package/Run emulator window, you will have the choice between Android SDK 1.6 and 2.2
Try to open your Android_SDK_Dir/tools, run file android to create a new Android Virtual Device. After that, open your Titanium again. Maybe this will solve your issue.
Take a look at your image. Value of SDK listbox is "...loading...". This means you Titanium cannot determine which Android Virtual Device is. So, as I said, try to create new Android Virtual Device first.
having the same issue - have you found a workaround?
found out that after downloading the android sdk - there are other components to be downloaded, which is different from previous versions. Also found some implication that loading the android emulator prior to launching the app from titanium may yield better results.
check the android docs for updating the sdk via the avd manager
load the emulator first video:
http://vimeo.com/10866226
Try setting the Filter from "Info" to "Trace" that may illuminate things.
Most commonly, you may not have the right platforms installed. Just install all of them if that's the case.
add a blank folder android-7 in android/platforms ..n restart titanium ..it worked for me on ubuntu

Re-installation failed due to different application signatures

I moved my Android project to a laptop and now I get this when I hit Debug. Sounds like this is a bug? This shouldn't happen via Eclipse as far as I know.
Re-installation failed due to different application signatures.
The weirdest thing is this happened after I upgraded sdk/adt and Eclipse to support SDK 2.2 It was working fine earlier, and now it doesn't, so it might be a bug.
It happens because keystores on your laptop and original pc are different. it's called debug.keystrore
and located in %USER_HOME%/.android/ folder. TO be more specific it happens because eclipse tries to push apk with reinstall key. So you have two options
Share debug.keystore between various development pc's
Manually uninstall your apk from device ( using adb )
I also got the same problem and fixed it. you should do the following to fix it,
Uninstall the application from your mobile if you load it
already.
To uninstall goto settings->application->manage application.
Run the application again and choose the mobile
Hope this will help you
After you copy debug.keystore to your PC, you need to rebuild project on PC.
I had the same issue using the Droid emulator. I solved it by uninstalling the package from the application settings in the emulator as you would a normal device. On the next run, it reinstalled and the error went away.
I got the same problem and fixed it by just wiping the user data on the emulator. My guess is that the emulator keeps the project installed unless you wipe the data, so if your new project doesn't match some internal parameters it doesn't like it and won't reinstall it.
I also had the same problem and fixed it by uninstalling the app and reinstall it again.
ah i think i found your answer:
Why does the app signature change in Android after a classpath change?
its changed if you change the classpath
After searching and checking the phone, i came to know that i am currently developing 2nd version of this application which is already downloaded from android market in my phone, now as this app is signed and having different signatures this is throwing the above error.
Now, to resolve this issue, i had just uninstalled the app from mobile and run/install the application again.
I had the same issue with the emulator and i ran the command "adb uninstall TheNameOfPackage". Of course you must first go to the directory where the adb.exe has been installed, usually C:\Program Files\Android\android-sdk\platform-tools, and then run the above command.
For me after I copied all of my keystore files from my machine at home, I had to do a Project->clean. After that it worked perfectly.
When i tried to uninstall the application from my device after this issue occurs, i cannot able to find the app in my device. I don know where it gone. Then i uninstalled using adb,
adb -d uninstall <app package name>
This is the answer who are facing the issue similar to my problem.
I had the same issue.
To fix it I uninstalled the old .apk of the project from my device.
Go to device/emulator Settings -> Apps, find your app and uninstall it.
Or
In Android Studio open tab "Gradle" (on the right side), open:
appName
..appName
...Tasks
....install
.....uninstallAll
and click twice on this task to execute it.
Important note:
If you still get this error after uninstalling, try to Build->Clean Project.
If you still get this error, even if in your device Settings->Apps list you have no this app already, try to Build->Clean Project