справочная информация < /h4>
Я использую подлинность данных Firebase Data Connect и Firebase в моем приложении Android. У меня также есть интегрированная проверка приложений Firebase, но в настоящее время он установлен в Undforced Mode. Я проверяю это, подтвердив firebase.auth.currentuser! = Null Когда мое приложение устранение. Зарегистрирует следующую ошибку GRPC: < /p>
Fatal Exception: e9.p0: UNAUTHENTICATED: unauthenticated: this operation requires a signed-in user
at io.grpc.Status.asException(Status.java:548)
at io.grpc.kotlin.ClientCalls$rpcImpl$1$1$1.onClose(ClientCalls.kt:300)
at io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:574)
at io.grpc.internal.ClientCallImpl.access$300(ClientCallImpl.java:72)
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInternal(ClientCallImpl.java:742)
at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:723)
at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)
at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:133)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
at com.google.firebase.concurrent.CustomThreadFactory.lambda$newThread$0(CustomThreadFactory.java:47)
at java.lang.Thread.run(Thread.java:1012)
< /code>
Эта ошибка прерывита, и я не смог найти последовательный способ ее воспроизведения. < /p>
Соответствующий код < /h4>
Трассия стека, приведенная выше, не ссылается на какие -либо из моих конкретных классов приложения или методов, непосредственно связанных с инициацией вызова данных. Он указывает на внутренние классы io.grpc и com.google.firebase.concurrent, предполагая, что сбой возникает глубже в уровне Firebase SDK или GRPC во время аутентифицированной обработки запросов. error seems internal and the Data Connect functions are auto-generated, I'm unsure which specific parts of my code are most relevant to debugging this UNAUTHENTICATED error.
If specific parts of my code would be helpful, please let me know in the comments, and I will update the question with the relevant snippets.
Requested code
Checking for user Аутентификация < /h6>
data class UserData(
val userId: String,
val username: String?,
val profilePictureUrl: String?
)
class GoogleAuthUiClient(
private val context: Context,
) {
private val auth = Firebase.auth
// Gets the signed in user details
fun getSignedInUser() = auth.currentUser?.run {
UserData(uid, displayName, photoUrl?.toString())
}
// Some other functions for signing in with CredentialManager...
}
< /code>
// Main app composable with some irrelevant code removed
// Checks if user is null to show Home screen for logged in users
// and Onboarding (Login) screen for users that are not logged in
@Composable
fun MyApp(
lifecycleScope: LifecycleCoroutineScope,
googleAuthUiClient: GoogleAuthUiClient,
application: android.app.Application
) {
val navController = rememberNavController()
val user = googleAuthUiClient.getSignedInUser()
if (user != null) {
DataConnectRepository.updateSignInInfo(user.username)
}
val startDestination =
if (user != null) {
Home
} else {
Onboarding
}
MyAppNavHost(
startDestination = startDestination,
lifecycleScope = lifecycleScope,
googleAuthUiClient = googleAuthUiClient
)
}
< /code>
What I've Tried:
- Logging Auth State: I've added logging to confirm that Firebase.auth.currentUser is indeed non-null and contains a valid user UID immediately before the Data Connect call is made, even in instances where the call subsequently fails with UNAUTHENTICATED.
- App Check: Verified that App Check is in unenforced mode, so it should not be blocking requests for any reason.
- Ensured I am using the latest libraries: Firebase Data Connect SDK version 16.0.1, Firebase BOM version 33.13.0
Подробнее здесь: https://stackoverflow.com/questions/796 ... er-error-w
Мобильная версия