fresco: Error inflating class com.facebook.drawee.view.SimpleDraweeView
Hi. I’ve tried to inflate this guy on adapter, but don’t work! I’m using the last version.
<com.facebook.drawee.view.SimpleDraweeView
android:id="@+id/camera_image"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:placeholderImage="@mipmap/ic_launcher"/>
android.view.InflateException: Binary XML file line #7: Error inflating class com.facebook.drawee.view.SimpleDraweeView…
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Comments: 29 (2 by maintainers)
I hava the same trouble~
Solve Method
You should only call
Fresco.initializeonce. Your Application class would be a good place. Doing it in each Activity is wrong.@ppamorim I have solve this problem. add :Fresco.initialize(this); to your Application.
ok,I solved it. just put
above
and ,it works now.
This is so tricky. The error message seems totally irrelevant with the solution.
In my case writing
Fresco.initialize(this);beforesetContentView(R.layout.activity_home);workedIs there anything else in the error message? That should probably be
fb:placeholderImage=instead ofapp:placeholderImage=you guys sure you registered the application in the manifest? its a small step,but your context wont be valid when you try to init Fresco without
android:name="your application name"