Tôi cố gắng kiểm tra đăng nhập bằng facebook SDK.Android Studio 1.1.0 Facebook SDK Đăng nhập
Vì vậy, tôi thêm với compile 'com.facebook.android:facebook-android-sdk:4.0.0'
.
Sau đó thêm FacebookSdk.sdkInitialize(getApplicationContext());
để MainActivity.java
Nhưng khi tôi thêm
<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" />`
Tôi đã này lỗi sau:
Rendering Problems The following classes could not be instantiated:
com.facebook.login.widget.LoginButton (Open Class, Show Exception)
Tip: Use View.isInEditMode() in your custom views to skip code or show sample data when shown in the IDE
Exception Details java.lang.NoClassDefFoundError: Could not initialize class com.facebook.login.widget.LoginButton
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:806)
at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:782)
at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
at android.view.LayoutInflater.inflate(LayoutInflater.java:385) Copy stack to clipboard
Ồ vâng nó hoạt động, cảm ơn! :) – Nathan30
Nhưng nó gây phiền toái cho vấn đề hiển thị, không có giải pháp cho điều này? – Nathan30
Tôi không chắc chắn bây giờ làm thế nào tôi có thể tránh điều này ... bởi vì bạn đang phải là rất khó chịu. Nếu tôi tìm thấy một cách, tôi sẽ cập nhật câu trả lời. –