Closed damianocorrado closed 6 years ago
Do you have the optional "ripple" setting turned on?
I'm seeing that as well in Android 5.1.1. Will have a PR shortly.
Thank you for reply. Yes, the error is caused by the option "ripple", without it works perfectly. Waiting for news. Thanks a lot.
@damianocorrado I posted a pull request with a fix that disables the ripple for 22 and lower.
@kanayo How can I integrate your fix with tns? If I do an update, always download the version 3.1.0.
Thank you for the support
@damianocorrado If you can't wait for @bradmartin to accept the PR you could temporarily use my fork. I believe NativeScript will allow you to reference a GIT repository directly for plugins.
Will merge and publish when conflict is fixed 😄 - and @kanayo is correct @damianocorrado with js projects utilizing a package.json
you can specify dependencies via a git repo (even private), npm, and local file paths 👍
@bradmartin Today I tested on Android 5.1 and confronted with the same error. Disabling this.nativeView.setForeground(selectedItemDrawable);
on cardview.android.js
(line 38) solves the problem. But I am not sure if it disabled anything or not. :sob:
closed via #91
Hi, I'm using your library, thank you. I found a problem when running on android devices with API level 22. Can you help me please ? My version of tns is 4.1.0
This is my package.json
"nativescript": { "id": "org.nativescript.cloudrdiaryhae", "tns-android": { "version": "4.1.2" } }, "dependencies": { "nativescript-cardview": "^3.1.0", "nativescript-carousel": "^3.1.1", "nativescript-localize": "^3.0.3", "nativescript-theme-core": "~1.0.4", "tns-core-modules": "~4.1.0" }, "devDependencies": { "babel-traverse": "6.26.0", "babel-types": "6.26.0", "babylon": "6.18.0", "lazy": "1.0.11", "nativescript-dev-sass": "^1.6.0" }
And here the full stacktrace
System.err: com.tns.NativeScriptException: System.err: Calling js method onCreateView failed System.err: Error: java.lang.NoSuchMethodError: no non-static method "Landroid/view/View;.setForeground(Landroid/graphics/drawable/Drawable;)V" System.err: com.tns.Runtime.callJSMethodNative(Native Method) System.err: com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1101) System.err: com.tns.Runtime.callJSMethodImpl(Runtime.java:983) System.err: com.tns.Runtime.callJSMethod(Runtime.java:970) System.err: com.tns.Runtime.callJSMethod(Runtime.java:954) System.err: com.tns.Runtime.callJSMethod(Runtime.java:946) System.err: com.tns.FragmentClass.onCreateView(FragmentClass.java:45) System.err: android.app.Fragment.performCreateView(Fragment.java:2053) System.err: android.app.FragmentManagerImpl.moveToState(FragmentManager.java:894) System.err: android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1067) System.err: android.app.BackStackRecord.run(BackStackRecord.java:834) System.err: android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1452) System.err: android.app.FragmentManagerImpl$1.run(FragmentManager.java:447) System.err: android.os.Handler.handleCallback(Handler.java:739) System.err: android.os.Handler.dispatchMessage(Handler.java:95) System.err: android.os.Looper.loop(Looper.java:135) System.err: android.app.ActivityThread.main(ActivityThread.java:5491) System.err: java.lang.reflect.Method.invoke(Native Method) System.err: java.lang.reflect.Method.invoke(Method.java:372) System.err: com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:984) System.err: com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779) System.err: File: "file:///data/data/org.nativescript.cloudrdiaryhae/files/app/tns_modules/nativescript-cardview/cardview.js, line: 38, column: 32 System.err: StackTrace: System.err: Frame: function:'CardView.(anonymous function)', file:'file:///data/data/org.nativescript.cloudrdiaryhae/files/app/tns_modules/nativescript-cardview/cardview.js', line: 38, column: 33 System.err: Frame: function:'applyAllNativeSetters', file:'file:///data/data/org.nativescript.cloudrdiaryhae/files/app/tns_modules/tns-core-modules/ui/core/properties/properties.js', line: 960, column: 28 System.err: Frame: function:'initNativeView', file:'file:///data/data/org.nativescript.cloudrdiaryhae/files/app/tns_modules/tns-core-modules/ui/core/properties/properties.js', line: 904, column: 9 System.err: Frame: function:'ViewBase.onResumeNativeUpdates', file:'file:///data/data/org.nativescript.cloudrdiaryhae/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 627, column: 22 System.err: Frame: function:'ViewBase._resumeNativeUpdates', file:'file:///data/data/org.nativescript.cloudrdiaryhae/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 272, column: 18 System.err: Frame: function:'ViewBase.onLoaded', file:'file:///data/data/org.nativescript.cloudrdiaryhae/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 231, column: 14 System.err: Frame: function:'View.onLoaded', file:'file:///data/data/org.nativescript.cloudrdiaryhae/files/app/tns_modules/tns-core-modules/ui/core/view/view.js', line: 208, column: 35 System.err: Frame: function:'', file:'file:///data/data/org.nativescript.cloudrdiaryhae/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 311, column: 90 System.err: Frame: function:'ViewBase.callFunctionWithSuper', file:'file:///data/data/org.nativescript.cloudrdiaryhae/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 304, column: 9 System.err: Frame: function:'ViewBase.callLoaded', file:'file:///data/data/org.nativescript.cloudrdiaryhae/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 311, column: 14 System.err: Frame: function:'ViewBase.loadView', file:'file:///data/data/org.nativescript.cloudrdiaryhae/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 439, column: 18 System.err: Frame: function:'', file:'file:///data/data/org.nativescript.cloudrdiaryhae/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 233, column: 19 System.err: Frame: function:'LayoutBaseCommon.eachChildView', file:'file:///data/data/org.nativescript.cloudrdiaryhae/files/app/tns_modules/tns-core-modules/ui/layouts/layout-base-common.js', line: 125, column: 26 System.err: Frame: function:'ViewCommon.eachChild', file:'file:///data/data/org.nativescript.cloudrdiaryhae/files/app/tns_modules/tns-core-modules/ui/core/view/view-common.js', line: 868, column: 14 System.err: Frame: function:'ViewBase.onLoaded', file:'file:///data/data/org.nativescript.cloudrdiaryhae/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 232, column: 14 System.err: Frame: function:'View.onLoaded', file:'file:///data/data/org.nativescript.cloudrdiaryhae/files/app/tns_modules/tns-core-modules/ui/core/view/view.js', line: 208, column: 35 System.err: Frame: function:'', file:'file:///data/data/org.nativescript.cloudrdiaryhae/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 311, column: 90 System.err: Frame: function:'ViewBase.callFunctionWithSuper', file:'file:///data/data/org.nativescript.cloudrdiaryhae/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 304, column: 9 System.err: Frame: function:'ViewBase.callLoaded', file:'file:///data/data/org.nativescript.cloudrdiaryhae/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 311, column: 14 System.err: Frame: function:'ViewBase.loadView', file:'file:///data/data/org.nativescript.cloudrdiaryhae/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 439, column: 18 System.err: Frame: function:'', file:'file:///data/data/org.nativescript.cloudrdiaryhae/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 233, column: 19 System.err: Frame: function:'LayoutBaseCommon.eachChildView', file:'file:///data/data/org.nativescript.cloudrdiaryhae/files/app/tns_modules/tns-core-modules/ui/layouts/layout-base-common.js', line: 125, column: 26 System.err: Frame: function:'ViewCommon.eachChild', file:'file:///data/data/org.nativescript.cloudrdiaryhae/files/app/tns_modules/tns-core-modules/ui/core/view/view-common.js', line: 868, column: 14 System.err: Frame: function:'ViewBase.onLoaded', file:'file:///data/data/org.nativescript.cloudrdiaryhae/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 232, column: 14 System.err: Frame: function:'View.onLoaded', file:'file:///data/data/org.nativescript.cloudrdiaryhae/files/app/tns_modules/tns-core-modules/ui/core/view/view.js', line: 208, column: 35 System.err: Frame: function:'', file:'file:///data/data/org.nativescript.cloudrdiaryhae/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 311, column: 90 System.err: Frame: function:'ViewBase.callFunctionWithSuper', file:'file:///data/data/org.nativescript.cloudrdiaryhae/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 304, column: 9 System.err: Frame: function:'ViewBase.callLoaded', file:'file:///data/data/org.nativescript.cloudrdiaryhae/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 311, column: 14 System.err: Frame: function:'ViewBase.loadView', file:'file:///data/data/org.nativescript.cloudrdiaryhae/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 439, column: 18 System.err: Frame: function:'', file:'file:///data/data/org.nativescript.cloudrdiaryhae/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 233, column: 19 System.err: Frame: function:'ContentView.eachChildView', file:'file:///data/data/org.nativescript.cloudrdiaryhae/files/app/tns_modules/tns-core-modules/ui/content-view/content-view.js', line: 70, column: 13 System.err: Frame: function:'ViewCommon.eachChild', file:'file:///data/data/org.nativescript.cloudrdiaryhae/files/app/tns_modules/tns-core-modules/ui/core/view/view-common.js', line: 868, column: 14 System.err: Frame: function:'ViewBase.onLoaded', file:'file:///data/data/org.nativescript.cloudrdiaryhae/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 232, column: 14 System.err: Frame: function:'View.onLoaded', file:'file:///data/data/org.nativescript.cloudrdiaryhae/files/app/tns_modules/tns-core-modules/ui/core/view/view.js', line: 208, column: 35 System.err: Frame: function:'ScrollViewBase.onLoaded', file:'file:///data/data/org.nativescript.cloudrdiaryhae/files/app/tns_modules/tns-core-modules/ui/scroll-view/scroll-view-common.js', line: 31, column: 35 System.err: Frame: function:'', file:'file:///data/data/org.nativescript.cloudrdiaryhae/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 311, column: 90 System.err: Frame: function:'ViewBase.callFunctionWithSuper', file:'file:///data/data/org.nativescript.cloudrdiaryhae/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 304, column: 9 System.err: Frame: function:'ViewBase.callLoaded', file:'file:///data/data/org.nativescript.cloudrdiaryhae/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 311, column: 14 System.err: Frame: function:'ViewBase.loadView', file:'file:///data/data/org.nativescript.cloudrdiaryhae/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 439, column: 18 System.err: Frame: function:'', file:'file:///data/data/org.nativescript.cloudrdiaryhae/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 233, column: 19 System.err: Frame: function:'ContentView.eachChildView', file:'file:///data/data/org.nativescript.cloudrdiaryhae/files/app/tns_modules/tns-core-modules/ui/content-view/content-view.js', line: 70, column: 13 System.err: Frame: function:'PageBase.eachChildView', file:'file:///data/data/org.nativescript.cloudrdiaryhae/files/app/tns_modules/tns-core-modules/ui/page/page-common.js', line: 120, column: 40 System.err: Frame: function:'ViewCommon.eachChild', file:'file:///data/data/org.nativescript.cloudrdiaryhae/files/app/tns_modules/tns-core-modules/ui/core/view/view-common.js', line: 868, column: 14 System.err: Frame: function:'ViewBase.onLoaded', file:'file:///data/data/org.nativescript.cloudrdiaryhae/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 232, column: 14 System.err: Frame: function:'View.onLoaded', file:'file:///data/data/org.nativescript.cloudrdiaryhae/files/app/tns_modules/tns-core-modules/ui/core/view/view.js', line: 208, column: 35 System.err: Frame: function:'Page.onLoaded', file:'file:///data/data/org.nativescript.cloudrdiaryhae/files/app/tns_modules/tns-core-modules/ui/page/page.js', line: 43, column: 35 System.err: Frame: function:'', file:'file:///data/data/org.nativescript.cloudrdiaryhae/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 311, column: 90 System.err: Frame: function:'ViewBase.callFunctionWithSuper', file:'file:///data/data/org.nativescript.cloudrdiaryhae/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 304, column: 9 System.err: Frame: function:'ViewBase.callLoaded', file:'file:///data/data/org.nativescript.cloudrdiaryhae/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 311, column: 14 System.err: Frame: function:'ViewBase.loadView', file:'file:///data/data/org.nativescript.cloudrdiaryhae/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 439, column: 18 System.err: Frame: function:'ViewBase._addViewCore', file:'file:///data/data/org.nativescript.cloudrdiaryhae/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 434, column: 18 System.err: Frame: function:'ViewBase._addView', file:'file:///data/data/org.nativescript.cloudrdiaryhae/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 420, column: 14 System.err: Frame: function:'FragmentCallbacksImplementation.onCreateView', file:'file:///data/data/org.nativescript.cloudrdiaryhae/files/app/tns_modules/tns-core-modules/ui/frame/frame.js', line: 588, column: 24 System.err: Frame: function:'FragmentClass.onCreateView', file:'file:///data/data/org.nativescript.cloudrdiaryhae/files/app/tns_modules/tns-core-modules/ui/frame/fragment.js', line: 27, column: 38 System.err: at com.tns.Runtime.callJSMethodNative(Native Method) System.err: at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1101) System.err: at com.tns.Runtime.callJSMethodImpl(Runtime.java:983) System.err: at com.tns.Runtime.callJSMethod(Runtime.java:970) System.err: at com.tns.Runtime.callJSMethod(Runtime.java:954) System.err: at com.tns.Runtime.callJSMethod(Runtime.java:946) System.err: at com.tns.FragmentClass.onCreateView(FragmentClass.java:45) System.err: at android.app.Fragment.performCreateView(Fragment.java:2053) System.err: at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:894) System.err: at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1067) System.err: at android.app.BackStackRecord.run(BackStackRecord.java:834) System.err: at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1452) System.err: at android.app.FragmentManagerImpl$1.run(FragmentManager.java:447) System.err: at android.os.Handler.handleCallback(Handler.java:739) System.err: at android.os.Handler.dispatchMessage(Handler.java:95) System.err: at android.os.Looper.loop(Looper.java:135) System.err: at android.app.ActivityThread.main(ActivityThread.java:5491) System.err: at java.lang.reflect.Method.invoke(Native Method) System.err: at java.lang.reflect.Method.invoke(Method.java:372) System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:984) System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779) System.err: Caused by: java.lang.NoSuchMethodError: no non-static method "Landroid/view/View;.setForeground(Landroid/graphics/drawable/Drawable;)V" System.err: ... 21 more