0

Recently installed VS 2015 Community Update 3 in Windows 10 Pro 32 bit. For the past couple days I have been playing with Cordova, but can not get it to work correctly.

I tried:

  1. Redirect index.html hack.
  2. Clearing cache in TACO settings
  3. Repaired VS

This text is from the build log / VS / emulator / debug log / me.

Build: Warning: No emulator specified, defaulting to AVD_GalaxyNexus_ToolsForApacheCordova Build: Failed to create Context 0x3005

VS: There were deployment errors. Continue?

Me: If I click Yes

Build: Debug is starting Emulator: "The connection to the server was unsuccessful. (file:///android_assset/www/index.html)"

Me: App appears 3 times on emulator Me: Breakpoints don't work. In the Debug log I see many messages "Cannot find or open the PDB file."

Me: Build log says the app was installed but Deploy failed?

Build:

Installing apk C:/Users/pears/Documents/Visual Studio 2015/Projects/BlankCordovaApp1/platforms/android/build/outputs/apk/android-debug.apk on emulator-5554... INSTALL SUCCESS Unlocking screen... Running command "input keyevent 82" on emulator-5554... Starting application "io.cordova.myapp6178b0/.MainActivity" on emulator-5554... Running command "am start -W -a android.intent.action.MAIN -nio.cordova.myapp6178b0/.MainActivity" on emulator-5554... LAUNCH SUCCESS Executing "after_run" hook for all plugins. Warning: No emulator specified, defaulting to AVD_GalaxyNexus_ToolsForApacheCordova ========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ========== ========== Deploy: 0 succeeded, 1 failed, 0 skipped ==========

Me: I don't see any errors in the build log.


Update 7.22.2016

I created a new Azure VM (Windows 2012 R2 Datacenter, 64 bit, 2 core Intel 2.2, 7 GB RAM) and installed VS 2015 and Cordova. From the AVD manager, the base emulator started up fine. However, the deploy still failed for a blank Cordova project. I saw the white Cordova screen saying it was connecting to device. Then the same message "The connection to the server was unsuccessful. (file:///android_assset/www/index.html)". Maybe the Redirect index.html hack will help. I didn't try.

Next, I Installed the stand-alone Android Studio in my desktop Windows 10 VM for more options with the AVD and SDK. Immediately, it tells me my CPU doesn't support VT-x. Makes sense - it's an AMD processor. I started the AVD GalaxyNexus ToolsForApacheCordova emulator anyway and it never finished loading. It targets API 19, Android 4.4, and arm CPU. I tried upgrading to API 23 which refused to run and says:

Intel HAXM is required to run this AVD. Your CPU does not support required features (VT-x or SVM).

Unfortunately, your computer does not support hardware accelerated virtualization. Here are some of your options:

1) Use a physcal device for testing

2) Develop on a Windows/OSX computer with an Intel processor that supports VT-x and NX

3) Develop on a Linux computer that supports VT-x or SVM

4) Use an Android Virtual Device based on an ARM system image (This is 10x slower than hardward accelerated virtualization)

Greg
  • 1
  • 2
  • Could you try setting the RAM of `AVD_GalaxyNexus_ToolsForApacheCordova` Emulator to 512M? – Elvis Xia - MSFT Jul 18 '16 at 02:06
  • How? In the AVD manager, AVD_GalaxyNexus_ToolsForApacheCordova has Memory Options > RAM: 768. Looks like It's configured with 768 MB. – Greg Jul 19 '16 at 21:29
  • I dropped the RAM from 768 to 512, but it didn't help. Also created another emulator which VS saw and used but it never launched. Maybe VS was still building but I lost interest after 5 minutes. – Greg Jul 19 '16 at 23:09

1 Answers1

0

It seems like VS failed to create an Android Virtual Device. You can create one in the version of Android Studio that VS installs on your machine. The default location is in "C:\Users[usename]\AppData\Local\Android\sdk\". Click on "Avd Manager" and create a device. Make sure its the only device created--any existing ones may be broken. Then, go back to VS and click "Android -> Build to Google Android emulator".

FYI--if you have Hyper V enabled (you are using a Windows Phone emulator), you should be selecting the ARM system image.

Linda Z
  • 292
  • 1
  • 5
  • I tried creating another emulator (Nexus 5) in AVD Manager. VS saw and used it but it never launched. When I start the emulator outside VS, I get "Process system isn't responding. Do you want to close it? Wait / Ok." After clicking Wait and then the blank cordova app, I get "The connection to the server was unsuccessful.(file:///android_asset/www/index.html)" BTW, I enabled Hyper-V to see if it would help. It didn't. – Greg Jul 19 '16 at 23:29
  • Okay, I'm spitballing ideas-- 1. Are you using a VM? The launch is taking a really, really long time. What is the environment in which you are running your Cordova project. Try starting the emulator from the AVD manager, and then building your Cordova project in VS. 2. Is your page content really big? A quick ping of stack resulted in this thread: http://stackoverflow.com/questions/23514622/cordova-connection-to-server-was-unsuccessful 3. other issues? http://stackoverflow.com/questions/30841817/error-the-connection-to-the-server-was-unsuccessful-in-cordova-and-jquery – Linda Z Jul 20 '16 at 04:18
  • Yup. General speed is fine, but emulator is sloooow. It's a VM 4 cores (3.2 GHz) and 4 GB RAM running Windows 10 Pro 32 bit. VS 2015 Community Update 3. From the AVD manager, it takes over 5 minutes to fully launch the emulator and I get the "Process system isn't responding..." message. If ignored it goes away. Project is basic template. I will try a faster VM. I tried the hack from that link before. Didn't help. – Greg Jul 21 '16 at 10:25