Tag Archives: Updates

NativeScript: 3.1.x released

Looks like I was asleep at the wheel; according to NPM 3.1 was released late last week; and I totally missed it.   However, I am more on the ball today and saw that 3.1.1 was released today to fix some of the issues with 3.1.    So lets cover the changes in both 3.1 & 3.11

  • Android Chrome development tools now supports the Elements tab; this allows you to see what css is assigned to elements in the UI DOM.  Very nice feature!
  • Android snapshots can be generated on Linux and Mac.  This allows you to make a custom snapshot; snapshots will improve startup time; but they do have the downside of increasing the size of the APK a lot.
  • Android now support ABI splits on first build.
  • Profiling on Android, you can now enable a profiling to see what is taking time in your application.  The feature is also available in @next on iOS.
  • CLI has been improved to fix a lot of issues, including Node 8 / npm 5 support.
  • Several fixes for the SearchBar, and TextFields now have a maxLength property!

Upgrading (Core):

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

Next try the new update command or you can manually run the commands below
> tns update

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

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

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

Common Issues:

  1. Plugins fails; this is a known issue do to the complete revamp of the lower levels of the core modules design.  Some plugins need a lot of changes to work in 3.x; so you will have to wait for the third party authors to get caught up (Even I'm not caught up).    My plugins site  http://plugins.nativescript.rocks should be listing both version v2 & v3 plugins separately so that you can easily find 3.x or 2.x plugins.
  2. TypeScript incompatibilities; you should be using 2.2 or later with v3.x of TNS
  3. A new  3.1 CSS issue with Background Color
  4. Android runtime can still crash randomly with No weak reference found. long standing unfixed bug...  Disabling screen transitions, seems to help resolve the issue.
  5. Webpack might have random issues in Android builds, you might need to to a tns platform clean android to fix occasionally
  6. Issue with upgrading applications on Android 6 & 7 see blog post on fix.

NativeScript 2.4.0 - New Features

ns-version240Some of you might have seen the all New version 2.4.0 has been released today.   This has been a release that has taken a bit of time to get right, but it is finally out!  Wooo Hoooo!!!

Some of the new features

  • NativeScript Workers
  • Per-Side borders
  • Flexbox layout
  • Android Snapshots on Release build (faster app start time)
  • Added "import" to point to the JS file
  • More pseudo selectors: button now supports: pressed, active and highlighted, and views descendants support disabled.
  • Segmented Bar now has a new css property:  selected-background-color
  • TabView now has new CSS properies: tabTextColor, tabBackgroundColor, selectedTabTextColor, and androidSelectedTabHighlightedColor
  • Some CSS properties now support % sizes:  height, width, margin-left, margin-top, margin-right, margin-bottom, margin.
  • Image Capture allows rotation.
  • Camera module now a plugin (Removes a permission)
  • Brand new Theme!
  • Reduce the size of the Android App
  • Much nicer Android crash screen
  • Faster tns prepare
  • Android has ~ 97% support for pure ES6 code.
  • Can create TypeScript typings automagically on android platform using --androidTypings command line.

Lots and lots of bug fixing in all the repo's.

Upgrading (Core):

First of all to upgrade is done is a couple steps:
> npm install -g nativescript@latest
> 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.4.x

Common Issues:

  • iOS failing to build, older projects:  v2.4 requires you to have the Info.plist file in the app_resources/ios folder.    The simplist way to fix this is to create a new project and then replace your app_resources with the new app_resources folder.  If you have any resources you have manually added or any changes to any files make sure you copy them out before you delete the old app_resources folder.  I would highly recommend you do NOT merge them as you might get some weird behavior from the old resources in the old format vs the new resources in the newer layout.
  • iOS requires CocoaPods v1.0 or later.   This is not a NativeScript issue so much as the Cocoapod infrastructure no longer allows anything older than 1.0..
  • Android failing to build with some plugins (like NativeScript-Telerik-Ui). with the error Multiple dex files define Landroid/support/v4/accessibility
  • Android failing with snapshot error, install the nativescript snapshot support via
    npm install nativescript-dev-android-snapshot@latest --save-dev
  • TNS no longer building your TypeScript files or livesync'ing any of your TS files.