1

Trying to add an external library into my Android Studio Project:

I imported an external library (https://github.com/winsontan520/Android-WScratchView/blob/master/README.md) with this step by step guide: https://stackoverflow.com/a/16639227/4479510.

It worked fine, until I wanted to add the xml code into the layout.xml like it's described in the first link. I get this error after implementing:

Rendering Problems

The following classes could not be instantiated:

- com.winsontan520.WScratchView (Open Class, Show Exception, Clear Cache)

Tip: Use View.isInEditMode() in your custom views to skip code or show sample data when shown in the IDE

Exception Details java.lang.NoSuchMethodError: com.winsontan520.WScratchView.setZOrderOnTop(Z)V   at com.winsontan520.WScratchView.init(WScratchView.java:124)   at com.winsontan520.WScratchView.(WScratchView.java:81)   at java.lang.reflect.Constructor.newInstance(Constructor.java:526)   at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)   at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:835)   at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:70)   at android.view.LayoutInflater.rInflate(LayoutInflater.java:811)   at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798)   at android.view.LayoutInflater.inflate(LayoutInflater.java:515)   at android.view.LayoutInflater.inflate(LayoutInflater.java:394) Copy stack to clipboard

Can anyone help me with this? I'm pretty lost right now.

Community
  • 1
  • 1
nintschger
  • 1,786
  • 5
  • 30
  • 45

0 Answers0