android.view.InflateException:二进制XML文件行:错误输出类com.facebook.widget.LoginButton

时间:2014-10-01 13:55:17

标签: android facebook

我使用facebook sdk 3.19.0作为库在Android应用程序上工作,它工作正常。

现在我想在Google Play上发布该应用,所以我开始将facebook sdk转换为jar文件并将其添加到我的项目中。但我得到这个错误:

  

android.view.InflateException:二进制XML文件行#96:错误   inflating class com.facebook.widget.LoginButton

10-01 12:03:24.591: E/AndroidRuntime(30559): FATAL EXCEPTION: main
10-01 12:03:24.591: E/AndroidRuntime(30559): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.moroccotd.mtd/com.moroccotd.mtd.MainActivity}: android.view.InflateException: Binary XML file line #96: Error inflating class com.facebook.widget.LoginButton
10-01 12:03:24.591: E/AndroidRuntime(30559):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2114)
10-01 12:03:24.591: E/AndroidRuntime(30559):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2139)
10-01 12:03:24.591: E/AndroidRuntime(30559):    at android.app.ActivityThread.access$700(ActivityThread.java:143)
10-01 12:03:24.591: E/AndroidRuntime(30559):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1241)
10-01 12:03:24.591: E/AndroidRuntime(30559):    at android.os.Handler.dispatchMessage(Handler.java:99)
10-01 12:03:24.591: E/AndroidRuntime(30559):    at android.os.Looper.loop(Looper.java:137)
10-01 12:03:24.591: E/AndroidRuntime(30559):    at android.app.ActivityThread.main(ActivityThread.java:4960)
10-01 12:03:24.591: E/AndroidRuntime(30559):    at java.lang.reflect.Method.invokeNative(Native Method)
10-01 12:03:24.591: E/AndroidRuntime(30559):    at java.lang.reflect.Method.invoke(Method.java:511)
10-01 12:03:24.591: E/AndroidRuntime(30559):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1038)
10-01 12:03:24.591: E/AndroidRuntime(30559):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:805)
10-01 12:03:24.591: E/AndroidRuntime(30559):    at dalvik.system.NativeStart.main(Native Method)
10-01 12:03:24.591: E/AndroidRuntime(30559): Caused by: android.view.InflateException: Binary XML file line #96: Error inflating class com.facebook.widget.LoginButton
10-01 12:03:24.591: E/AndroidRuntime(30559):    at android.view.LayoutInflater.createView(LayoutInflater.java:619)
10-01 12:03:24.591: E/AndroidRuntime(30559):    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:693)
10-01 12:03:24.591: E/AndroidRuntime(30559):    at android.view.LayoutInflater.rInflate(LayoutInflater.java:752)
10-01 12:03:24.591: E/AndroidRuntime(30559):    at android.view.LayoutInflater.rInflate(LayoutInflater.java:760)
10-01 12:03:24.591: E/AndroidRuntime(30559):    at android.view.LayoutInflater.rInflate(LayoutInflater.java:760)
10-01 12:03:24.591: E/AndroidRuntime(30559):    at android.view.LayoutInflater.inflate(LayoutInflater.java:495)
10-01 12:03:24.591: E/AndroidRuntime(30559):    at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
10-01 12:03:24.591: E/AndroidRuntime(30559):    at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
10-01 12:03:24.591: E/AndroidRuntime(30559):    at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:318)
10-01 12:03:24.591: E/AndroidRuntime(30559):    at android.app.Activity.setContentView(Activity.java:1925)
10-01 12:03:24.591: E/AndroidRuntime(30559):    at com.moroccotd.mtd.MainActivity.onCreate(MainActivity.java:47)
10-01 12:03:24.591: E/AndroidRuntime(30559):    at android.app.Activity.performCreate(Activity.java:5203)
10-01 12:03:24.591: E/AndroidRuntime(30559):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1094)
10-01 12:03:24.591: E/AndroidRuntime(30559):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2078)
10-01 12:03:24.591: E/AndroidRuntime(30559):    ... 11 more
10-01 12:03:24.591: E/AndroidRuntime(30559): Caused by: java.lang.reflect.InvocationTargetException
10-01 12:03:24.591: E/AndroidRuntime(30559):    at java.lang.reflect.Constructor.constructNative(Native Method)
10-01 12:03:24.591: E/AndroidRuntime(30559):    at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
10-01 12:03:24.591: E/AndroidRuntime(30559):    at android.view.LayoutInflater.createView(LayoutInflater.java:593)
10-01 12:03:24.591: E/AndroidRuntime(30559):    ... 24 more
10-01 12:03:24.591: E/AndroidRuntime(30559): Caused by: android.content.res.Resources$NotFoundException: File Activer services Google Play from drawable resource ID #0x7f060006: .xml extension required
10-01 12:03:24.591: E/AndroidRuntime(30559):    at android.content.res.Resources.loadColorStateList(Resources.java:2947)
10-01 12:03:24.591: E/AndroidRuntime(30559):    at android.content.res.Resources.getColor(Resources.java:1619)
10-01 12:03:24.591: E/AndroidRuntime(30559):    at com.facebook.widget.LoginButton.<init>(LoginButton.java:210)
10-01 12:03:24.591: E/AndroidRuntime(30559):    ... 27 more

Xml文件:

<com.facebook.widget.LoginButton
            android:id="@+id/btn_fcb_login"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="10dip"
            android:text="@string/login_fcb_btn" />

有人可以解释为什么会出现这种错误吗?关于我哪里出错的任何线索?

1 个答案:

答案 0 :(得分:0)

我认为您需要使用片段代替活动。