Android release build for Nativescript-UI not working


#1

Hey there,

already posted it in the github issues of the telerik-feedback branch, but will repost it here in the hope to get more responses/ideas on how to solve these issues:

I have a NativeScript-App using the free nativescript-ui-modules. In Debug-Mode everything is working fine, but when I try to build a release build the App crashes the first time it tries to access a RadListView.

During the release build I got the following errors:

Skip com.telerik.widget.list.DeckOfCardsLayoutManager
	Error: java.lang.NullPointerException
Skip com.telerik.widget.list.FadeItemAnimator
	Error: java.lang.NullPointerException
Skip com.telerik.widget.list.ItemAnimatorSet
	Error: java.lang.NullPointerException
Skip com.telerik.widget.list.ListViewItemAnimator
	Error: java.lang.NullPointerException
Skip com.telerik.widget.list.ListViewItemAnimator$ChangeInfo
	Error: java.lang.NullPointerException
Skip com.telerik.widget.list.ListViewItemAnimator$MoveInfo
	Error: java.lang.NullPointerException
Skip com.telerik.widget.list.RadListView
	Error: java.lang.NullPointerException
Skip com.telerik.widget.list.ScaleItemAnimator
	Error: java.lang.NullPointerException
Skip com.telerik.widget.list.SlideItemAnimator
	Error: java.lang.NullPointerException
Skip com.telerik.widget.list.SlideLayoutManagerBase
	Error: java.lang.NullPointerException
Skip com.telerik.widget.list.WrapLayoutManager
	Error: java.lang.NullPointerException

During execution on my Android device logcat delivers me the following error:

Error: java.lang.NoClassDefFoundError: com.telerik.widget.list.RadListView

I import the ListView and the SideDrawer-component as Angular-Directives and also tried the steps listed in https://github.com/NativeScript/NativeScript/issues/3257 but with no luck. It appears to me that parts of the nativescript-ui are not extracted correctly into my release apk.

I’m using the latest 2.5.2 build of the NativeScript-CLI tools and my package.json looks as following:

{
  "description": "NativeScript Application",
  "license": "SEE LICENSE IN <your-license-filename>",
  "readme": "NativeScript Application",
  "repository": "<fill-your-repository-here>",
  "nativescript": {
    "id": "at.alphaport.DSApp",
    "tns-android": {
      "version": "2.5.0"
    },
    "tns-ios": {
      "version": "2.5.0"
    }
  },
  "dependencies": {
    "@angular/common": "2.4.6",
    "@angular/compiler": "2.4.6",
    "@angular/core": "2.4.6",
    "@angular/forms": "2.4.6",
    "@angular/http": "2.4.6",
    "@angular/platform-browser": "2.4.6",
    "@angular/platform-browser-dynamic": "2.4.6",
    "@angular/router": "3.4.6",
    "nativescript-angular": "^1.4.0",
    "nativescript-background-http": "^2.4.2",
    "nativescript-camera": "0.0.8",
    "nativescript-imagepicker": "^2.5.1",
    "nativescript-orientation": "^1.5.5",
    "nativescript-permissions": "^1.2.3",
    "nativescript-telerik-ui": "^1.6.1",
    "nativescript-theme-core": "^1.0.2",
    "nativescript-toasts": "^1.0.3",
    "ng2-translate": "^5.0.0",
    "reflect-metadata": "~0.1.8",
    "rxjs": "5.0.3",
    "tns-core-modules": "^2.5.1"
  },
  "devDependencies": {
    "babel-traverse": "6.22.1",
    "babel-types": "6.22.0",
    "babylon": "6.15.0",
    "lazy": "1.0.11",
    "nativescript-dev-typescript": "^0.3.2",
    "typescript": "~2.0.10",
    "zone.js": "~0.7.2"
  }
}

Any hints would be greatly appreciated!


#2

I had a similar issue with it working in an emulator but would not on my phone. My issue was fixed in the latest release: nativescript-telerik-ui 1.6.2

https://www.npmjs.com/package/nativescript-telerik-ui

Give that version a whirl.

Randy