Tag Archives: upgrade

NativeScript: Version 2.3.0 Released

ns-versionFor those hiding out in the forest; guess what was released by our cool park rangers at Telerik today!     Yes, you got it - v2.3.0 of NativeScript is now available!   Upgrade Instructions below.

As usual; if you run into any issues I will be putting any common issues at the bottom of this post as I and others run into them....

New or Fixed Features:

  • iOS XCode 8 support for iOS 10 support - * (I've heard this might not be fixed yet)
  • Navigation memory leak squashed
  • Android Text Hint Color supported
  • Buttons now support text-decoration and text-transformation properly
  • iOS d.ts generator works properly
  • Android Extend working properly again
  • Android now properly re-throwing exceptions (better error messages)
  • Android a couple crashing corner cases fixed
  • Observables fixed (was broken in some nested situations in 2.2.0)

A Lot of other smaller bug fixes and enhancements went into place; unfortunately the really big feature for 2.2.0 & 2.3.0 has slipped again -- threads.   It was a lot bigger than they expected; I've seen progress on both Android and iOS on this front; based on the activity it should be showing up in the masters channel soon, meaning we will be able to test and play with it soon.

Upgrading:

First of all to upgrade is done is a couple steps:
> npm install -g nativescript
> npm install tns-core-modules@latest --save

For Android:
> tns platform remove android
> tns platform add android

For iOS
> tns platform remove ios
> tns platform add ios

Then you can type tns info and verify that everything says v2.3.x

Common Issues

Images and a parent that has Color set, causes the image to not show only the color that was set on iOS.   To fix you can do this a couple ways.  Remove the color on the parent.  Upgrade or disable the broken source (Line 133

image._setTintColor(newValue);

in "node_modules/tns-core-modules/ui/image/image.ios.js, comment it out.

NativeScript: Version 2.2.0 released

ns-2.2.0For those living in a dungeon hacking out code; guess what was released by those fine wizards at Telerik today!     Yes, you got it - v2.2.0 of NativeScript is now available!   Upgrade Instructions below.

As usual; if you run into any issues I will be putting any common issues at the bottom of this post as I and others run into them....

New or Fixed Features:

  • Android now properly supports some the of the Java classes that were broken in 2.1 (Major)
  • Nested Bindables
  • Letter Spacing is now all in EM Units (CSS: letter-spacing)
  • CSS supports new properties, more selectors and even pseudo selectors (Major)
  • Android Launch Screen Support
  • Observable's are now auto-nesting (this can cause a breaking changes -- see known issues below)

A Lot of other smaller bug fixes and enhancements went into place; unfortunately the really big feature for 2.2.0 has slipped -- threads.   It was bigger than a single point release could handle; I've seen progress on both Android and iOS on this front; so I have high hopes it will make it in 2.3.0...

Upgrading:

First of all to upgrade is done is a couple steps:
> npm install -g nativescript
> npm install tns-core-modules@latest --save

For Android:
> tns platform remove android
> tns platform add android

For iOS
> tns platform remove ios
> tns platform add ios

Then you can type tns info and verify that everything says v2.2.x

 

Common Issues

Nested Observables might throw an error

(iOS) TypeError: Cannot set property 'disableNotifications' of undefined
(Android) TypeError: undefined is not an object

If you have objects like

var x = new Observable({
y: new ObservableArray([])
});

This will probably throw the above error; eliminate the nesting; and make the structure like this:

var x = new Observable({
y: []
});

Github issue: https://github.com/NativeScript/NativeScript/issues/2457

x86_64 bit Emulator on iOS might crash on code that is fine.

Error:

Service exited due to signal: Segmentation fault: 11

Solution: Switch to a 32bit emulator like the iPhone 4s.

Github Issue: https://github.com/NativeScript/ios-runtime/issues/622

 

Angular 2 cssClasses Incompatibility

ORIGINAL EXCEPTION: TypeError: _this.cssClasses(...).set is not a function

You need to upgrade your NativeScript-Angular version to the latest version; the older version which worked with v2.1.0 of NativeScript is incompatible with v2.2.0. You should be able to do a

> npm install nativescipt-angular@latest --save

 

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
      AND/OR
    • tns platform remove ios
  3. Add the platform(s) you need
    • tns platform add android
      AND/OR
    • 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

Downgrading NativeScript

You might have decided to be an early adopter of the awesome new version of NativeScript release and then unfortunately do to some bug regretted that choice.   Well here is how to easily downgrade back to a version you prefer.

First of all, you normally do NOT need to downgrade the actual TNS / nativescript command, it is normally backwards compatible.  However if you do need to downgrade the command line utility you need to type:

npm remove -g nativescript

and then
npm install -g nativescript@version --- where version is the version you want.

Ok, now onto the two pieces that you should do at the same time.  So lets say you want to downgrade to the latest v1.6; you change to your apps main directory and would type:
npm install tns-core-modules@1.6.2

then type for android:
tns platform remove android
tns platform add android@1.6.3

and finally if for iOS:
tns platform remove ios
tns platform add ios@1.6.0

By doing these items, you will fully downgrade your app to a prior version of NativeScript.

Please note to get the version numbers of all the releases of a particular item; you can do:

npm info tns-android versions
npm info tns-ios versions
npm info tns-core-modules versions

You typically want the latest of a point release version, so you find the latest "z" version in the x.y.z branch you are looking to install. Please note the versions 2.0.0-YYYY-MM-DD-VVV like 2.0.0-2016-05-03-553 is a alpha/beta/test releases; all these dated versions you can safely ignore them.

NativeScript 2.0

It has been a long road since I first started with the just freshly released v0.90 slightly over a year ago.   I saw a product that was brand new, raw, full of life and it offered a huge amount of potential.   I decided that even though it wasn't nearly as popular as other recently released next generation product, ReactNative; that the underlying design of NativeScript was a much better foundation.  So, I took a chance and decided to use NativeScript for all my projects.  I am very grateful for Telerik open sourcing the entire stack, it has not only allowed me to see what geniuses the entire Telerik team is, but it has eliminated any concern of using this stack for well into future.

Now with the 2.0 release ,the future for NativeScript is even brighter.  So many new features, so many existing features honed to be even better!   This is a awesome release!

Some stats; In just the common core modules, we have had over 2,500 different commits since v0.90 by 40 different authors, of which over 1/3 of the authors are totally independent developers like me.   In addition, when I started we had maybe a handful of plugins, according the the http://plugins.nativescript.rocks/ we are up to over 150 different addons of which were made by over 45 different authors.     Not bad for a open source project no one had even heard of at the beginning of March of 2015...

The newest and biggest feature being release with version 2.0 is the Angular 2 support.  Several of my fellow compatriots, Nathan Walker & T.J. VanToll and Burke Holland have created some amazing things with Angular 2.0 and NativeScript.   If you are an Angular 2 fan, check them out.

Some of the other cool brand new features in v2.0 are;

  • CSS Z-Index & RGB w/ Alpha support, Awesome!
  • Android 6 Permission support
  • Normal component properties (like orientation) can now be set via CSS
  • CSS 3 Animations, Sweet!
  • Android Widget support
  • And several dozen additional bugs and feature were implemented.

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
  2. Remove the existing platform
    • tns platform remove android
      AND/OR
    • tns platform remove ios
  3. Add the platform(s) you need
    • tns plaform add android
      AND/OR
    • tns platform add ios
  4. Install the common core modules
    • npm install tns-core-modules@latest --save

 

 

NativeScript: Upgrading to v1.7.0

Since I have been posting these since the early versions of NativeScript; I figured I would continue. It has been several months since the last major upgrade and this version has all sorts of bug fixes and new goodies. The changelog is available at https://github.com/NativeScript/NativeScript/releases/tag/v1.7.0

The biggest new feature is the ability to override the Android Application and Activity class; this is huge news for those who needed to override a callback on either of these Java classes.     However their are lots of fixes and some things look a lot nicer.

1. npm install -g nativescript
if you now look at your nativescript --version you should have a nice v1.6.0 show up. You only have to do this one time.

2. npm install tns-core-modules@latest --save
What, that is it to install all the new core modules? WooHoo, so simple! Make sure you do this on EACH of your projects!

3. tns platform remove android AND/OR tns platform remove ios
Please note before you run the above commands if you have made ANY changes to the xcode project, plists or the Android manifest; you might want to back them up first, or you will have to manually make those changes again. Again this has to be done for EACH of your projects...

4. tns platform add android AND/OR tns platform add ios
This also needs to be done for each project. You can do a type package.json or cat package.json and you should see everything say "1.7.0"

 

Several of the android navigation issues are now fully fixed; however there is still one that is still outstanding.  That awesome NativeScript team is working on it and it will be fixed in the next week or so and then it will be released as a point release.