在我的活动
.xml
文件中,我包含了Facebook登录按钮(来自此文档)。 <com.facebook.login.widget.LoginButton
android:id="@+id/login_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="30dp"
android:layout_marginBottom="30dp" />
立即收到一个警告,提示
The following classes could not be found:
- com.facebook.login.widget.LoginButton
文档中指出:
使用完整的类名 com.facebook.widget.LoginButton,在布局 XML 文件中添加按钮。
但修改顶部行并没有任何效果。应用程序立即崩溃,无法打开,并且在日志记录中没有任何内容(在外部设备上进行测试)。
如果移除该按钮,或将其更改为
<Button
android:id="@+id/login_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="30dp"
android:layout_marginBottom="30dp" />
这样做可以防止崩溃,但这是我第一次使用Facebook SDK,不确定普通按钮是否有效。
提前致谢。