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:
- Install the new version of the NativeScript command line
- npm install -g nativescript@latest
- Remove the existing platform(s)
- tns platform remove android
AND/OR - tns platform remove ios
- tns platform remove android
- Add the platform(s) you need
- tns platform add android
AND/OR - tns platform add ios
- tns platform add android
- 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
- 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
I think a special mention should go to the solve issue "livesync is killed by invalid XML".
Also, it's worth to mention what tns clean does (https://github.com/NativeScript/nativescript-cli/blob/master/docs/man_pages/project/configuration/platform-clean.md) I. e. readding Platforms. it's something really useful!
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. 🙂
En el paso 3 esta mal tipeado, dice "plaform"! Saludos!
Gracias, actualizada.