Tôi có một dự án sử dụng firebase và thư viện auth ui firebase. Vấn đề là tôi không thể đăng nhập bằng cách sử dụng đăng nhập bằng Google, khi tôi thử tải trong một hoặc hai giây và sau đó chỉ hiển thị thông báo chúc mừng "Lỗi nhà phát triển". Tôi có thể đăng nhập bằng email và mật khẩu tốt. Và đây chỉ là vấn đề về các apks đã ký, khi tôi gỡ lỗi Google, đăng nhập hoạt động tốt.Firebase Auth Ui Google Đăng nhập "Lỗi nhà phát triển"
Trong proguard-rules.pro của tôi, tôi đã đặt minifyEnabled thành false.
Và tôi đã thêm dự án SHA-1 vào dự án Firebase của mình và đã tải xuống tệp json đúng.
phụ thuộc khối từ cấp ứng dụng build.gradle
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:26.0.2'
compile 'com.android.support:design:26.0.2'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:design:26.0.2'
compile 'com.android.support:cardview-v7:26.0.2'
compile 'com.google.firebase:firebase-database:11.4.2'
compile 'com.google.firebase:firebase-auth:11.4.2'
compile 'com.firebaseui:firebase-ui-auth:3.1.0'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
đây là AuthStateListener tôi
mAuthStateListener = new FirebaseAuth.AuthStateListener() {
@Override
public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) {
FirebaseUser user = firebaseAuth.getCurrentUser();
if (user != null) {
signedInInitialized();
} else {
signedOutCleanUp();
startActivityForResult(
AuthUI.getInstance()
.createSignInIntentBuilder()
.setTheme(R.style.FirebaseSignInTheme)
.setIsSmartLockEnabled(false)
.setAvailableProviders(
Arrays.asList(new AuthUI.IdpConfig.Builder(AuthUI.EMAIL_PROVIDER).build(),
new AuthUI.IdpConfig.Builder(AuthUI.GOOGLE_PROVIDER).build()))
.build(),
RC_SIGN_IN);
}
}
};
Các logcat cho thấy không có lỗi hoặc bất cứ điều gì. Tôi sẽ đăng các logcat khi điều này xảy ra nhưng tôi không biết làm thế nào để có được các logcat từ một apk đã ký gây ra điều này chỉ xảy ra khi ký apk.
Tôi đã cố gắng tìm ra điều này trong nhiều ngày nhưng dường như không có cách nào.
Cảm ơn
Cảm ơn rất nhiều !! –
Vui vì tôi có thể giúp. :) –
Tôi đã thêm cả Debug và Release SHA1 nhưng vẫn còn, nó không hoạt động. Tuy nhiên, nó hoạt động trong Debug Mod. –