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

NativeScript-ripple module not working in the new update (2.2.1) #1

Closed Yo-Nishiki closed 8 years ago

Yo-Nishiki commented 8 years ago

Good day!

I get this error whenever I navigate to a page with Ripple tags.

com.tns.NativeScriptException: Calling js method onCreateView failed

Error: java.lang.NullPointerException android.widget.TextView.setTextColor(TextView.java:2882) com.tns.Runtime.callJSMethodNative(Native Method) com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:862) com.tns.Runtime.callJSMethodImpl(Runtime.java:727) com.tns.Runtime.callJSMethod(Runtime.java:713) com.tns.Runtime.callJSMethod(Runtime.java:694) com.tns.Runtime.callJSMethod(Runtime.java:684) com.tns.FragmentClass.onCreateView(FragmentClass.java:35)

I encountered this problem after I updated nativescript from 2.1.1 to 2.2.1. Tried to fix this:

  • Removed the ripple plugin then installed it again --- nothing happened.
  • Reinstalled NativeScript update --- nothing happened.
  • Created another {N} project then copied and pasted the codes and files from the first project with error --- nothing happened.

    Update:

I discovered that when the ripple tags are typed and saved while in livesync, it works fine. But if I include the ripple tags then build/close-then-open the app, the error above is thrown again.

Another one is when I run the app with the first page with no ripple tags, and navigate to the next page with ripple tags, the next page works fine. Idk what's causing the 1st page to encounter such error. I'm just new to android programming so I cant understand the error thrown.

Thanks a lot for making this plugin, hope you see this asap.

bradmartin commented 8 years ago

I'll try to check this in the next couple of days, no promises. Really busy this week. Sorry, let you know when I find something.

boardyuk commented 8 years ago

I'm also having this issue. Just started converting a JS project to a new 2.2.1 TS project and came across this when I was building up the views again. Thanks for your work on all the plugins you create, I use a few of them in projects!

bradmartin commented 8 years ago

I'm not really sure this is an issue with this plugin. I've still not had time to try and work on it. I'll try to find some time but still really busy. If anyone can put together a simple sample project and share I'd appreciate the head start so I can see what's happening sooner and hopefully find a quick fix.

jgraffite commented 8 years ago

Before all, sorry for my poor English.

I've figured out the cause of this issue. It's in the implemented method "_addChildFromBuilder".

This method tries to set or reset the Color Style of the children view. But the Label with no color property set triggers this error.

The solution is don't run this code if the view is a Label and doesn't have color property set.

bradmartin commented 8 years ago

1.0.1 published - if issue persists let me know.