我们正在尝试使用Facebook的帐户套件让我们的Android用户使用他们的电话号码登录。
当用户点击按钮打开登录屏幕时,我们会收到以下错误:
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.facebook.accountkit.R$attr" on path: DexPathList[[zip file "/data/app/XXX.XXX-2/base.apk"],nativeLibraryDirectories=[/data/app/XXX.XXX-2/lib/arm, /data/app/XXX.XXX-2/base.apk!/lib/armeabi-v7a, /vendor/lib, /system/lib]]
按钮的代码是:
final Intent intent = new Intent(activity, AccountKitActivity.class);
AccountKitConfiguration.AccountKitConfigurationBuilder configurationBuilder =
new AccountKitConfiguration.AccountKitConfigurationBuilder(
LoginType.PHONE,
AccountKit
Activity.ResponseType.CODE); // or .ResponseType.TOKEN
// ... perform additional configuration ...
intent.putExtra(
AccountKitActivity.ACCOUNT_KIT_ACTIVITY_CONFIGURATION,
configurationBuilder.build());
startActivityForResult(intent, APP_REQUEST_CODE);
AccountKit.getCurrentAccount(new AccountKitCallback<Account>() {
@Override
public void onSuccess(final Account account) {
String accountKitId = account.getId();
PhoneNumber phoneNumber = account.getPhoneNumber();
String phoneNumberString = phoneNumber.toString();
Log.e("ACCOUNT KIT : phone number",":"+phoneNumberString);
}
@Override
public void onError(final AccountKitError error) {
// Handle Error
}
});
你能帮忙吗?
由于
答案 0 :(得分:0)
只需更改AccountKitActivity.ResponseType.CODE); to AccountKitActivity.ResponseType.TOKEN);