类com.facebook.drawee.view.SimpleDraweeView出错时出错

Bog*_*iel 7 android facebook fresco

我正在尝试使用壁画库.我之前也使用它并且它正在工作,但现在,由于某种原因,我得到:

Unable to start activity ComponentInfo{com.example.home.template/com.example.home.template.MainActivity}: android.view.InflateException: Binary XML file line #26: Error inflating class com.facebook.drawee.view.SimpleDraweeView
Run Code Online (Sandbox Code Playgroud)

我的xml文件:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              xmlns:fresco="http://schemas.android.com/apk/res-auto"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:orientation="vertical">


<com.facebook.drawee.view.SimpleDraweeView
        android:id="@+id/profileImage"
        fresco:actualImageScaleType="centerCrop"
        android:layout_width="200dp"
        android:layout_gravity="center_horizontal"
        android:layout_height="200dp" />
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)

我的应用程序:

public class MyApplication extends Application {

    @Override
    public void onCreate() {
        super.onCreate();
        FacebookSdk.sdkInitialize(this);
    }
}
Run Code Online (Sandbox Code Playgroud)

我在我的清单中有它: android:name=".MyApplication"

我遇到的唯一问题是draweeview.我可以做所有其他的事情,比如登录和获取信息.

Mou*_*ssi 12

在我的案例写作Fresco.initialize(this);之前setContentView(R.layout.myxml);帮助了我.

更新:

你有FacebookSdk.sdkInitialize(this);而不是Fresco.initialize(this)在你的myapplication