Nativescript: tns-core-modules@next is giving me errors.

Created on 26 Oct 2016  路  5Comments  路  Source: NativeScript/NativeScript

_From @9thwall on October 25, 2016 18:28_

I'm getting this error when I upgrade to tns-core-modules@next.
Aside from the bugs of 2.3, the app works fine if I downgrade back.

Are there any deprecated changes that I should know about the update?

 java.lang.RuntimeException: Unable to resume activity {org.nativescript.app/com.tns.NativeScriptActivity}: com.tns.NativeScriptException:
Calling js method onCreateView failed

TypeError: Cannot read property 'LayoutParams' of undefined
File: "/data/data/org.nativescript.app/files/app/tns_modules/ui/core/view.js, line: 507, column: 68

StackTrace:
Frame: function:'ViewStyler.setNativeLayoutParamsProperty', file:'/data/data/org.nativescript.app/files/app/tns_modules/ui/core/view.js', line: 507, column: 69
Frame: function:'StylePropertyChangedHandler.applyProperty', file:'/data/data/org.nativescript.app/files/app/tns_modules/ui/styling/style.js', line: 1263, column: 14
Frame: function:'Style._applyStyleProperty', file:'/data/data/org.nativescript.app/files/app/tns_modules/ui/styling/style.js', line: 1036, column: 25
Frame: function:'Style._applyProperty', file:'/data/data/org.nativescript.app/files/app/tns_modules/ui/styling/style.js', line: 999, column: 14
Frame: function:'Style._onPropertyChanged', file:'/data/data/org.nativescript.app/files/app/tns_modules/ui/styling/style.js', line: 980, column: 14
Frame: function:'DependencyObservable._setValueInternal', file:'/data/data/org.nativescript.app/files/app/tns_modules/ui/core/dependency-observable.js', line: 307, column: 18
Frame: function:'DependencyObservable._setValue', file:'/data/data/org.nativescript.app/files/app/tns_modules/ui/core/dependency-observable.js', line: 133, column: 14
Frame: function:'onLayoutParamsChanged', file:'/data/data/org.nativescript.app/files/app/tns_modules/ui/styling/style.js', line: 130, column: 11
Frame: function:'DependencyObservable._onPropertyChanged', file:'/data/data/org.nativescript.app/files/app/tns_modules/ui/core/dependency-observable.js', line: 213, column: 13
Frame: function:'Style._onPropertyChanged', file:'/data/data/org.nativescript.app/files/app/tns_modules/ui/styling/style.js', line: 978, column: 45
Frame: function:'DependencyObservable._setValueInternal', file:'/data/data/org.nativescript.app/files/app/tns_modules/ui/core/dependency-observable.js', line: 307, column: 18
Frame: function:'DependencyObservable._setValue', file:'/data/data/org.nativescript.app/files/app/tns_modules/ui/core/dependency-observable.js', line: 133, column: 14
Frame: function:'Object.defineProperty.set', file:'/data/data/org.nativescript.app/files/app/tns_modules/ui/styling/style.js', line: 856, column: 18
Frame: function:'Object.defineProperty.set', file:'/data/data/org.nativescript.app/files/app/tns_modules/ui/core/view-common.js', line: 521, column: 42
Frame: function:'Page._addViewToNativeVisualTree', file:'/data/data/org.nativescript.app/files/app/tns_modules/ui/page/page.js', line: 102, column: 41
Frame: function:'eachChild', file:'/data/data/org.nativescript.app/files/app/tns_modules/ui/core/view.js', line: 160, column: 61
Frame: function:'Page._eachChildView', file:'/data/data/org.nativescript.app/files/app/tns_modules/ui/page/page-common.js', line: 286, column: 9
Frame: function:'View._onAttached', file:'/data/data/org.nativescript.app/files/app/tns_modules/ui/core/view.js', line: 165, column: 18
Frame: function:'View._addViewCore', file:'/data/data/org.nativescript.app/files/app/tns_modules/ui/core/view.js', line: 126, column: 18
Frame: function:'View._addView', file:'/data/data/org.nativescript.app/files/app/tns_modules/ui/core/view-common.js', line: 1136, column: 14
Frame: function:'onFragmentShown', file:'/data/data/org.nativescript.app/files/app/tns_modules/ui/frame/frame.js', line: 40, column: 11
Frame: function:'FragmentCallbacksImplementation.onCreateView', file:'/data/data/org.nativescript.app/files/app/tns_modules/ui/frame/frame.js', line: 612, column: 13
Frame: function:'FragmentClass.onCreateView', file:'/data/data/org.nativescript.app/files/app/tns_modules/ui/frame/fragment.js', line: 23, column: 38

at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3328)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3359)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2549)
at android.app.ActivityThread.access$900(ActivityThread.java:150)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1394)
at android.os.Handler.dispatchMessage(Handler.java:102)
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: com.tns.NativeScriptException:
Calling js method onCreateView failed

TypeError: Cannot read property 'LayoutParams' of undefined
File: "/data/data/org.nativescript.app/files/app/tns_modules/ui/core/view.js, line: 507, column: 68

StackTrace:
Frame: function:'ViewStyler.setNativeLayoutParamsProperty', file:'/data/data/org.nativescript.app/files/app/tns_modules/ui/core/view.js', line: 507, column: 69
Frame: function:'StylePropertyChangedHandler.applyProperty', file:'/data/data/org.nativescript.app/files/app/tns_modules/ui/styling/style.js', line: 1263, column: 14
Frame: function:'Style._applyStyleProperty', file:'/data/data/org.nativescript.app/files/app/tns_modules/ui/styling/style.js', line: 1036, column: 25
Frame: function:'Style._applyProperty', file:'/data/data/org.nativescript.app/files/app/tns_modules/ui/styling/style.js', line: 999, column: 14
Frame: function:'Style._onPropertyChanged', file:'/data/data/org.nativescript.app/files/app/tns_modules/ui/styling/style.js', line: 980, column: 14
Frame: function:'DependencyObservable._setValueInternal', file:'/data/data/org.nativescript.app/files/app/tns_modules/ui/core/dependency-observable.js', line: 307, column: 18
Frame: function:'DependencyObservable._setValue', file:'/data/data/org.nativescript.app/files/app/tns_modules/ui/core/dependency-observable.js', line: 133, column: 14
Frame: function:'onLayoutParamsChanged', file:'/data/data/org.nativescript.app/files/app/tns_modules/ui/styling/style.js', line: 130, column: 11
Frame: function:'DependencyObservable._onPropertyChanged', file:'/data/data/org.nativescript.app/files/app/tns_modules/ui/core/dependency-observable.js', line: 213, column: 13
Frame: function:'Style._onPropertyChanged', file:'/data/data/org.nativescript.app/files/app/tns_modules/ui/styling/style.js', line: 978, column: 45
Frame: function:'DependencyObservable._setValueInternal', file:'/data/data/org.nativescript.app/files/app/tns_modules/ui/core/dependency-observable.js', line: 307, column: 18
Frame: function:'DependencyObservable._setValue', file:'/data/data/org.nativescript.app/files/app/tns_modules/ui/core/dependency-observable.js', line: 133, column: 14
Frame: function:'Object.defineProperty.set', file:'/data/data/org.nativescript.app/files/app/tns_modules/ui/styling/style.js', line: 856, column: 18
Frame: function:'Object.defineProperty.set', file:'/data/data/org.nativescript.app/files/app/tns_modules/ui/core/view-common.js', line: 521, column: 42
Frame: function:'Page._addViewToNativeVisualTree', file:'/data/data/org.nativescript.app/files/app/tns_modules/ui/page/page.js', line: 102, column: 41
Frame: function:'eachChild', file:'/data/data/org.nativescript.app/files/app/tns_modules/ui/core/view.js', line: 160, column: 61
Frame: function:'Page._eachChildView', file:'/data/data/org.nativescript.app/files/app/tns_modules/ui/page/page-common.js', line: 286, column: 9
Frame: function:'View._onAttached', file:'/data/data/org.nativescript.app/files/app/tns_modules/ui/core/view.js', line: 165, column: 18
Frame: function:'View._addViewCore', file:'/data/data/org.nativescript.app/files/app/tns_modules/ui/core/view.js', line: 126, column: 18
Frame: function:'View._addView', file:'/data/data/org.nativescript.app/files/app/tns_modules/ui/core/view-common.js', line: 1136, column: 14
Frame: function:'onFragmentShown', file:'/data/data/org.nativescript.app/files/app/tns_modules/ui/frame/frame.js', line: 40, column: 11
Frame: function:'FragmentCallbacksImplementation.onCreateView', file:'/data/data/org.nativescript.app/files/app/tns_modules/ui/frame/frame.js', line: 612, column: 13
Frame: function:'FragmentClass.onCreateView', file:'/data/data/org.nativescript.app/files/app/tns_modules/ui/frame/fragment.js', line: 23, column: 38

at com.tns.Runtime.callJSMethodNative(Native Method)
at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:865)
at com.tns.Runtime.callJSMethodImpl(Runtime.java:730)
at com.tns.Runtime.callJSMethod(Runtime.java:716)
at com.tns.Runtime.callJSMethod(Runtime.java:697)
at com.tns.Runtime.callJSMethod(Runtime.java:687)
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.FragmentController.execPendingActions(FragmentController.java:325)
at android.app.Activity.performResume(Activity.java:6345)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3311)

_Copied from original issue: NativeScript/nativescript-angular#513_

Most helpful comment

Hey @9thwall,

Please delete node_modules folder and execute tns run android to fix this.

All 5 comments

Hey @9thwall,

Please delete node_modules folder and execute tns run android to fix this.

Hi, thank you for the advice.
I followed your instructions and now I'm getting this error.

app/inc/app.service.ts(4,27): error TS2656: Exported external package typings file 'C:/Users/9thwall/Desktop/Projects/app/node_modules/nativescript-plugin-firebase/firebase.d.ts' is not a module. Please contact the package author to update the package definition.

Are there scenarios where plugins that are still in compatible with this update? Will I need to wait for Eddy to update the plugin in order for this to work?

Ok I was able to resolve this by upgrading typescript. I then was getting some other errors..

Execution failed for task ':asbg:runAstParser'.

which I resolved by rm -rf platforms/ node_modules/ lib/ hooks, tns install, and tns run android. Suggested by tjvantoll.

Now the app is loading again but I made a full circle back to the same original error. lol!

java.lang.RuntimeException: Unable to resume activity {org.nativescript.app/com.tns.NativeScriptActivity}: com.tns.NativeScriptException:
Calling js method onCreateView failed

TypeError: Cannot read property 'LayoutParams' of undefined
File: "/data/data/org.nativescript.app/files/app/tns_modules/ui/core/view.js, line: 507, column: 68

UPDATE: I was able to resolve this by creating a brand new app with @next and then add each component, service, and plugins one by one. Still a mystery to me why I wasn't able to upgrade my existing app but I'm happy to say it is all working now.

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings