NativeScript 2.1 released (and common issues/fixes)

WooHoo, 2.1 is finally released.  Lots of things fixed and several other cool new things added; here is some of the changes in v2.1;

  • TNS Clean command!
  • Fix for faster Building (really affects Angular 2 builds)
  • Fix for Google library and default Config issues.
  • several naviation crashing issues fixed
  • several LiveSync issues fixed
  • Lots of other fixes

Now to install this awesome new release in four simple steps:

  1. Install the new version of the NativeScript command line
    • npm install -g nativescript@latest
  2. Remove the existing platform(s)
    • tns platform remove android
    • tns platform remove ios
  3. Add the platform(s) you need
    • tns platform add android
    • tns platform add ios
  4. Install the common core modules
    • npm install tns-core-modules@latest --save


A couple issues have cropped up in NativeScript 2.1.0 -- Here are the issues with the solutions

  1. If you see "error: constructor RunTimeHelper in class RuntimeHelper cannot be applied to given types" or "com.tns.Runtime runtime = new RuntimeHelper(this).initRuntime();" or "reason: actual and formal argument lists differ in length"
  • This means one of the above is out of sync with the others; all three pieces of the puzzle MUST be 2.1.0 or later.   This is one of those upgrades that requires everything to be in sync.

2. If your app fails to deploy to the phone or android emulator

  • This means one of the above is out of sync with the others; again all three NativeScript pieces MUST be 2.1.0 or later.

3. Missing CFBundleShortVersionString / CFBundleVersion on iOS

  • Open xcode, then open up the file platforms/ios/Internal/NativeScript.framework/Info.plist then add both the keys, and set them to 2.1.0
  • Or once iOS 2.1.1 runtimes has been released; upgrade to the 2.1.1 iOS runtimes.

4. Error: java.lang.runtimeException:Unable to create application
with next error being   Java.lang.ClassNotFoundException com.tns.FragmentClass

  • npm install tns-core-modules@latest --save
    Then you can build/run it as normal.

5, No errors, but no deploy either (android)

  • npm remove -g nativescript
  • npm cache clean
  • npm install -g nativescript
  • tns platform clean android   <-- Done inside your project

4 thoughts on “NativeScript 2.1 released (and common issues/fixes)

  1. Nathanael Anderson Post author

    Well, I must confess I was not really aware of that LiveSync is killed by invalid xml; I never use LiveSync. The few times I've messed with LiveSync, I've been totally frustrated by it. It is extremely slow compared to my own free plugin NativeScript-LiveEdit . LiveEdit is imho a far superior option to doing live editing as it can also updated JS code, and has had anti-crash code in since I think the first version, so I must confess I don't really follow LiveSync changes. 🙂

    Now as to the *clean* statement, the only thing it does is make two commands (remove/add) into one and make it easier to ask have you "cleaned" your platforms folder. Apparently based on what I read in the bug reports it just removes then re-adds the platform. This "technique" is something I've been doing and teaching since early on when I started getting into plugin development and blew up my platforms folder frequently. 🙂


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.