Open rigoparis opened 6 years ago
Could be an API change in android. What API are you running on? If you could upload a demo project I'd be able to help run it locally and find a fix also 😄
Hey @bradmartin, thanks for the response.
I'm using 26.1.0 (this has to stay because it was the only version I found compatible with both geolocation and push notifications)
This is a playground I've set up using what I'm using a basic level. The playground crashes when I run the app with the following error but hopefully it will be enough to understand whats going on.
On the PG I tried importing the package with several different ways... but I got the closest with what I posted on the PG.
Playground: https://play.nativescript.org/?template=play-vue&id=aDdNWM
Error:
[ALE-L23]: An uncaught Exception occurred on "main" thread.
com.tns.NativeScriptException:
Calling js method onCreateView failed
TypeError: Cannot read property 'gcacace' of undefined
File: "file:///data/data/org.nativescript.preview/files/app/nativescript-drawingpad/drawingpad.js, line: 17, column: 42
StackTrace:
Frame: function:'DrawingPad.createNativeView', file:'file:///data/data/org.nativescript.preview/files/app/nativescript-drawingpad/drawingpad.js', line: 17, column: 43
Frame: function:'ViewBase._setupUI', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 492, column: 35
Frame: function:'', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 534, column: 19
Frame: function:'LayoutBaseCommon.eachChildView', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/layouts/layout-base-common.js', line: 125, column: 26
Frame: function:'ViewCommon.eachChild', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/core/view/view-common.js', line: 868, column: 14
Frame: function:'ViewBase._setupUI', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 533, column: 14
Frame: function:'', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 534, column: 19
Frame: function:'ContentView.eachChildView', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/content-view/content-view.js', line: 70, column: 13
Frame: function:'ViewCommon.eachChild', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/core/view/view-common.js', line: 868, column: 14
Frame: function:'ViewBase._setupUI', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 533, column: 14
Frame: function:'', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 534, column: 19
Frame: function:'ContentView.eachChildView', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/content-view/content-view.js', line: 70, column: 13
Frame: function:'PageBase.eachChildView', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/page/page-common.js', line: 120, column: 40
Frame: function:'ViewCommon.eachChild', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/core/view/view-common.js', line: 868, column: 14
Frame: function:'ViewBase._setupUI', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 533, column: 14
Frame: function:'ViewBase._addViewCore', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 431, column: 18
Frame: function:'ViewBase._addView', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 420, column: 14
Frame: function:'FragmentCallbacksImplementation.onCreateView', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/frame/frame.js', line: 588, column: 24
Frame: function:'FragmentClass.onCreateView', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/frame/fragment.js', line: 27, column: 38
at com.tns.Runtime.callJSMethodNative(Native Method)
at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1101)
at com.tns.Runtime.callJSMethodImpl(Runtime.java:983)
at com.tns.Runtime.callJSMethod(Runtime.java:970)
at com.tns.Runtime.callJSMethod(Runtime.java:954)
at com.tns.Runtime.callJSMethod(Runtime.java:946)
at com.tns.FragmentClass.onCreateView(FragmentClass.java:45)
at android.app.Fragment.performCreateView(Fragment.java:2059)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:899)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1076)
at android.app.BackStackRecord.run(BackStackRecord.java:833)
at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1461)
at android.app.FragmentManagerImpl$1.run(FragmentManager.java:448)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5538)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:960)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
I don't think the playground supports dependencies with native libraries. Unless it's been updated recently. So you can't use a lot of plugins in the playground because of this. Let me know if you can do a local project just fine. I did a few weeks ago so it should be fine.
On Tue, Jun 26, 2018, 10:18 AM rigoparis notifications@github.com wrote:
Hey @bradmartin https://github.com/bradmartin, thanks for the response.
I'm using 26.1.0 (this has to stay because it was the only version I found compatible with both geolocation and push notifications)
This is a playground I've set up using what I'm using a basic level. The playground crashes when I run the app with the following error.
Playground: https://play.nativescript.org/?template=play-vue&id=aDdNWM
Error:
[ALE-L23]: An uncaught Exception occurred on "main" thread. com.tns.NativeScriptException: Calling js method onCreateView failed
TypeError: Cannot read property 'gcacace' of undefined File: "file:///data/data/org.nativescript.preview/files/app/nativescript-drawingpad/drawingpad.js, line: 17, column: 42
StackTrace: Frame: function:'DrawingPad.createNativeView', file:'file:///data/data/org.nativescript.preview/files/app/nativescript-drawingpad/drawingpad.js', line: 17, column: 43 Frame: function:'ViewBase._setupUI', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 492, column: 35 Frame: function:'', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 534, column: 19 Frame: function:'LayoutBaseCommon.eachChildView', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/layouts/layout-base-common.js', line: 125, column: 26 Frame: function:'ViewCommon.eachChild', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/core/view/view-common.js', line: 868, column: 14 Frame: function:'ViewBase._setupUI', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 533, column: 14 Frame: function:'', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 534, column: 19 Frame: function:'ContentView.eachChildView', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/content-view/content-view.js', line: 70, column: 13 Frame: function:'ViewCommon.eachChild', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/core/view/view-common.js', line: 868, column: 14 Frame: function:'ViewBase._setupUI', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 533, column: 14 Frame: function:'', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 534, column: 19 Frame: function:'ContentView.eachChildView', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/content-view/content-view.js', line: 70, column: 13 Frame: function:'PageBase.eachChildView', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/page/page-common.js', line: 120, column: 40 Frame: function:'ViewCommon.eachChild', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/core/view/view-common.js', line: 868, column: 14 Frame: function:'ViewBase._setupUI', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 533, column: 14 Frame: function:'ViewBase._addViewCore', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 431, column: 18 Frame: function:'ViewBase._addView', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 420, column: 14 Frame: function:'FragmentCallbacksImplementation.onCreateView', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/frame/frame.js', line: 588, column: 24 Frame: function:'FragmentClass.onCreateView', file:'file:///data/data/org.nativescript.preview/files/app/tns_modules/tns-core-modules/ui/frame/fragment.js', line: 27, column: 38
at com.tns.Runtime.callJSMethodNative(Native Method) at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1101) at com.tns.Runtime.callJSMethodImpl(Runtime.java:983) at com.tns.Runtime.callJSMethod(Runtime.java:970) at com.tns.Runtime.callJSMethod(Runtime.java:954) at com.tns.Runtime.callJSMethod(Runtime.java:946) at com.tns.FragmentClass.onCreateView(FragmentClass.java:45) at android.app.Fragment.performCreateView(Fragment.java:2059) at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:899) at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1076) at android.app.BackStackRecord.run(BackStackRecord.java:833) at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1461) at android.app.FragmentManagerImpl$1.run(FragmentManager.java:448) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5538) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:960) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/bradmartin/nativescript-drawingpad/issues/42#issuecomment-400348496, or mute the thread https://github.com/notifications/unsubscribe-auth/AFulhJ98F3plrxW5gSwW9HB2k4c68_Gbks5uAlDQgaJpZM4U29rN .
Sure thing, I'll go ahead and create a repo.
I'll post it here as soon as I have it
@bradmartin Hey man,
Here's the repo: https://github.com/rigoparis/-N--VueDrawingPadExample
I did this on a clean project and the same first error occurred
@rigoparis hey, mine works here's my method to get the image
getDraw(args) { const pad = this.$refs.DrawingPad.nativeView; pad.getDrawing().then( data => { console.log(data); }, err => { console.log(err); } ); },
@rigoparis hey, mine works here's my method to get the image
getDraw(args) { const pad = this.$refs.DrawingPad.nativeView; pad.getDrawing().then( data => { console.log(data); }, err => { console.log(err); } ); },
Would you be willing to post your own repo? I'm relatively new to NS and am trying to get this to work using VS-Vue, but all the examples I can find use Angular. It would be very helpful
Please let me know if there's a template for reporting errors, I didn't find one
Hey guys!
First of all, thanks for the awesome plugin!
Now, I'm having an issue while calling getDrawing().
XML:
JS:
this returns the error at the bottom. However, if I use getDrawingSvg() it successfully returns the SVGXML and I can work with that... but just curious onto why this is happening.