bradmartin / nativescript-advanced-webview

NativeScript plugin for Chrome CustomTabs on Android and SafariViewController on iOS.
Other
60 stars 28 forks source link

Error: java.lang.NoSuchMethodError: no static method "Landroid/view/View;.setPadding(IIII)V" #49

Open max-pro opened 4 years ago

max-pro commented 4 years ago

{ "nativescript": { "id": "org.nativescript.testingAdvanceView", "tns-android": { "version": "6.3.1" }, "tns-ios": { "version": "6.3.0" } }, "description": "NativeScript Application", "license": "SEE LICENSE IN ", "repository": "", "dependencies": { "@nativescript/theme": "~2.2.1", "nativescript-advanced-webview": "^5.0.0", "tns-core-modules": "~6.3.0" }, "devDependencies": { "nativescript-dev-webpack": "~1.4.0" }, "gitHead": "fa98f785df3fba482e5e2a0c76f4be1fa6dc7a14", "readme": "NativeScript Application" } Getting error app crash in android

maxorlovsky commented 4 years ago

Have exact same issue. Here's the stacktrace from NS-Vue, might be helpful. I tried to understand what might be the problem, but it seems like it's not with this plugin directly, but rather dependency, which is https://github.com/triniwiz/fancy-advanced-webview

You don't even need to init advance webview to receive the error. Just install plugin as dependency.

JS: Error: Could not load CSS from app.css: Error: require's first parameter should be string
JS: HMR: Hot Module Replacement Enabled. Waiting for signal.
JS: 'NativeScript-Vue has "Vue.config.silent" set to true, to see output logs set it to false.'
JS: 'topmost() is deprecated. Use Frame.topmost() instead.'
JS: 'topmost() is deprecated. Use Frame.topmost() instead.'
System.err: An uncaught Exception occurred on "main" thread.
System.err: Calling js method onStart failed
System.err: Error: java.lang.NoSuchMethodError: no static method "Landroid/view/View;.setPadding(IIII)V"
System.err: 
System.err: StackTrace:
System.err: onBackgroundOrBorderPropertyChanged(file:///node_modules/@nativescript/core/ui/styling/background.js:88:19)
System.err:     at View._redrawNativeBackground(file:///node_modules/@nativescript/core/ui/core/view/view.js:777:28)
System.err:     at View.<computed>(file:///node_modules/@nativescript/core/ui/core/view/view.js:757:13)
System.err:     at applyAllNativeSetters(file:///node_modules/@nativescript/core/ui/core/properties/properties.js:1065:37)
System.err:     at initNativeView(file:///node_modules/@nativescript/core/ui/core/properties/properties.js:992:8)
System.err:     at ViewBase.onResumeNativeUpdates(file:///node_modules/@nativescript/core/ui/core/view-base/view-base.js:633:21)
System.err:     at ViewBase._resumeNativeUpdates(file:///node_modules/@nativescript/core/ui/core/view-base/view-base.js:278:17)
System.err:     at ViewBase.onLoaded(file:///node_modules/@nativescript/core/ui/core/view-base/view-base.js:232:13)
System.err:     at View.onLoaded(file:///node_modules/@nativescript/core/ui/core/view/view.js:249:34)
System.err:     at (file:///node_modules/@nativescript/core/ui/core/view-base/view-base.js:317:89)
System.err:     at ViewBase.callFunctionWithSuper(file:///node_modules/@nativescript/core/ui/core/view-base/view-base.js:310:8)
System.err:     at ViewBase.callLoaded(file:///node_modules/@nativescript/core/ui/core/view-base/view-base.js:317:13)
System.err:     at ViewBase.loadView(file:///node_modules/@nativescript/core/ui/core/view-base/view-base.js:445:17)
System.err:     at (file:///node_modules/@nativescript/core/ui/core/view-base/view-base.js:234:18)
System.err:     at RadSideDrawer.eachChildView(file:///node_modules/nativescript-ui-sidedrawer/ui-sidedrawer.common.js:148:12)
System.err:     at ViewCommon.eachChild(file:///node_modules/@nativescript/core/ui/core/view/view-common.js:915:13)
System.err:     at ViewBase.onLoaded(file:///node_modules/@nativescript/core/ui/core/view-base/view-base.js:233:13)
System.err:     at View.onLoaded(file:///node_modules/@nativescript/core/ui/core/view/view.js:249:34)
System.err:     at (file:///node_modules/@nativescript/core/ui/core/view-base/view-base.js:317:89)
System.err:     at ViewBase.callFunctionWithSuper(file:///node_modules/@nativescript/core/ui/core/view-base/view-base.js:310:8)
System.err:     at ViewBase.callLoaded(file:///node_modules/@nativescript/core/ui/core/view-base/view-base.js:317:13)
System.err:     at ActivityCallbacksImplementation.onStart(file:///node_modules/@nativescript/core/ui/frame/frame.js:888:21)
System.err:     at NativeScriptActivity.onStart(file:///node_modules/@nativescript/core/ui/frame/activity.js:29:24)
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.NativeScriptActivity.onStart(NativeScriptActivity.java:34)
System.err:     at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1391)
System.err:     at android.app.Activity.performStart(Activity.java:7157)
System.err:     at android.app.ActivityThread.handleStartActivity(ActivityThread.java:2937)
System.err:     at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:180)
System.err:     at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:165)
System.err:     at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:142)
System.err:     at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:70)
System.err:     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1808)
System.err:     at android.os.Handler.dispatchMessage(Handler.java:106)
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)
System.err: Caused by: java.lang.NoSuchMethodError: no static method "Landroid/view/View;.setPadding(IIII)V"
System.err:     ... 21 more
Successfully synced application com.socios.socios on device emulator-5554.

And if you remove nativeView.setPadding(leftPadding, topPadding, rightPadding, bottomPadding); from background.android.js from @nativescript/core all is fine beside the styling.

ricky-bos commented 4 years ago

I'm getting a similar problem

System.err: An uncaught Exception occurred on "main" thread. System.err: Calling js method onViewAttachedToWindow failed System.err: Error: java.lang.NoSuchMethodError: no static method "Landroid/animation/Animator;.addListener(Landroid/animation/Animator$AnimatorListener;)V" System.err: System.err: StackTrace: System.err: setupExitAndPopEnterAnimation(file:///node_modules/tns-core-modules/ui/frame/fragment.transitions.js:510:17) System.err: at setupAllAnimation(file:///node_modules/tns-core-modules/ui/frame/fragment.transitions.js:519:4) System.err: at _setAndroidFragmentTransitions(file:///node_modules/tns-core-modules/ui/frame/fragment.transitions.js:108:8) System.err: at Frame._navigateCore(file:///node_modules/tns-core-modules/ui/frame/frame.js:296:31) System.err: at FrameBase.performNavigation(file:///node_modules/tns-core-modules/ui/frame/frame-common.js:265:13) System.err: at FrameBase._processNextNavigationEntry(file:///node_modules/tns-core-modules/ui/frame/frame-common.js:256:21) System.err: at Frame._processNextNavigationEntry(file:///node_modules/tns-core-modules/ui/frame/frame.js:152:57) System.err: at Frame._onAttachedToWindow(file:///node_modules/tns-core-modules/ui/frame/frame.js:127:13) System.err: at AttachListener.onViewAttachedToWindow(file:///node_modules/tns-core-modules/ui/frame/frame.js:39:26) 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_57138_28_AttachListener.onViewAttachedToWindow(Object_vendor_57138_28_AttachListener.java:18) System.err: at android.view.View.dispatchAttachedToWindow(View.java:15520) System.err: at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2916) System.err: at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2923) System.err: at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2923) System.err: at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2923) System.err: at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2923) System.err: at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2923) System.err: at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1526) System.err: at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1254) System.err: at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6337) System.err: at android.view.Choreographer$CallbackRecord.run(Choreographer.java:874) System.err: at android.view.Choreographer.doCallbacks(Choreographer.java:686) System.err: at android.view.Choreographer.doFrame(Choreographer.java:621) System.err: at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:860) System.err: at android.os.Handler.handleCallback(Handler.java:751) System.err: at android.os.Handler.dispatchMessage(Handler.java:95) System.err: at android.os.Looper.loop(Looper.java:154) System.err: at android.app.ActivityThread.main(ActivityThread.java:6119) System.err: at java.lang.reflect.Method.invoke(Native Method) System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886) System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776) System.err: Caused by: java.lang.NoSuchMethodError: no static method "Landroid/animation/Animator;.addListener(Landroid/animation/Animator$AnimatorListener;)V" System.err: ... 28 more JS: 'Error: Error: Calling js method onViewAttachedToWindow failed JS: Error: java.lang.NoSuchMethodError: no static method "Landroid/animation/Animator;.addListener(Landroid/animation/Animator$AnimatorListener;)V"'

saeb-panahifar commented 4 years ago

Me too.

ghost commented 4 years ago

I'm also having this problem. It's preventing me from updating my project's tns-android past v6.1.

JamesRoome commented 4 years ago

I've created a PR that should solve the issue.