Closed tahir-jamil closed 4 years ago
HI @tahir-jamil , Can you provide more info about the problem and how to reproduce it? It will also help if you can send us a sample project, where the issue can be reproduced.
this is the link of github you can recreate the issue https://github.com/tahir-jamil/radlistview-6-notShowingItems hi this is the problem creating on Android
Successfully synced application org.nativescript.sassprojectlistviewtesting on device PL2GAMU841917325.
JS: HMR: Hot Module Replacement Enabled. Waiting for signal.
System.err: An uncaught Exception occurred on "main" thread.
System.err: Unable to start activity ComponentInfo{org.nativescript.sassprojectlistviewtesting/com.tns.NativeScriptActivity}: com.tns.NativeScriptException: Calling js method onCreate failed
System.err: Error: Unexpected module 'NativeScriptUIListViewModule' declared by the module 'AppModule'. Please add a @Pipe/@Directive/@Component annotation.
System.err:
System.err: StackTrace:
System.err: java.lang.RuntimeException: Unable to start activity ComponentInfo{org.nativescript.sassprojectlistviewtesting/com.tns.NativeScriptActivity}: com.tns.NativeScriptException: Calling js method onCreate failed
System.err: Error: Unexpected module 'NativeScriptUIListViewModule' declared by the module 'AppModule'. Please add a @Pipe/@Directive/@Component annotation.
System.err: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2928)
System.err: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3063)
System.err: at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
System.err: at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
System.err: at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
System.err: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1823)
System.err: at android.os.Handler.dispatchMessage(Handler.java:107)
System.err: at android.os.Looper.loop(Looper.java:198)
System.err: at android.app.ActivityThread.main(ActivityThread.java:6729)
System.err: at java.lang.reflect.Method.invoke(Native Method)
System.err: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
System.err: Caused by: com.tns.NativeScriptException: Calling js method onCreate failed
System.err: Error: Unexpected module 'NativeScriptUIListViewModule' declared by the module 'AppModule'. Please add a @Pipe/@Directive/@Component annotation.
System.err: at com.tns.Runtime.callJSMethodNative(Native Method)
System.err: at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1209)
System.err: at com.tns.Runtime.callJSMethodImpl(Runtime.java:1096)
System.err: at com.tns.Runtime.callJSMethod(Runtime.java:1083)
System.err: at com.tns.Runtime.callJSMethod(Runtime.java:1063)
System.err: at com.tns.Runtime.callJSMethod(Runtime.java:1055)
System.err: at com.tns.NativeScriptActivity.onCreate(NativeScriptActivity.java:19)
System.err: at android.app.Activity.performCreate(Activity.java:7136)
System.err: at android.app.Activity.performCreate(Activity.java:7127)
System.err: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1272)
System.err: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2908)
System.err: ... 11 more
This is the issue showing on IOS
Successfully synced application org.nativescript.sassprojectlistviewtesting on device CCDCAFC5-5BEE-45F8-A1B2-59EE03138B5A.
(RunningBoardServices) [com.apple.runningboard:connection] Identity resolved as application<org.nativescript.sassprojectlistviewtesting>
***** Fatal JavaScript exception - application has been terminated. *****
Native stack trace:
1 0x108c6671a NativeScript::reportFatalErrorBeforeShutdown(JSC::ExecState*, JSC::Exception*, bool)
2 0x108cb214c -[TNSRuntime executeModule:referredBy:]
3 0x1085af753 main
4 0x7fff516ecd29 start
5 0x1
JavaScript stack trace:
file:///node_modules/nativescript-ui-listview/ui-listview.js:544:0
at ../node_modules/nativescript-ui-listview/ui-listview.js(file:///node_modules/nativescript-ui-listview/ui-listview.js:546:1)
at __webpack_require__(file:///src/webpack/bootstrap:750:0)
at fn(file:///src/webpack/bootstrap:120:0)
at ../node_modules/nativescript-ui-listview/angular/listview-directives.js(file:///node_modules/nativescript-ui-listview/angular/listview-directives.js:5:18)
at __webpack_require__(file:///src/webpack/bootstrap:750:0)
at fn(file:///src/webpack/bootstrap:120:0)
at ./app/app.module.ts(file:///app/bundle.js:134:109)
at __webpack_require__(file:///src/webpack/bootstrap:750:0)
at fn(file:///src/webpack/bootstrap:120:0)
at file:///app/bundle.js:260:92
at ./main.ns.ts(file:///app/bundle.js:319:34)
at __webpack_require__(file:///src/webpack/bootstrap:750:0)
at checkDeferredModules(file:///src/webpack/bootstrap:43:0)
at webpackJsonpCallback(file:///src/webpack/bootstrap:30:0)
at anonymous(file:///app/bundle.js:2:61)
at evaluate([native code])
at moduleEvaluation([native code])
at promiseReactionJob([native code])
JavaScript error:
file:///node_modules/nativescript-ui-listview/ui-listview.js:544:0: JS ERROR ReferenceError: Can't find variable: TKListViewDelegate
(CoreFoundation) *** Terminating app due to uncaught exception 'NativeScript encountered a fatal error: ReferenceError: Can't find variable: TKListViewDelegate
at
file:///node_modules/nativescript-ui-listview/ui-listview.js:544:0
at ../node_modules/nativescript-ui-listview/ui-listview.js(file:///node_modules/nativescript-ui-listview/ui-listview.js:546:1)
at __webpack_require__(file:///src/webpack/bootstrap:750:0)
at fn(file:///src/webpack/bootstrap:120:0)
at ../node_modules/nativescript-ui-listview/angular/listview-directives.js(file:///node_modules/nativescript-ui-listview/angular/listview-directives.js:5:18)
at __webpack_require__(file:///src/webpack/bootstrap:750:0)
at fn(file:///src/webpack/bootstrap:120:0)
at ./app/app.module.ts(file:///app/bundle.js:134:109)
at __webpack_require__(file:///src/webpack/bootstrap:750:0)
at fn(file:///src/webpack/bootstrap:120:0)
at file:///app/bundle.js:260:92
at ./main.ns.ts(file:///app/bundle.js:319:34)
at __webpack_require__(file:///src/webpack/bootstrap:750:0)
at checkDeferredModules(file:///src/webpack/bootstrap:43:0)
at webpackJsonpCallback(file:///src/webpack/bootstrap:30:0)
at anonymous(file:///app/bundle.js:2:61)
at evaluate([native code])
at m<…>
NativeScript caught signal 6.
Native Stack:
1 0x108cb0cb1 sig_handler(int)
2 0x7fff518c5b5d _sigtramp
3 0x7fff00020008
4 0x7fff517b9a3c abort
5 0x7fff4f6d27f8 __cxa_bad_cast
6 0x7fff4f6d29c7 demangling_unexpected_handler()
7 0x7fff50864d7c _objc_terminate()
8 0x7fff4f6dfe97 std::__terminate(void (*)())
9 0x7fff4f6df8fe __cxa_get_exception_ptr
10 0x7fff4f6df8c5 __cxxabiv1::exception_cleanup_func(_Unwind_Reason_Code, _Unwind_Exception*)
11 0x7fff50864c44 _objc_exception_destructor(void*)
12 0x108c66bbf NativeScript::reportFatalErrorBeforeShutdown(JSC::ExecState*, JSC::Exception*, bool)
13 0x108cb214c -[TNSRuntime executeModule:referredBy:]
14 0x1085af753 main
15 0x7fff516ecd29 start
16 0x1
JS Stack:
if you wish i can add you in the github repo as a collaborator so you can update this to thanks in advanced @tsonevn
Hi @tahir-jamil,
Excuse me for the delay in reply.
I've checked the project and found that NativeScriptUIListViewModule
is set in the declarations' scope instead of the imports, which was causing the error. On that matter, move theNativeScriptUIListViewModule
in the imports' scope in app.module.tns.ts
and replace the RadListView
's layout from StackLayout
to GridLayout
. For example:
<GridLayout class="p-20">
<RadListView [items]="['a','b','a','b','a','b','a','b','a','b','a','b','a','b','a','b','a','b','a','b','a','b','a','b','a','b','a','b','a','b','a','b','a','b','a','b','a','b','a','b']">
<ng-template tkListItemTemplate let-item="item">
<StackLayout orientation="vertical">
<Label class="nameLabel" text="item.name"></Label>
</StackLayout>
</ng-template>
</RadListView>
</GridLayout>
Hope this helps.
thanks and sorry for the declaration issue stupid thing i guess lol
I am using nativescript angular shared repo and its default sample is not working i have create a new project using this docs
package.json