radlistview is not working on nativescript 6.3.0 - nativescript

In my previous times i have worked on some projects on nativescript. but Now, it got updated and i don't know why my rad-list-view is not working.
<Page xmlns="http://schemas.nativescript.org/tns.xsd"
xmlns:lv="nativescript-ui-listview" navigatingTo="onNavigatingTo" class="page">
...
...
<lv:RadListView row="1" items="{{ source }}">
<lv:RadListView.itemTemplate>
<GridLayout rows="*" columns="*">
<Label text="{{ name }}" textWrap="true" />
</GridLayout>
</lv:RadListView.itemTemplate>
</lv:RadListView>
...
...
source: [{
name: "Test",
}, {
name: "Test",
}, {
name: "Test",
}, {
name: "Test",
}, {
name: "Test",
}, {
name: "Test",
}, {
name: "Test",
}, {
name: "Test",
}, {
name: "Test",
}],
error:-
System.err: An uncaught Exception occurred on "main" thread.
System.err: Calling js method onCreateViewHolder failed
System.err: TypeError: Cannot read property 'parse' of undefined
System.err:
System.err: StackTrace:
System.err: Frame: function:'push.../node_modules/nativescript-ui-listview/ui-listview.common.js.RadListView.resolveTemplateView', file:'file:///node_modules\nativescript-ui-listview\ui-listview.common.js:532:0
System.err: Frame: function:'push.../node_modules/nativescript-ui-listview/ui-listview.common.js.RadListView.getViewForViewType', file:'file:///node_modules\nativescript-ui-listview\ui-listview.common.js:579:0
System.err: Frame: function:'ListViewAdapter.onCreateViewHolder', file:'file:///node_modules\nativescript-ui-listview\ui-listview.js:129:0
System.err: at com.tns.Runtime.callJSMethodNative(Native Method)
System.err: at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1242)
System.err: at com.tns.Runtime.callJSMethodImpl(Runtime.java:1122)
System.err: at com.tns.Runtime.callJSMethod(Runtime.java:1109)
System.err: at com.tns.Runtime.callJSMethod(Runtime.java:1089)
System.err: at com.tns.Runtime.callJSMethod(Runtime.java:1081)
System.err: at com.telerik.widget.list.ListViewAdapter_vendor_1544_32_ListViewAdapter.onCreateViewHolder(Unknown Source:27)System.err: at com.telerik.widget.list.ListViewWrapperAdapter.onCreateViewHolder(ListViewWrapperAdapter.java:468)
System.err: at com.telerik.widget.list.ListViewWrapperAdapter.onCreateViewHolder(ListViewWrapperAdapter.java:20)
System.err: at androidx.recyclerview.widget.RecyclerView$Adapter.createViewHolder(RecyclerView.java:6794)
System.err: at androidx.recyclerview.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:5975)
System.err: at androidx.recyclerview.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5858)
System.err: at androidx.recyclerview.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5854)
System.err: at androidx.recyclerview.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:2230)
System.err: at androidx.recyclerview.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1557)
System.err: at androidx.recyclerview.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1517)
System.err: at androidx.recyclerview.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:612)
System.err: at androidx.recyclerview.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:3924)
System.err: at androidx.recyclerview.widget.RecyclerView.dispatchLayout(RecyclerView.java:3641)
System.err: at androidx.recyclerview.widget.RecyclerView.onLayout(RecyclerView.java:4194)
System.err: at com.telerik.widget.list.RadListView.onLayout(RadListView.java:600)
System.err: at android.view.View.layout(View.java:20871)
System.err: at android.view.ViewGroup.layout(ViewGroup.java:6268)
System.err: at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
System.err: at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
System.err: at android.view.View.layout(View.java:20871)
System.err: at android.view.ViewGroup.layout(ViewGroup.java:6268)
System.err: at org.nativescript.widgets.CommonLayoutParams.layoutChild(CommonLayoutParams.java:222)
System.err: at org.nativescript.widgets.GridLayout.onLayout(GridLayout.java:354)
System.err: at android.view.View.layout(View.java:20871)
System.err: at android.view.ViewGroup.layout(ViewGroup.java:6268)
System.err: at org.nativescript.widgets.CommonLayoutParams.layoutChild(CommonLayoutParams.java:222)
System.err: at org.nativescript.widgets.GridLayout.onLayout(GridLayout.java:354)
System.err: at android.view.View.layout(View.java:20871)
System.err: at android.view.ViewGroup.layout(ViewGroup.java:6268)
System.err: at org.nativescript.widgets.CommonLayoutParams.layoutChild(CommonLayoutParams.java:222)
System.err: at org.nativescript.widgets.ContentLayout.onLayout(ContentLayout.java:73)
System.err: at android.view.View.layout(View.java:20871)
System.err: at android.view.ViewGroup.layout(ViewGroup.java:6268)
System.err: at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
System.err: at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
System.err: at android.view.View.layout(View.java:20871)
System.err: at android.view.ViewGroup.layout(ViewGroup.java:6268)
System.err: at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1812)
System.err: at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1656)
System.err: at android.widget.LinearLayout.onLayout(LinearLayout.java:1565)
System.err: at android.view.View.layout(View.java:20871)
System.err: at android.view.ViewGroup.layout(ViewGroup.java:6268)
System.err: at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
System.err: at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
System.err: at android.view.View.layout(View.java:20871)
System.err: at android.view.ViewGroup.layout(ViewGroup.java:6268)
System.err: at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1812)
System.err: at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1656)
System.err: at android.widget.LinearLayout.onLayout(LinearLayout.java:1565)
System.err: at android.view.View.layout(View.java:20871)
System.err: at android.view.ViewGroup.layout(ViewGroup.java:6268)
System.err: at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
System.err: at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
System.err: at com.android.internal.policy.DecorView.onLayout(DecorView.java:758)
System.err: at android.view.View.layout(View.java:20871)
System.err: at android.view.ViewGroup.layout(ViewGroup.java:6268)
System.err: at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2942)
System.err: at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2457)
System.err: at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1553)
System.err: at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7569)
System.err: at android.view.Choreographer$CallbackRecord.run(Choreographer.java:958)
System.err: at android.view.Choreographer.doCallbacks(Choreographer.java:770)
System.err: at android.view.Choreographer.doFrame(Choreographer.java:702)
System.err: at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:944)
System.err: at android.os.Handler.handleCallback(Handler.java:873)
System.err: at android.os.Handler.dispatchMessage(Handler.java:99)
System.err: at android.os.Looper.loop(Looper.java:201)
System.err: at android.app.ActivityThread.main(ActivityThread.java:6831)
System.err: at java.lang.reflect.Method.invoke(Native Method)
System.err: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:927)
Atleast before webpack I'm able to get on which line of code the error was. but here I'm not even understanding the error. How to resolve this issue. and how to identify the error in vendor.js which always gives some android code exceptions which is out of scope of cross platform technology as i came here to work with js not with some android code. And i expect only js error which i wrote.

ok, i made a mistake that after creating project i run the command
npm install -g nativescript
so nativescript version was 6.3.0 whereas i didn't updated platforms and tns-core-modules
So, i deleted the project and created new one. Then it created matching version of platforms and tns-core-modules and problem solved
or else we can delete platforms and tns-core-modules and create new one by
tns platform remove android
tns platform add android
npm install tns-core-modules#latest --save

Related

Pressing back in a nested view throws the error "The specified child already has a parent."

I have nested views set up with BottomNavigation whereby users may navigate to one of the details "page" from a ListView. I have tried Manual Routing as well as Vue Navigator
Here is the layout of my app.
<!--Main.vue-->
<Page>
<BottomNavigation>
<TabStrip class="bottom-navigation">
...
</TabStrip>
<TabContentItem>
<Frame>
<Dashboard />
</Frame>
</TabContentItem>
<TabContentItem>
<Frame>
<Finance />
</Frame>
</TabContentItem>
<TabContentItem>
<Frame>
<Profile />
</Frame>
</TabContentItem>
</BottomNavigation>
</Page>
<!--Finance.vue-->
<Page>
<Tabs>
<TabStrip class="tab-strip">
...
</TabStrip>
<TabContentItem>
<ListView
for="item in items"
#itemTap="$navigateTo(detailPage)"
class="list-group"
height="100%"
>
...
</ListView>
</TabContentItem>
<TabContentItem>
...
</TabContentItem>
</Tabs>
</Page>
<!--ItemDetails.vue-->
<Page>
<ActionBar class="action-bar">
<NavigationButton #tap="$navigateBack" android.systemIcon="ic_menu_back"/>
<Label class="action-bar-title" :text="item.name"></Label>
</ActionBar>
<GridLayout>
...
</GridLayout>
</Page>
Here's the error that appears on pressing the back button of the details page.
System.err: An uncaught Exception occurred on "main" thread.
System.err: The specified child already has a parent. You must call removeView() on the child's parent first.
System.err:
System.err: StackTrace:
System.err: java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.
System.err: at android.view.ViewGroup.addViewInner(ViewGroup.java:5042)
System.err: at android.view.ViewGroup.addView(ViewGroup.java:4873)
System.err: at android.view.ViewGroup.addView(ViewGroup.java:4813)
System.err: at android.view.ViewGroup.addView(ViewGroup.java:4786)
System.err: at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:887)
System.err: at androidx.fragment.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManagerImpl.java:1238)
System.err: at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:1303)
System.err: at androidx.fragment.app.FragmentManagerImpl.dispatchStateChange(FragmentManagerImpl.java:2659)
System.err: at androidx.fragment.app.FragmentManagerImpl.dispatchActivityCreated(FragmentManagerImpl.java:2613)
System.err: at androidx.fragment.app.Fragment.performActivityCreated(Fragment.java:2624)
System.err: at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:904)
System.err: at androidx.fragment.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManagerImpl.java:1238)
System.err: at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:1303)
System.err: at androidx.fragment.app.BackStackRecord.executeOps(BackStackRecord.java:439)
System.err: at androidx.fragment.app.FragmentManagerImpl.executeOps(FragmentManagerImpl.java:2079)
System.err: at androidx.fragment.app.FragmentManagerImpl.executeOpsTogether(FragmentManagerImpl.java:1869)
System.err: at androidx.fragment.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManagerImpl.java:1824)
System.err: at androidx.fragment.app.FragmentManagerImpl.execPendingActions(FragmentManagerImpl.java:1727)
System.err: at androidx.fragment.app.FragmentManagerImpl$2.run(FragmentManagerImpl.java:150)
System.err: at android.os.Handler.handleCallback(Handler.java:874)
System.err: at android.os.Handler.dispatchMessage(Handler.java:100)
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)
App crashes and I am unable to figure out what could be causing the error. Please help.
Try updating the core modules to the latest version, it was fixed in 6.1or 6.2

Listview throwing error when using if in v-template

If I try to create conditions in my v-template like if="transaction.id == 604" I get the following error:
>System.err: Calling js method getView failed
System.err:
System.err: TypeError: Cannot read property 'scopedFn' of undefined
If I set it to if="transaction.id" it works fine. transaction.id exists and it has a value of 604.
<ListView for="transaction in transactions" itemTap="onItemTap" height="80%" >
<v-template if="transaction.id">
<StackLayout>
<Label :text="transaction.id" className="placeName" />
<Label :text="transaction.amounttxt" className="placeName" />
<Label :text="transaction.insight_text" className="placeName" />
</StackLayout>
</v-template>
</ListView>
You have only one template with an if condition. There is no fallback template when the if condition fails. There should at least one template without if so it can be used when all your if conditions on other templates fail. Or at least one of you if should pass.
If you want to ignore any list item from being rendered, you should filter the array (transactions) itself.

Xamarin Android Background Location Service null

I used this demo to use background location services for my Android project (since Geolocator wouldn't background on Android). I haven't had any problems until yesterday when it gave me the following error:
[ServiceConnection] OnServiceConnected Called
Service Connected
[LocationService] You are about to get location updates via
[Mono] Assembly Ref addref Mono.Security[0xa7dd6ba0] -> System[0xadd5aac0]: 15
[Mono] DllImport attempting to load: '/system/lib/liblog.so'.
[Mono] DllImport loaded library '/system/lib/liblog.so'.
[Mono] DllImport searching in: '/system/lib/liblog.so' ('/system/lib/liblog.so').
[Mono] Searching for '__android_log_print'.
[Mono] Probing '__android_log_print'.
[Mono] Found as '__android_log_print'.
[MonoDroid] UNHANDLED EXCEPTION:
[MonoDroid] Java.Lang.IllegalArgumentException: invalid provider: null
[MonoDroid] at Java.Interop.JniEnvironment+InstanceMethods.CallVoidMethod (Java.Interop.JniObjectReference instance, Java.Interop.JniMethodInfo method, Java.Interop.JniArgumentValue* args) [0x00069] in <ab9e0fea7db841c1a1450c120052eb14>:0
[MonoDroid] at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeVirtualVoidMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x0002a] in <ab9e0fea7db841c1a1450c120052eb14>:0
[MonoDroid] at Android.Locations.LocationManager.RequestLocationUpdates (System.String provider, System.Int64 minTime, System.Single minDistance, Android.Locations.ILocationListener listener) [0x0007e] in <21f1b0b5ad7242d7afaeceae3e6dbac8>:0
[MonoDroid] at Divco.LocationService.StartLocationUpdates () [0x0003c] in /Users/ediewoelfle/Developer/ancient-bastion-mobile/Droid/Services/LocationService.cs:78
[MonoDroid] at Divco.LocationServiceConnection.OnServiceConnected (Android.Content.ComponentName name, Android.OS.IBinder service) [0x0004f] in /Users/ediewoelfle/Developer/ancient-bastion-mobile/Droid/Services/LocationServiceConnection.cs:42
[MonoDroid] at Android.Content.IServiceConnectionInvoker.n_OnServiceConnected_Landroid_content_ComponentName_Landroid_os_IBinder_ (System.IntPtr jnienv, System.IntPtr native__this, System.IntPtr native_name, System.IntPtr native_service) [0x00019] in <21f1b0b5ad7242d7afaeceae3e6dbac8>:0
[MonoDroid] at (wrapper dynamic-method) System.Object.31(intptr,intptr,intptr,intptr)
[MonoDroid] --- End of managed Java.Lang.IllegalArgumentException stack trace ---
[MonoDroid] java.lang.IllegalArgumentException: invalid provider: null
[MonoDroid] at android.location.LocationManager.checkProvider(LocationManager.java:2317)
[MonoDroid] at android.location.LocationManager.requestLocationUpdates(LocationManager.java:490)
[MonoDroid] at md587a0a65fe57ffee4ef3988209babfc12.LocationServiceConnection.n_onServiceConnected(Native Method)
[MonoDroid] at md587a0a65fe57ffee4ef3988209babfc12.LocationServiceConnection.onServiceConnected(LocationServiceConnection.java:38)
[MonoDroid] at android.app.LoadedApk$ServiceDispatcher.doConnected(LoadedApk.java:1535)
[MonoDroid] at android.app.LoadedApk$ServiceDispatcher$RunConnection.run(LoadedApk.java:1563)
[MonoDroid] at android.os.Handler.handleCallback(Handler.java:751)
[MonoDroid] at android.os.Handler.dispatchMessage(Handler.java:95)
[MonoDroid] at android.os.Looper.loop(Looper.java:154)
[MonoDroid] at android.app.ActivityThread.main(ActivityThread.java:6316)
[MonoDroid] at java.lang.reflect.Method.invoke(Native Method)
[MonoDroid] at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:872)
[MonoDroid] at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:762)
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="42" android:versionName="0.1" package="com.divcodelivery.divco">
<uses-sdk android:minSdkVersion="23" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.SEND_SMS" />
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
<uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_SURFACE_FLINGER" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<application android:label="Divco" android:icon="#drawable/logo_size_icon">
<provider android:name="android.support.v4.content.FileProvider" android:authorities="com.divcodelivery.divco.fileprovider" android:exported="false" android:grantUriPermissions="true">
<meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="#xml/file_paths"></meta-data>
</provider>
</application>
</manifest>
I have located the null locationProvider, however, I am unsure WHY.

System.err: TypeError: Cannot read property 'onNavigatingTo' of undefined

My nativescript application runs successfully in first run without any error, but when I save any file without any change, or small changes my app crashes whith below information.
08-24 13:32:36.684 3595 3595 E AndroidRuntime: at com.tns.Runtime.callJSMethodNative(Native Method) 08-24 13:32:36.684 3595 3595 E AndroidRuntime: at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1116) 08-24 13:32:36.684 3595 3595 E AndroidRuntime:
at com.tns.Runtime.callJSMethodImpl(Runtime.java:996) 08-24 13:32:36.684 3595 3595 E AndroidRuntime: at com.tns.Runtime.callJSMethod(Runtime.java:983) 08-24 13:32:36.684 3595 3595 E AndroidRuntime: at com.tns.Runtime.callJSMethod(Runtime.java:967) 08-24
13:32:36.684 3595 3595 E AndroidRuntime: at com.tns.Runtime.callJSMethod(Runtime.java:959) System.err: com.tns.NativeScriptException: System.err: Calling js method onViewAttachedToWindow failed System.err: System.err: TypeError: Cannot read property 'onNavigatingTo'
of undefined System.err: File: "file:///data/data/org.nativescript.TekmoTs/files/app/tns_modules/tns-core-modules/ui/frame/frame-common.js, line: 262, column: 36 System.err: System.err: StackTrace: System.err: Frame: function:'FrameBase._onNavigatingTo',
file:'file:///data/data/org.nativescript.TekmoTs/files/app/tns_modules/tns-core-modules/ui/frame/frame-common.js', line: 262, column: 37 System.err: Frame: function:'FrameBase.performNavigation', file:'file:///data/data/org.nativescript.TekmoTs/files/app/tns_modules/tns-core-modules/ui/frame/frame-common.js',
line: 234, column: 14 System.err: Frame: function:'FrameBase._processNextNavigationEntry', file:'file:///data/data/org.nativescript.TekmoTs/files/app/tns_modules/tns-core-modules/ui/frame/frame-common.js', line: 227, column: 22 System.err: Frame: function:'Frame._processNextNavigationEntry',
file:'file:///data/data/org.nativescript.TekmoTs/files/app/tns_modules/tns-core-modules/ui/frame/frame.js', line: 138, column: 58 System.err: Frame: function:'Frame._onAttachedToWindow', file:'file:///data/data/org.nativescript.TekmoTs/files/app/tns_modules/tns-core-modules/ui/frame/frame.js',
line: 114, column: 14 System.err: Frame: function:'AttachListener.onViewAttachedToWindow', file:'file:///data/data/org.nativescript.TekmoTs/files/app/tns_modules/tns-core-modules/ui/frame/frame.js', line: 38, column: 27 System.err: System.err: at com.tns.Runtime.callJSMethodNative(Native
Method) System.err: at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1116) System.err: at com.tns.Runtime.callJSMethodImpl(Runtime.java:996) System.err: at com.tns.Runtime.callJSMethod(Runtime.java:983) System.err: at com.tns.Runtime.callJSMethod(Runtime.java:967)
System.err: at com.tns.Runtime.callJSMethod(Runtime.java:959) System.err: at com.tns.gen.java.lang.Object_frame_32_36_AttachListener.onViewAttachedToWindow(Object_frame_32_36_AttachListener.java:17) System.err: at android.view.View.dispatchAttachedToWindow(View.java:18358)
System.err: at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3397) System.err: at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3404) System.err: at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3404)
System.err: at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1761) System.err: at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1460) System.err: at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7183) System.err:
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:949) System.err: at android.view.Choreographer.doCallbacks(Choreographer.java:761) System.err: at android.view.Choreographer.doFrame(Choreographer.java:696) System.err: at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:935)
System.err: at android.os.Handler.handleCallback(Handler.java:873) System.err: at android.os.Handler.dispatchMessage(Handler.java:99) System.err: at android.os.Looper.loop(Looper.java:193) System.err: at android.app.ActivityThread.main(ActivityThread.java:6669)
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)
the app-root.xml file's content is as below:
<Frame defaultPage="views/contact-us/contact-us">
</Frame>
and file stucture is as below:
├───app
│ ├───App_Resources
│ │ ├───Android
│ │ └───iOS
│ └───views
│ ├───about
│ ├───contact-us
│ └───home
├───hooks
...
the contact-us.xml file's content is also is as below:
<Page xmlns="http://www.nativescript.org/tns.xsd" navigatingTo="onNavigatedTo">
<ScrollView>
<StackLayout>
<Label text="Contact us by submitting a message below." textWrap="true" />
<TextField hint="Enter a subject..." />
<TextView hint="Enter a Message..."/>
<Button text="Submit" tap="onTap" />
</StackLayout>
</ScrollView>
</Page>
not: if I stop app with ctrl+c and y then restart my app with tns run android it runs successfully without any error.
I solved my problem with completely deleting platforms folder and rerun the app with tns run android.
Ok, I found the real error causing this, error happen whenever I change my app-root.xml'e defaultPage attribute to another page. I think this is an Issue with nativescript watch.
changing the app-root.xml's defaultPage attribute to another page while app is running is crashing the app.

NativeScript Looks for custom plugin in the wrong directory

I recently attempted to install a third party plugin: https://github.com/bradleygore/nativescript-materialdropdownlist and followed the README in order to use it. Nothing seemed out of the ordinary until I went to run my application and I ran into an error. I quickly noticed it's trying to find the plugin in the wrong folder.
<Page
xmlns="http://www.nativescript.org/tns.xsd"
xmlns:ns="nativescript-pro-ui/sidedrawer"
xmlns:mdl="nativescript-materialdropdownlist"
xmlns:drawer="pages/home/shared/drawer"
xmlns:header="pages/home/shared/header"
class="page" loaded="onNavigatingTo">
<header:header title="{{ title }}" openDrawer="{{ openDrawer }}"/>
<ns:RadSideDrawer id="sideDrawer" drawerLocation='Left' showOverNavigation='true'>
<ns:RadSideDrawer.drawerContent>
<drawer:drawer active="pages/home/rooms/rooms"/>
</ns:RadSideDrawer.drawerContent>
<ns:RadSideDrawer.mainContent>
<ScrollView>
<StackLayout>
<mdl:MaterialDropdownList col="1" id="ddlColors" itemSeparatorColor="gray" itemRowsHeight="30" items="{{ colors }}" selectedIndex="{{ selectedColorIndex }}"></mdl:MaterialDropdownList>
</StackLayout>
</ScrollView>
</ns:RadSideDrawer.mainContent>
</ns:RadSideDrawer>
</Page>
Stack Trace
System.err: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.greywallsoftware.GWSInternal/com.tns.NativeScriptActivity}: com.tns.NativeScriptException:
System.err: Calling js method onCreate failed
System.err:
System.err: Error: Building UI from XML. #file:///app/pages/home/rooms/rooms.xml:16:21
System.err: > Module '/data/data/com.greywallsoftware.GWSInternal/files/app/nativescript-materialdropdownlist' not found for element 'nativescript-materialdropdownlist:MaterialDropdownList'.
System.err: > com.tns.NativeScriptException: Failed to find module: "/data/data/com.greywallsoftware.GWSInternal/files/app/nativescript-materialdropdownlist", relative to: app//
System.err: com.tns.Module.resolvePathHelper(Module.java:146)
System.err: com.tns.Module.resolvePath(Module.java:55)
System.err: com.tns.Runtime.callJSMethodNative(Native Method)
System.err: com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1088)
System.err: com.tns.Runtime.callJSMethodImpl(Runtime.java:970)
System.err: com.tns.Runtime.callJSMethod(Runtime.java:957)
System.err: com.tns.Runtime.callJSMethod(Runtime.java:941)
System.err: com.tns.Runtime.callJSMethod(Runtime.java:933)
System.err: com.tns.NativeScriptActivity.onCreate(NativeScriptActivity.java:13)
System.err: android.app.Activity.performCreate(Activity.java:6975)
System.err: android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1213)
System.err: android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2770)
System.err: android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2892)
System.err: android.app.ActivityThread.-wrap11(Unknown Source:0)
System.err: android.app.ActivityThread$H.handleMessage(ActivityThread.java:1593)
System.err: android.os.Handler.dispatchMessage(Handler.java:105)
System.err: android.os.Looper.loop(Looper.java:164)
System.err: android.app.ActivityThread.main(ActivityThread.java:6541)
System.err: java.lang.reflect.Method.invoke(Native Method)
System.err: com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
System.err: com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
System.err: File: "file:///data/data/com.greywallsoftware.GWSInternal/files/app/tns_modules/tns-core-modules/ui/builder/builder.js, line: 196, column: 20
System.err:
System.err: StackTrace:
System.err: Frame: function:'ScopeError', file:'file:///data/data/com.greywallsoftware.GWSInternal/files/app/tns_modules/tns-core-modules/utils/debug.js', line: 63, column: 24
System.err: Frame: function:'SourceError', file:'file:///data/data/com.greywallsoftware.GWSInternal/files/app/tns_modules/tns-core-modules/utils/debug.js', line: 74, column: 23
System.err: Frame: function:'', file:'file:///data/data/com.greywallsoftware.GWSInternal/files/app/tns_modules/tns-core-modules/ui/builder/builder.js', line: 215, column: 17
System.err: Frame: function:'', file:'file:///data/data/com.greywallsoftware.GWSInternal/files/app/tns_modules/tns-core-modules/ui/builder/builder.js', line: 196, column: 33
System.err: Frame: function:'', file:'file:///data/data/com.greywallsoftware.GWSInternal/files/app/tns_modules/tns-core-modules/xml/xml.js', line: 148, column: 13
System.err: Frame: function:'EasySAXParser.parse', file:'file:///data/data/com.greywallsoftware.GWSInternal/files/app/tns_modules/tns-core-modules/js-libs/easysax/easysax.js', line: 751, column: 23
System.err: Frame: function:'XmlParser.parse', file:'file:///data/data/com.greywallsoftware.GWSInternal/files/app/tns_modules/tns-core-modules/xml/xml.js', line: 195, column: 22
System.err: Frame: function:'XmlStringParser.parse', file:'file:///data/data/com.greywallsoftware.GWSInternal/files/app/tns_modules/tns-core-modules/ui/builder/builder.js', line: 202, column: 27
System.err: Frame: function:'parseInternal', file:'file:///data/data/com.greywallsoftware.GWSInternal/files/app/tns_modules/tns-core-modules/ui/builder/builder.js', line: 47, column: 11
System.err: Frame: function:'loadPage', file:'file:///data/data/com.greywallsoftware.GWSInternal/files/app/tns_modules/tns-core-modules/ui/builder/builder.js', line: 131, column: 27
System.err: Frame: function:'', file:'file:///data/data/com.greywallsoftware.GWSInternal/files/app/tns_modules/tns-core-modules/ui/frame/frame-common.js', line: 112, column: 26
System.err: Frame: function:'', file:'file:///data/data/com.greywallsoftware.GWSInternal/files/app/tns_modules/tns-core-modules/ui/frame/frame-common.js', line: 131, column: 20
System.err: Frame: function:'FrameBase.navigate', file:'file:///data/data/com.greywallsoftware.GWSInternal/files/app/tns_modules/tns-core-modules/ui/frame/frame-common.js', line: 185, column: 28
System.err: Frame: function:'ActivityCallbacksImplementation.onCreate', file:'file:///data/data/com.greywallsoftware.GWSInternal/files/app/tns_modules/tns-core-modules/ui/frame/frame.js', line: 615, column: 19
System.err: Frame: function:'NativeScriptActivity.onCreate', file:'file:///data/data/com.greywallsoftware.GWSInternal/files/app/tns_modules/tns-core-modules/ui/frame/activity.js', line: 20, column: 25
System.err:
System.err: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2817)
System.err: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2892)
System.err: at android.app.ActivityThread.-wrap11(Unknown Source:0)
System.err: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1593)
System.err: at android.os.Handler.dispatchMessage(Handler.java:105)
System.err: at android.os.Looper.loop(Looper.java:164)
System.err: at android.app.ActivityThread.main(ActivityThread.java:6541)
System.err: at java.lang.reflect.Method.invoke(Native Method)
System.err: at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
System.err: Caused by: com.tns.NativeScriptException:
System.err: Calling js method onCreate failed
System.err:
System.err: Error: Building UI from XML. #file:///app/pages/home/rooms/rooms.xml:16:21
System.err: > Module '/data/data/com.greywallsoftware.GWSInternal/files/app/nativescript-materialdropdownlist' not found for element 'nativescript-materialdropdownlist:MaterialDropdownList'.
System.err: > com.tns.NativeScriptException: Failed to find module: "/data/data/com.greywallsoftware.GWSInternal/files/app/nativescript-materialdropdownlist", relative to: app//
System.err: com.tns.Module.resolvePathHelper(Module.java:146)
System.err: com.tns.Module.resolvePath(Module.java:55)
System.err: com.tns.Runtime.callJSMethodNative(Native Method)
System.err: com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1088)
System.err: com.tns.Runtime.callJSMethodImpl(Runtime.java:970)
System.err: com.tns.Runtime.callJSMethod(Runtime.java:957)
System.err: com.tns.Runtime.callJSMethod(Runtime.java:941)
System.err: com.tns.Runtime.callJSMethod(Runtime.java:933)
System.err: com.tns.NativeScriptActivity.onCreate(NativeScriptActivity.java:13)
System.err: android.app.Activity.performCreate(Activity.java:6975)
System.err: android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1213)
System.err: android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2770)
System.err: android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2892)
System.err: android.app.ActivityThread.-wrap11(Unknown Source:0)
System.err: android.app.ActivityThread$H.handleMessage(ActivityThread.java:1593)
System.err: android.os.Handler.dispatchMessage(Handler.java:105)
System.err: android.os.Looper.loop(Looper.java:164)
System.err: android.app.ActivityThread.main(ActivityThread.java:6541)
System.err: java.lang.reflect.Method.invoke(Native Method)
System.err: com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
System.err: com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
System.err: File: "file:///data/data/com.greywallsoftware.GWSInternal/files/app/tns_modules/tns-core-modules/ui/builder/builder.js, line: 196, column: 20
System.err:
System.err: StackTrace:
System.err: Frame: function:'ScopeError', file:'file:///data/data/com.greywallsoftware.GWSInternal/files/app/tns_modules/tns-core-modules/utils/debug.js', line: 63, column: 24
System.err: Frame: function:'SourceError', file:'file:///data/data/com.greywallsoftware.GWSInternal/files/app/tns_modules/tns-core-modules/utils/debug.js', line: 74, column: 23
System.err: Frame: function:'', file:'file:///data/data/com.greywallsoftware.GWSInternal/files/app/tns_modules/tns-core-modules/ui/builder/builder.js', line: 215, column: 17
System.err: Frame: function:'', file:'file:///data/data/com.greywallsoftware.GWSInternal/files/app/tns_modules/tns-core-modules/ui/builder/builder.js', line: 196, column: 33
System.err: Frame: function:'', file:'file:///data/data/com.greywallsoftware.GWSInternal/files/app/tns_modules/tns-core-modules/xml/xml.js', line: 148, column: 13
System.err: Frame: function:'EasySAXParser.parse', file:'file:///data/data/com.greywallsoftware.GWSInternal/files/app/tns_modules/tns-core-modules/js-libs/easysax/easysax.js', line: 751, column: 23
System.err: Frame: function:'XmlParser.parse', file:'file:///data/data/com.greywallsoftware.GWSInternal/files/app/tns_modules/tns-core-modules/xml/xml.js', line: 195, column: 22
System.err: Frame: function:'XmlStringParser.parse', file:'file:///data/data/com.greywallsoftware.GWSInternal/files/app/tns_modules/tns-core-modules/ui/builder/builder.js', line: 202, column: 27
System.err: Frame: function:'parseInternal', file:'file:///data/data/com.greywallsoftware.GWSInternal/files/app/tns_modules/tns-core-modules/ui/builder/builder.js', line: 47, column: 11
System.err: Frame: function:'loadPage', file:'file:///data/data/com.greywallsoftware.GWSInternal/files/app/tns_modules/tns-core-modules/ui/builder/builder.js', line: 131, column: 27
System.err: Frame: function:'', file:'file:///data/data/com.greywallsoftware.GWSInternal/files/app/tns_modules/tns-core-modules/ui/frame/frame-common.js', line: 112, column: 26
System.err: Frame: function:'', file:'file:///data/data/com.greywallsoftware.GWSInternal/files/app/tns_modules/tns-core-modules/ui/frame/frame-common.js', line: 131, column: 20
System.err: Frame: function:'FrameBase.navigate', file:'file:///data/data/com.greywallsoftware.GWSInternal/files/app/tns_modules/tns-core-modules/ui/frame/frame-common.js', line: 185, column: 28
System.err: Frame: function:'ActivityCallbacksImplementation.onCreate', file:'file:///data/data/com.greywallsoftware.GWSInternal/files/app/tns_modules/tns-core-modules/ui/frame/frame.js', line: 615, column: 19
System.err: Frame: function:'NativeScriptActivity.onCreate', file:'file:///data/data/com.greywallsoftware.GWSInternal/files/app/tns_modules/tns-core-modules/ui/frame/activity.js', line: 20, column: 25
System.err:
System.err: at com.tns.Runtime.callJSMethodNative(Native Method)
System.err: at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1088)
System.err: at com.tns.Runtime.callJSMethodImpl(Runtime.java:970)
System.err: at com.tns.Runtime.callJSMethod(Runtime.java:957)
System.err: at com.tns.Runtime.callJSMethod(Runtime.java:941)
System.err: at com.tns.Runtime.callJSMethod(Runtime.java:933)
System.err: at com.tns.NativeScriptActivity.onCreate(NativeScriptActivity.java:13)
System.err: at android.app.Activity.performCreate(Activity.java:6975)
System.err: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1213)
System.err: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2770)
System.err: ... 9 more
The module is definitely in my node_modules folder, but {N} is trying to load it from /app/nativescript-materialdropdownlist instead of /app/tns_modules/nativescript-materialdropdownlist where it's actually located in the output of build.
I've tried removing the platforms folder and rebuilding. I've tried removing node_modules and re-installing everything. I'm not sure what else to do.
The plugin is not compatible with NativeScript 3.x.x,
Consider using another plugin or implement your own drop-down functionality

Resources