edusperoni/nativescript-ripple

Error MaterialRippleLayout is not a constructor

Closed this issue · 3 comments

Tyg-g commented

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
...

+1

Tyg-g commented

@peppeg85 where is the +1? ;)

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.