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...
Is there anything else in the error message? That should probably be fb:placeholderImage= instead of app:placeholderImage=
@IanChilds, This hasn't relation with the problem. If I remove this line, the problem still happens.
<com.facebook.drawee.view.SimpleDraweeView
android:layout_gravity="center"
android:layout_height="100dp"
android:layout_width="100dp"
android:background="@color/white"
android:id="@+id/cover"/>
android.view.InflateException: Binary XML file line #13: Error inflating class com.facebook.drawee.view.SimpleDraweeView
at android.view.LayoutInflater.createView(LayoutInflater.java:620)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:696)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)
at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
I hava the same trouble~
Solve Method
You should only call Fresco.initialize once. Your Application class would be a good place. Doing it in each Activity is wrong.
add :
Fresco.initialize(this);to your Application class.
@ppamorim I have solve this problem. add :Fresco.initialize(this); to your Application.
Thanks for your response andforce
it's right
This is so tricky. The error message seems totally irrelevant with the solution.
I have placed the Fresco.initialize(this); in my application, but still error is there...
@Override protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Fresco.initialize(this);
setContentView(R.layout.activity_main);
Uri uri = Uri.parse("https://raw.githubusercontent.com/facebook/fresco/gh-pages/static/fresco-logo.png");
SimpleDraweeView draweeView = (SimpleDraweeView) findViewById(R.id.my_image_view);
draweeView.setImageURI(uri);
}
Above is the code... Please Please Please Help me Friends...
In case you want to implement using a fragment as would be? I have the same problem as everyone else. Best Regards!
Is this the same stack trace as issue #395?
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"
I have the same problem too~how can i solve it?
ok,I solved it. just put
Fresco.initialize(this);
above
setContentView(R.layout.activity_main);
and ,it works now.
thanks it worked
@ManMegh @vivian8725118 You should only call Fresco.initialize once. Your Application class would be a good place. Doing it in each Activity is wrong.
Thanks bro worked perfectly though not using fresco am using picasso. Regards
On Fri, Oct 9, 2015 at 7:32 AM, andforce [email protected] wrote:
@ManMegh https://github.com/ManMegh @vivian8725118 https://github.com/vivian8725118 You should only call Fresco.initialize once. Your Application class would be a good place. Doing it in each Activity is wrong.
— Reply to this email directly or view it on GitHub https://github.com/facebook/fresco/issues/74#issuecomment-146753597.
ssup bro,
I would like more of your tutorials how can i get them. Regards
On Sat, Oct 10, 2015 at 11:07 AM, christopher pius ndugo < [email protected]> wrote:
Thanks bro worked perfectly though not using fresco am using picasso. Regards
On Fri, Oct 9, 2015 at 7:32 AM, andforce [email protected] wrote:
@ManMegh https://github.com/ManMegh @vivian8725118 https://github.com/vivian8725118 You should only call Fresco.initialize once. Your Application class would be a good place. Doing it in each Activity is wrong.
— Reply to this email directly or view it on GitHub https://github.com/facebook/fresco/issues/74#issuecomment-146753597.
In my case writing Fresco.initialize(this); before setContentView(R.layout.activity_home); worked
My problem was not specifing the whole path com.facebook.drawee.view.SimpleDraweeView (I had just SimpleDraweeView). IF that is not your case, check the line of XML file on which the error occured.
I have the same problem and none of the solutions above is working for me.