0

I am using VS 2015 with a Cordova project and I am unable to start the Google Android Emulator.

Attached is the message I receive. The Android assets are located at Android\Assets not Android_Asset. How do I fix the Google Android Emulator start-up process to search in the proper location ?

enter image description here

implmentor
  • 1,386
  • 4
  • 21
  • 32
plippard
  • 375
  • 2
  • 3
  • 17

1 Answers1

1

I spent a great deal of time investigating this one and thought I would share what I found, including the eventual solution.

Extensive googling leads to the repeated suggestion of adding: this.setIntegerProperty("loadUrlTimeoutValue", 60000);

I found that the 'proper' place for this code was in a java file (in my case called MainActivity.java) located in c:[...]\platforms\android\src\com\ionicframework\client2583743 However, after doing so, my build failed with a "cannot find symbol" exception indicating the problem was with the code I added, though java could find the method: symbol: method setIntegerProperty(String,int)

There is, however, another way of adding this value, according to SO: https://stackoverflow.com/a/22620404/1308787

I opened config.xml outside of VS in a text editor and added this line:

<preference name="loadUrlTimeoutValue" value="60000" />

Additionally, the following fix works: https://www.robertkehoe.com/2013/01/fix-for-phonegap-connection-to-server-was-unsuccessful/

Basically this fix requires the replacement of index.html with a window.location redirect to the actual page. However I found that VS2015 cannot attach a debugger when using this technique. I get a "Unable to attach. The operation was cancelled" in VS, but the emulator continues to work, without the Application error above, but also without a debugger attached.

Community
  • 1
  • 1
Ralph Hinkley
  • 370
  • 2
  • 9