Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error inflating class de.hdodenhof.circleimageview.CircleImageView #384

Closed
dreamguagua opened this issue Jun 2, 2020 · 9 comments
Closed

Comments

@dreamguagua
Copy link

user Android viewBind cause:
Binary XML file line #23 in com.nowcoder.app.florida:layout/view_header: Error inflating class de.hdodenhof.circleimageview.CircleImageView

How can I fix it?

@dreamguagua
Copy link
Author

Cause when using ViewBind

@fanglingfei
Copy link

+1,the same problem

@fanglingfei
Copy link

you can fix it by remove : scaleType ,or just use centerCrop

@hdodenhof
Copy link
Owner

@dreamguagua please provide the full stack trace of that exception. There's no way to figure out what's wrong without it. Thanks!

@wahdatjan
Copy link

android.view.InflateException: Binary XML file line #8: Binary XML file line #8: Error inflating class de.hdodenhof.circleimageview.CircleImageView
Caused by: android.view.InflateException: Binary XML file line #8: Error inflating class de.hdodenhof.circleimageview.CircleImageView
Caused by: java.lang.reflect.InvocationTargetException

@wahdatjan
Copy link

I think its happenning because of using scaleType=fitXY which is not supported by the library

@hdodenhof
Copy link
Owner

It sure is a possibility, but it could also be a couple of other things. As said before: impossible to tell without a full stackstrace like the attached example. I'll close this until more details are provided.

Error inflating class de.hdodenhof.circleimageview.CircleImageView
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
    at android.app.ActivityThread.-wrap11(ActivityThread.java)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:148)
    at android.app.ActivityThread.main(ActivityThread.java:5417)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by: android.view.InflateException: Binary XML file line #15: Binary XML file line #15: Error inflating class de.hdodenhof.circleimageview.CircleImageView
    at android.view.LayoutInflater.inflate(LayoutInflater.java:539)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
    at com.android.internal.policy.PhoneWindow.setContentView(PhoneWindow.java:393)
    at android.app.Activity.setContentView(Activity.java:2166)
    at de.hdodenhof.circleimageview.sample.MainActivity.onCreate(MainActivity.java:11)
    at android.app.Activity.performCreate(Activity.java:6237)
    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
    ... 9 more
Caused by: android.view.InflateException: Binary XML file line #15: Error inflating class de.hdodenhof.circleimageview.CircleImageView
    at android.view.LayoutInflater.createView(LayoutInflater.java:645)
    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:764)
    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:835)
    at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:838)
    at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
    ... 17 more
Caused by: java.lang.reflect.InvocationTargetException
    at java.lang.reflect.Constructor.newInstance(Native Method)
    at android.view.LayoutInflater.createView(LayoutInflater.java:619)
    ... 24 more
Caused by: java.lang.IllegalArgumentException: ScaleType FIT_XY not supported.
    at de.hdodenhof.circleimageview.CircleImageView.setScaleType(CircleImageView.java:143)
    at android.widget.ImageView.<init>(ImageView.java:175)
    at android.widget.ImageView.<init>(ImageView.java:140)
    at de.hdodenhof.circleimageview.CircleImageView.<init>(CircleImageView.java:101)
    at de.hdodenhof.circleimageview.CircleImageView.<init>(CircleImageView.java:97)

@dreamguagua
Copy link
Author

I think its happenning because of using scaleType=fitXY which is not supported by the library

yes !

@dreamguagua
Copy link
Author

you can fix it by remove : scaleType ,or just use centerCrop

That's ok,Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants