dmytrodanylyk / android-process-button

Android Buttons With Built-in Progress Meters.
http://dmytrodanylyk.com/pages/portfolio/portfolio-process-button.html
MIT License
3.01k stars 546 forks source link

Rendering problem with Android Studio #31

Closed fxkjd closed 9 years ago

fxkjd commented 9 years ago

Hi!

Android Studio throws the next error rendering ActionProcessButton:

Rendering Problems

The following classes could not be instantiated: - com.dd.processbutton.iml.ActionProcessButton (Open Class, Show Exception) Tip: Use View.isInEditMode() in your custom views to skip code or show sample data when shown in the IDE

Exception Details

java.lang.AssertionError    at android.content.res.BridgeResources.getDimension(BridgeResources.java:335) at com.dd.processbutton.FlatButton.getDimension(FlatButton.java:103) at com.dd.processbutton.FlatButton.initAttributes(FlatButton.java:52) at com.dd.processbutton.FlatButton.init(FlatButton.java:38) at com.dd.processbutton.FlatButton.(FlatButton.java:27) at com.dd.processbutton.ProcessButton.(ProcessButton.java:31) at com.dd.processbutton.iml.ActionProcessButton.(ActionProcessButton.java:64) at java.lang.reflect.Constructor.newInstance(Constructor.java:526) at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:806) at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64) at android.view.LayoutInflater.rInflate(LayoutInflater.java:782)    at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:809)    at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)    at android.view.LayoutInflater.rInflate(LayoutInflater.java:782)    at android.view.LayoutInflater.inflate(LayoutInflater.java:504)    at android.view.LayoutInflater.inflate(LayoutInflater.java:385)

It's just the preview, on runtime works fine.

Any ideas?

thanks!

dmytrodanylyk commented 9 years ago

@ke2g are you using latest Android Studio ver?

fxkjd commented 9 years ago

hi @dmytrodanylyk yes, Android Studio 1.0.2

dmytrodanylyk commented 9 years ago

@ke2g maybe in AS -> File -> Invalidate Cache / Restart will help.

fxkjd commented 9 years ago

@dmytrodanylyk done this, error still persists.

It's weird, because on a new project doesn't throw this error. Could it be an external config file like Gradle files?

dmytrodanylyk commented 9 years ago

@ke2g I sometimes see this error, but after re-build works fine for me. This is also library issue (there should be if statement to skip some code for preview..

fxkjd commented 9 years ago

Seems that deleting Gradle dependecies the problem disappears. So it's some kind of problem with my dependecies.

Anyway it's not a big bug or error. Closing.

thanks for all @dmytrodanylyk !