edusperoni / nativescript-ripple

NativeScript plugin to add Android Material Design Ripple effect to your layouts.
Apache License 2.0
52 stars 13 forks source link

Error MaterialRippleLayout is not a constructor #19

Closed Tyg-g closed 6 years ago

Tyg-g commented 6 years ago

I'm trying to use the module and get this exception:

System.err: com.tns.NativeScriptException: 
System.err: Calling js method onCreateView failed
System.err: TypeError: com.balysv.materialripple.MaterialRippleLayout is not a constructor
System.err: File: "file:///data/data/org.nativescript.vegns/files/app/tns_modules/nativescript-ripple/ripple.js, line: 31, column: 24
System.err: StackTrace: 
System.err:     Frame: function:'Ripple.createNativeView', file:'file:///data/data/org.nativescript.vegns/files/app/tns_modules/nativescript-ripple/ripple.js', line: 31, column: 25
System.err:     Frame: function:'ViewBase._setupUI', file:'file:///data/data/org.nativescript.vegns/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 492, column: 35
System.err:     Frame: function:'', file:'file:///data/data/org.nativescript.vegns/files/app/tns_modules/tns-core-modules/ui/core/view-base/view-base.js', line: 534, column: 19
System.err:     Frame: function:'LayoutBaseCommon.eachChildView', file:'file:///data/data/org.nativescript.vegns/files/app/tns_modules/tns-core-modules/ui/layouts/layout-base-common.js', line: 125, column: 26
...
peppeg85 commented 6 years ago

+1

Tyg-g commented 6 years ago

@peppeg85 where is the +1? ;)

bradmartin commented 6 years ago

This would indicate a build issue, such as the library didn't bundle into your apk correctly. Make sure you remove platforms, node_modules and then add the plugin and platforms to ensure a clean build. There are various ways to do this with TNS CLI or just npm scripts.

The code being executed is here: https://github.com/bradmartin/nativescript-ripple/blob/master/ripple.android.ts#L47 and the constructor should work, if cleaning your project doesn't work then ping this and I'll try the demo later.