NathanaelA / nativescript-orientation

A NativeScript plugin to deal with Declarative UI and Screen Orientation
36 stars 38 forks source link

Fix view.eachDescendant not a function error in TNS rc #48

Closed mohammadrafigh closed 4 years ago

NathanaelA commented 4 years ago

This seems strange, View descends from ViewBase, so it should always have eachDescendant image

Can you tell me what error you saw?

mohammadrafigh commented 4 years ago

This seems strange, View descends from ViewBase, so it should always have eachDescendant image

Can you tell me what error you saw?

Yes it seems weird to me too. But maybe you can try it using "@nativescript/core": "rc" which is going to be used with "@nativescript/angular": "~10.0.0". I get eachDescendant is not a function.

here are exact logs:

System.err: An uncaught Exception occurred on "main" thread.
System.err: Calling js method onViewAttachedToWindow failed
System.err: TypeError: view.eachDescendant is not a function
System.err: 
System.err: StackTrace:
System.err: applyOrientationToPage(file: node_modules/nativescript-orientation/orientation.js:367:0)
System.err:     at handleNavigatingTo(file: node_modules/nativescript-orientation/orientation.js:393:0)
System.err:     at runEvent(file: node_modules/nativescript-globalevents/globalevents.js:245:0)
System.err:     at (file: node_modules/nativescript-globalevents/globalevents.js:298:0)
System.err:     at _onNavigatingTo(file: node_modules/@nativescript/core/ui/frame/frame-common.js:351:0)
System.err:     at performNavigation(file: node_modules/@nativescript/core/ui/frame/frame-common.js:323:0)
System.err:     at _processNextNavigationEntry(file: node_modules/@nativescript/core/ui/frame/frame-common.js:315:0)
System.err:     at _processNextNavigationEntry(file: node_modules/@nativescript/core/ui/frame/index.android.js:166:0)
System.err:     at _onAttachedToWindow(file: node_modules/@nativescript/core/ui/frame/index.android.js:117:0)
System.err:     at onViewAttachedToWindow(file: node_modules/@nativescript/core/ui/frame/index.android.js:45:0)
System.err:     at com.tns.Runtime.callJSMethodNative(Native Method)
System.err:     at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1286)
System.err:     at com.tns.Runtime.callJSMethodImpl(Runtime.java:1173)
System.err:     at com.tns.Runtime.callJSMethod(Runtime.java:1160)
System.err:     at com.tns.Runtime.callJSMethod(Runtime.java:1138)
System.err:     at com.tns.Runtime.callJSMethod(Runtime.java:1134)
System.err:     at com.tns.gen.java.lang.Object_vendor_120170_49_.onViewAttachedToWindow(Object_vendor_120170_49_.java:20)
System.err:     at android.view.View.dispatchAttachedToWindow(View.java:19564)
System.err:     at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3430)
System.err:     at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3437)
System.err:     at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3437)
System.err:     at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2028)
System.err:     at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1721)
System.err:     at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7598)
System.err:     at android.view.Choreographer$CallbackRecord.run(Choreographer.java:966)
System.err:     at android.view.Choreographer.doCallbacks(Choreographer.java:790)
System.err:     at android.view.Choreographer.doFrame(Choreographer.java:725)
System.err:     at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:951)
System.err:     at android.os.Handler.handleCallback(Handler.java:883)
System.err:     at android.os.Handler.dispatchMessage(Handler.java:100)
System.err:     at android.os.Looper.loop(Looper.java:214)
System.err:     at android.app.ActivityThread.main(ActivityThread.java:7356)
System.err:     at java.lang.reflect.Method.invoke(Native Method)
System.err:     at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
System.err:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
alexander-mai commented 4 years ago

I have the same problem and the fix solves the problem for me.

NathanaelA commented 4 years ago

Yep, I was able to confirm that something in RC was a breaking change.