ProgressNS / nativescript-ui-feedback

This repository is used for customer feedback regarding Telerik UI for NativeScript. The issues system here is used by customers who want to submit their feature requests or vote for existing ones.
Other
115 stars 21 forks source link

Android release build for Nativescript-UI not working #131

Closed RyamBaCo closed 7 years ago

RyamBaCo commented 7 years ago

Hello there,

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!

ignaciolarranaga commented 7 years ago

+1

Attaching my stack trace in case it get useful:

03-19 21:45:48.785: E/AndroidRuntime(15396):    Frame: function:'LayoutBase._eachChildView', file:'file:///data/data/com.hezea.ForSaleByOwnerLite/files/app/tns_modules/tns-core-modules/ui/layouts/layout-base-common.js', line: 144, column: 22
03-19 21:45:48.785: E/AndroidRuntime(15396):    Frame: function:'View._onAttached',
03-19 21:45:48.787: D/Error(15396): ERR: exClass=java.lang.NoClassDefFoundError
03-19 21:45:48.787: D/Error(15396): ERR: exMsg=com.telerik.widget.list.RadListView
03-19 21:45:48.787: D/Error(15396): ERR: file=Class.java
03-19 21:45:48.787: D/Error(15396): ERR: class=java.lang.Class
03-19 21:45:48.788: D/Error(15396): ERR: method=classForName line=-2
03-19 21:45:48.788: D/Error(15396): ERR: stack=com.tns.NativeScriptException: 
03-19 21:45:48.788: D/Error(15396): Calling js method onCreateView failed
03-19 21:45:48.788: D/Error(15396): Error: java.lang.NoClassDefFoundError: com.telerik.widget.list.RadListView
03-19 21:45:48.788: D/Error(15396):     java.lang.Class.classForName(Native Method)
03-19 21:45:48.788: D/Error(15396):     java.lang.Class.forName(Class.java:324)
03-19 21:45:48.788: D/Error(15396):     java.lang.Class.forName(Class.java:285)
03-19 21:45:48.788: D/Error(15396):     com.tns.Runtime.getClassForName(Runtime.java:1107)
03-19 21:45:48.788: D/Error(15396):     com.tns.ClassResolver.resolveClass(ClassResolver.java:57)
03-19 21:45:48.788: D/Error(15396):     com.tns.Runtime.resolveClass(Runtime.java:649)
03-19 21:45:48.788: D/Error(15396):     com.tns.Runtime.callJSMethodNative(Native Method)
03-19 21:45:48.788: D/Error(15396):     com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1197)
03-19 21:45:48.788: D/Error(15396):     com.tns.Runtime.callJSMethodImpl(Runtime.java:1061)
03-19 21:45:48.788: D/Error(15396):     com.tns.Runtime.callJSMethod(Runtime.java:1047)
03-19 21:45:48.788: D/Error(15396):     com.tns.Runtime.callJSMethod(Runtime.java:1028)
03-19 21:45:48.788: D/Error(15396):     com.tns.Runtime.callJSMethod(Runtime.java:1018)
03-19 21:45:48.788: D/Error(15396):     com.tns.FragmentClass.onCreateView(android.app.Fragment.java)
03-19 21:45:48.788: D/Error(15396):     android.app.Fragment.performCreateView(Fragment.java:2236)
03-19 21:45:48.788: D/Error(15396):     android.app.FragmentManagerImpl.moveToState(FragmentManager.java:978)
03-19 21:45:48.788: D/Error(15396):     android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1153)
03-19 21:45:48.788: D/Error(15396):     android.app.BackStackRecord.popFromBackStack(BackStackRecord.java:1677)
03-19 21:45:48.788: D/Error(15396):     android.app.FragmentManagerImpl.popBackStackState(FragmentManager.java:1666)
03-19 21:45:48.788: D/Error(15396):     android.app.FragmentManagerImpl$3.run(FragmentManager.java:590)
03-19 21:45:48.788: D/Error(15396):     android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1562)
03-19 21:45:48.788: D/Error(15396):     android.app.FragmentManagerImpl$1.run(FragmentManager.java:487)
03-19 21:45:48.788: D/Error(15396):     android.os.Handler.handleCallback(Handler.java:815)
03-19 21:45:48.788: D/Error(15396):     android.os.Handler.dispatchMessage(Handler.java:104)
03-19 21:45:48.788: D/Error(15396):     android.os.Looper.loop(Looper.java:207)
03-19 21:45:48.788: D/Error(15396):     android.app.ActivityThread.main(ActivityThread.java:5728)
03-19 21:45:48.788: D/Error(15396):     java.lang.reflect.Method.invoke(Native Method)
03-19 21:45:48.788: D/Error(15396):     com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
03-19 21:45:48.788: D/Error(15396):     com.android.internal.os.ZygoteInit.main(ZygoteInit.java:679)
03-19 21:45:48.788: D/Error(15396): File: "file:///data/data/com.hezea.ForSaleByOwnerLite/files/app/tns_modules/nativescript-telerik-ui/listview/listview.js, line: 168, column: 24
03-19 21:45:48.788: D/Error(15396): StackTrace: 
03-19 21:45:48.788: D/Error(15396):     Frame: function:'RadListView._createUI', file:'file:///data/data/com.hezea.ForSaleByOwnerLite/files/app/tns_modules/nativescript-telerik-ui/listview/listview.js', line: 168, column: 25
03-19 21:45:48.788: D/Error(15396):     Frame: function:'View._onContextChanged', file:'file:///data/data/com.hezea.ForSaleByOwnerLite/files/app/tns_modules/tns-core-modules/ui/core/view.js', line: 202, column: 14
03-19 21:45:48.788: D/Error(15396):     Frame: function:'View._onAttached', file:'file:///data/data/com.hezea.ForSaleByOwnerLite/files/app/tns_modules/tns-core-modules/ui/core/view.js', line: 153, column: 14
03-19 21:45:48.788: D/Error(15396):     Frame: function:'eachChild', file:'file:///data/data/com.hezea.ForSaleByOwnerLite/files/app/tns_modules/tns-core-modules/ui/core/view.js', line: 158, column: 23
03-19 21:45:48.788: D/Error(15396):     Frame: function:'LayoutBase._eachChildView', file:'file:///data/data/com.hezea.ForSaleByOwnerLite/files/app/tns_modules/tns-core-modules/ui/layouts/layout-base-common.js', line: 144, column: 22
03-19 21:45:48.788: D/Error(15396):     Frame: function:'View._onAttached', file:'file:///data/data/com.hezea.ForSaleByOwnerLite/files/app/tns_modules/tns-core-modules/ui/core/view.js', line: 165, column: 18
03-19 21:45:48.788: D/Error(15396):     Frame: function:'eachChild', file:'file:///data/data/com.hezea.ForSaleByOwnerLite/files/app/tns_modules/tns-core-modules/ui/core/view.js', line: 158, column: 23
03-19 21:45:48.788: D/Error(15396):     Frame: function:'LayoutBase._eachChildView', file:'file:///data/data/com.hezea.ForSaleByOwnerLite/files/app/tns_modules/tns-core-modules/ui/layouts/layout-base-common.js', line: 144, column: 22
03-19 21:45:48.788: D/Error(15396):     Frame: function:'View._onAttached', file:'file:///data/data/com.hezea.ForSaleByOwnerLite/files/app/tns_modules/tns-core-modules/ui/core/view.js', line: 165, column: 18
03-19 21:45:48.788: D/Error(15396):     Frame: function:'eachChild', file:'file:///data/data/com.hezea.ForSaleByOwnerLite/files/app/tns_modules/tns-core-modules/ui/core/view.js', line: 158, column: 23
03-19 21:45:48.788: D/Error(15396):     Frame: function:'LayoutBase._eachChildView', file:'file:///data/data/com.hezea.ForSaleByOwnerLite/files/app/tns_modules/tns-core-modules/ui/layouts/layout-base-common.js', line: 144, column: 22
03-19 21:45:48.788: D/Error(15396):     Frame: function:'View._onAttached', file:'file:///data/data/com.hezea.ForSaleByOwnerLite/files/app/tns_mo
wenhsiaoyi commented 7 years ago

+1 Merged dex #50 (1 defs/1.4KiB) Merged dex #51 (2243 defs/3738.4KiB) Result is 2293 defs/2808.0KiB. Took 0.2s :buildMetadata 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

com.tns.NativeScriptException: Calling js method onCreateView failed Error: java.lang.NoClassDefFoundError: com.telerik.widget.list.RadListView java.lang.Class.classForName(Native Method) java.lang.Class.forName(Class.java:324) java.lang.Class.forName(Class.java:285) com.tns.Runtime.getClassForName(Runtime.java:1107) com.tns.ClassResolver.resolveClass(ClassResolver.java:57) com.tns.Runtime.resolveClass(Runtime.java:649) com.tns.Runtime.callJSMethodNative(Native Method) com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1197) com.tns.Runtime.callJSMethodImpl(Runtime.java:1061) com.tns.Runtime.callJSMethod(Runtime.java:1047) com.tns.Runtime.callJSMethod(Runtime.java:1028) com.tns.Runtime.callJSMethod(Runtime.java:1018) com.tns.FragmentClass.onCreateView(android.app.Fragment.java) android.app.Fragment.performCreateView(Fragment.java:2220) android.app.FragmentManagerImpl.moveToState(FragmentManager.java:973) android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1148) android.app.BackStackRecord.run(BackStackRecord.java:793) android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1535) android.app.FragmentManagerImpl$1.run(FragmentManager.java:482) android.os.Handler.handleCallback(Handler.java:739) android.os.Handler.dispatchMessage(Handler.java:95) android.os.Looper.loop(Looper.java:168) android.app.ActivityThread.main(ActivityThread.java:5845) java.lang.reflect.Method.invoke(Native Method) com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:797) com.android.internal.os.ZygoteInit.main(ZygoteInit.java:687) File: "file:///data/data/tw.com.umaker.app.ss3c.dashboard/files/app/tns_modules/nativescript-telerik-ui/listview/listview.js, line: 168, column: 24 StackTrace: Frame: function:'RadListView._createUI', file:'file:///data/data/tw.com.umaker.app.ss3c.dashboard/files/app/tns_modules/nativescript-telerik-ui/listview/listview.js', line: 168, column: 25 Frame: function:'View._onContextChanged', file:'file:///data/data/tw.com.umaker.app.ss3c.dashboard/files/app/tns_modules/tns-core-modules/ui/core/view.js', line: 202, column: 14 Frame: function:'View._onAttached', file:'file:///data/data/tw.com.umaker.app.ss3c.dashboard/files/app/tns_modules/tns-core-modules/ui/core/view.js', line: 153, column: 14 Frame: function:'eachChild', file:'file:///data/data/tw.com.umaker.app.ss3c.dashboard/files/app/tns_modules/tns-core-modules/ui/core/view.js', line: 158, column: 23 Frame: function:'LayoutBase._eachChildView', file:'file:///data/data/tw.com.umaker.app.ss3c.dashboard/files/app/tns_modules/tns-core-modules/ui/layouts/layout-base-common.js', line: 144, column: 22 Frame: function:'View._onAttached', file:'file:///data/data/tw.com.umaker.app.ss3c.dashboard/files/app/tns_modules/tns-core-modules/ui/core/view.js', line: 165, column: 18 Frame: function:'eachChild', file:'file:///data/data/tw.com.umaker.app.ss3c.dashboard/files/app/tns_modules/tns-core-modules/ui/core/view.js', line: 158, column: 23 Frame: function:'ContentView._eachChildView', file:'file:///data/data/tw.com.umaker.app.ss3c.dashboard/files/app/tns_modules/tns-core-modules/ui/content-view/content-view.js', line: 65, column: 13 Frame: function:'View._onAttached', file:'file:///data/data/tw.com.umaker.app.ss3c.dashboard/files/app/tns_modules/tns-core-modules/ui/core/view.js', line: 165, column: 18 Frame: function:'eachChild', file:'file:///data/data/tw.com.umaker.app.ss3c.dashboard/files/app/tns_modules/tns-core-modules/ui/core/view.js', line: 158, column: 23 Frame: function:'ContentView._eachChildView', file:'file:///data/data/tw.com.umaker.app.ss3c.dashboard/files/app/tns_modules/tns-core-modules/ui/content-view/content-view.js', line: 65, column: 13 Frame: function:'Page._eachChildView', file:'file:///data/data/tw.com.umaker.app.ss3c.dashboard/files/app/tns_modules/tns-core-modules/ui/page/page-common.js', line: 317, column: 41 Frame: function:'View._onAttached', file:'file:///data/data/tw.com.umaker.app.ss3c.dashboard/files/app/tns_modules/tns-core-modules/ui/core/view.js', line: 165, column: 18 Frame: function:'View._addViewCore', file:'file:///data/data/tw.com.umaker.app.ss3c.dashboard/files/app/tns_modules/tns-core-modules/ui/core/view.js', line: 126, column: 18 Frame: function:'View._addView', file:'file:///data/data/tw.com.umaker.app.ss3c.dashboard/files/app/tns_modules/tns-core-modules/ui/core/view-common.js', line: 1163, column: 14 Frame: function:'onFragmentShown', file:'file:///data/data/tw.com.umaker.app.ss3c.dashboard/files/app/tns_modules/tns-core-modules/ui/frame/frame.js', line: 40, column: 11 Frame: function:'FragmentCallbacksImplementation.onCreateView', file:'file:///data/data/tw.com.umaker.app.ss3c.dashboard/files/app/tns_modules/tns-core-modules/ui/frame/frame.js', line: 612, column: 13 Frame: function:'FragmentClass.onCreateView', file:'file:///data/data/tw.com.umaker.app.ss3c.dashboard/files/app/tns_modules/tns-core-modules/ui/frame/fragment.js', line: 23, column: 38 at com.tns.Runtime.callJSMethodNative(Native Method) at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1197) at com.tns.Runtime.callJSMethodImpl(Runtime.java:1061) at com.tns.Runtime.callJSMethod(Runtime.java:1047) at com.tns.Runtime.callJSMethod(Runtime.java:1028) at com.tns.Runtime.callJSMethod(Runtime.java:1018) at com.tns.FragmentClass.onCreateView(android.app.Fragment.java) at android.app.Fragment.performCreateView(Fragment.java:2220) at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:973) at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1148) at android.app.BackStackRecord.run(BackStackRecord.java:793) at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1535) at android.app.FragmentManagerImpl$1.run(FragmentManager.java:482) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:168) at android.app.ActivityThread.main(ActivityThread.java:5845) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:797) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:687) Caused by: java.lang.NoClassDefFoundError: com.telerik.widget.list.RadListView at java.lang.Class.classForName(Native Method) at java.lang.Class.forName(Class.java:324) at java.lang.Class.forName(Class.java:285) at com.tns.Runtime.getClassForName(Runtime.java:1107) at com.tns.ClassResolver.resolveClass(ClassResolver.java:57) at com.tns.Runtime.resolveClass(Runtime.java:649) ... 20 more

wenhsiaoyi commented 7 years ago

replace lv:RadListView with ListView in XML template use Android ListView And, wait this issue resolve.

RyamBaCo commented 7 years ago

Thanks for your hint but that's not a solution for me as I'm using RadListView-specific features.

ginev commented 7 years ago

@RyamBaCo can you please share information which Android API levels you have installed on your machine?

RyamBaCo commented 7 years ago

@ginev I have the Android SDK Platform for Android 7.1.1 and Android 6.0, the SDK Platform-Tools 25.0.0, the Android SDK Tools 25.2.2 and the Android Support Library 23.2.1 installed on my Linux machine. On my Mac there is Android SDK Tools 25.2.5, Android SDK Platform-tools 25.0.3 and Android SDK Build-tools 23.0.3 and Android SDK Platform for Android 6.0 installed. I'm facing the same issue with both machines :(

ginev commented 7 years ago

@RyamBaCo, we're working on addressing this issue. The fix will be available for the upcoming release due to a couple of weeks.

RyamBaCo commented 7 years ago

Alright, thanks for your response. I figured out that when I uncomment the recyclerview-v7 dependency in my gradle file the release build works. Dunno if it's best practice to do so but at least I have a first release build now which I can submit to the store!

ginev commented 7 years ago

@RyamBaCo you must not comment this out as RadListView depends on it.

ignaciolarranaga commented 7 years ago

@RyamBaCo just to comment, I was able to build, and execute but broken once downloaded from the store (that was the stack trace I sent). Just commenting to keep an eye on the store version it might differ from the emulator/usb execution.

RyamBaCo commented 7 years ago

Okay, discovered that the recyclerview-v7 dependency needs to be part of the gradle file. Initially it was commented out, but when I activated, it it began to work. Should be something that should in my opinion be more present in the readme and docs of the NativeScript UI!

Anyway, thanks for your help!

ginev commented 7 years ago

We've just uploaded a new version (1.6.2) of the Free plugin which addresses this problem.