Multi-Device Hybrid Apps FAQ

How do I run my app on different platforms from Visual Studio?
To switch between target device platforms, you will need to use the “Solution Platforms” dropdown present in the VS toolbar. If you have installed a fresh copy of Visual Studio 2013 Update 2, it will be there by default, but it may not be present if you upgraded from a previous version. Fortunately, it is easy to add it into the toolbar as described in Microsoft Support article 2954109.
My breakpoints are not always hit when debugging in Ripple or on my Android 4.4 device or emulator. What can I do to resolve this problem?

In this release, there is a known issue where VS Debugger will not stop at breakpoints that occur prior to the first page load in Ripple or Android emulators or devices.

However, these breakpoints will be hit after refreshing the browser (Ripple) or executing the following from the JavaScript Console:

window.location.reload()

Note that debugging Android devices from versions prior to 4.4 is not supported in this release.

I am experiencing poor performance while stepping through breakpoints when my app is running on an Android 4.4 device or emulator. How can I fix this?

This is a known issue appears to present itself in larger projects. We are actively looking into a fix for the problem.

I am seeing Ripple hang on public or open networks, but not on my home or work network. How can I fix this problem?

Ripple starts up a local web server to proxy request and as a result can be blocked if your firewall rules explicitly disallow connections on public or open networks.

To resolve, you can either get on non-public network (or no network) or opt to temporarily allow Ripple to connect on open networks, if absolutely required, by doing the following:

  1. Open Windows Firewall settings (Search for “Windows Firewall” from the Start screen).
  2. Click “Change Settings.”
  3. Ensure Domain, Private, and Public are all checked for “Evented I/O for V8 JavaScript.”
  4. Click OK.
  5. You may need to restart VS or your PC to cause this change to take effect.

Windows Firewall settings 

While an alternate solution, it is not recommended to indicate that a public or open network is actually a home or office network when you connect to it.

I am experiencing build errors about not being able to find the Android SDK or that I am missing SDK level 19. What can I do?

First, be sure all of the necessary third-party dependencies are in your path. See “[Alternate] Installing 3rd party software Manually” in the documentation for details.

Second, be sure you have the Android SDK for Android 4.4.x installed. Go to the Android SDK Manager (either via the Start menu or by typing “android” from the Developer Command Prompt) and ensure that Android 4.4.x (API 19) is installed. Note that you may need to restart Visual Studio and/or reboot after doing so.

Android SDK Manager 

Where did the Android SDK get installed?

The default install location for the Android SDK on Windows can be hard to find. It is located here:

%localappdata%\Android\android-sdk

(Example: C:\Users\<user>\AppData\Local\Android\android-sdk)

I am receiving an error stating “The imported project … path in <import> declaration is incorrect…” What is wrong?

Be sure both node.js itself and the global npm install location is in your path.

Environment variables 

How do I get around Apache Ripple™ limitations?

Ripple supports a subset of the total functionality available in Cordova. Fortunately, this code can be used to vary behavior and skip features that are not supported. 

if (typeof (window.tinyHippos) == "undefined") { 
   // not ripple 
  } else { 
   // ripple 
  }
Ripple popped up an “I Haz Cheeseburger?!?!” message. What happened?

You are using a Cordova plugin or feature that Ripple does not support. Fortunately, you can enter your own expected API response to test your functionality. If you find the error annoying, use the Ripple Limitation workaround above.

The Android Emulator keeps crashing, how can I fix this?

We have reports of the Android emulator crashing if an x86 image is used without turning off Hyper-V and installing the Intel HAXM driver. The ARM image, however, does not have this problem. See the Android Issue Tracker for updates.

I am seeing “failed to build” errors in VS when building for iOS using the vs-mda-remote agent. How can I troubleshoot the problem?

Most likely this is due to some sort of native build problem. The most common issue is that you have not properly set up signing and provisioning. See our documentation and Apple’s developer documentation for details on resolving this issue. Regardless, you can look at the console output (or a log file) of the agent to determine what is going wrong. For example, if you do not have provisioning or signing identities configured, you may see the following error:

=== BUILD TARGET BlankCordovaApp1 OF PROJECT BlankCordovaApp1 WITH CONFIGURATION Debug === 
Check dependencies 
Code Sign error: No matching codesigning identity found: No codesigning identities 
(i.e. certificate and private key pairs) matching “iPhone Developer” were found. 
CodeSign error: code signing is required for product type 'Application' in SDK 'iOS 7.1' 
** BUILD FAILED **
I am encountering TypeScript compilation errors particularly when using third-party Apache Cordova™ plugins. How do I fix this?

This is because you do not have TypeScript typings for the Cordova plugins. There are a number of TypeScript definitions (.d.ts) available via NuGet or DefinitelyTyped, but note that these errors are not blocking issues; the JavaScript actually does compile despite the errors. You can also easily create definitions yourself if needed. Note that some plugins may alter standard DOM objects but you can still extend these objects in your definitions. For example:

interface Navigator {
 camera: { 
  getPicture: any 
 } 
}
How can I get access to the native Xcode project used to build? How can I manually build for iOS or use the emulator on a Mac?

After building for a native (non-Ripple) target for any platform, the contents of the bld/Debug (or bld/Release if you did a release build) folder is a standard Cordova Command Line Interface (CLI) project. If you install node.js and the Cordova CLI (sudo npm install -g cordova@3.4.1-0.1.0) on your Mac, you can then use these tools from a Mac.

See “Exporting a Cordova CLI Project & Accessing Native Projects” in the documentation for additional details.

An error showed up while building for a platform for the first time?

EXEC : error : ENOENT, no such file or directory 'C:\Users\<username>\.cordova\lib\android\cordova\3.5.0\VERSION'

This seems to be a bug while installing the platform code. As a workaround, go to:

C:\Users\<username>\.cordova\lib\tmp\<somestring>\

Find a file named "VERSION", and move it to:

C:\Users\<username>\.cordova\lib\android\cordova\3.5.0\VERSION

I just connected my Android Device to my machine and deployed to it. I got a “No Devices Found” error. What happened?

To run on an Android device, you also must install the appropriate device-specific OEM driver or the Google USB driver for Google Nexus devices. Google’s Android documentation provides a good pointer to manufacturer OEM drivers. Be sure to accept “Allow USB Debugging” when prompted.

How can I configure something about my app not available in config.xml?

The res/cert folder provides a way to inject content into the native project used to build your app. We recommend avoiding this practice whenever possible. However, here are some examples:

  • Android: A custom AndroidManifest.xml file can be placed in the res/cert/android folder to override properties like min, max, or target version. You can grab the generated version in the bld/Debug/platforms/android folder after building Debug for the Android emulator or Device target.
  • iOS: A custom Info.plist file can be placed in the res/cert/ios folder to override settings like splashscreens or icons. The file should be prefixed with your project name as follows: <display name from config.xml>-Info.plist. You can find a sample version in the cordova-ios GitHub repository, or you can get the generated version for your app from the build folder on your Mac, when using the remote agent, under the <build number>/cordovaApp/<display name from config.xml> folder.
  • Windows 8: A custom package.appxmanifest file can be placed in the res/cert/windows8 folder to override a number of settings. You can grab the generated version in the bld/Debug/platforms/windows8 folder after building Debug for the Windows Local, Simulator, or Device target.
  • Windows Phone 8: A custom WMAppManifest.xml file can be placed in the res/cert/wp8/Properties folder. You can grab the generated version in the bld/Debug/platforms/wp8/Properties folder after building for the Windows Phone emulator or Device target.

Note: If you override some of these files, you may also have to manually update allowed device capabilities after installing plugins - they will no longer do that automatically.

If all else fails, you can get access to the underlying native project being used to build your app as described in the documentation.