原因: 该应用程序尝试验证验证码并发送代码,为此它尝试启动浏览器,但是由于缺少实现,因此无法加载浏览器并导致应用程序崩溃.Im new to flutter and im trying to implement firebase phone authentication in my app. Once i enter the mobile number ,after 2 to 3 seconds, app closes abruptly.phoneAuth(number) async { await authInstance.verifyPhoneNumber( phoneNumber: "+91$number", verificationCompleted: (PhoneAuthCredential credentials) async { await authInstance .signInWithCredential(credentials) .then((UserCredential userCredentials) { Get.to(HomeScreen()); }); }, verificationFailed: (FirebaseAuthException e) { MyErrorPrinter.printError( error: e, errorTitle: "verification failed"); }, codeSent: (String verificationId, int resendToken) async { // Update the UI - wait for the user to enter the SMS code String smsCode; PhoneAuthCredential phoneAuthCredential; TextEditingController textController = TextEditingController(); Get.dialog( Container( height: 300, child: Column( children: [ TextField( controller: textController, ), RaisedButton( onPressed: () async { phoneAuthCredential = PhoneAuthProvider.credential( verificationId: verificationId, smsCode: smsCode); await authInstance .signInWithCredential(phoneAuthCredential) .then((value) => print( "[][][][][][] ------ fucking execute the route here")); }, ), ], ), ), ); // Sign the user in (or link) with the credential }, codeAutoRetrievalTimeout: (verficationId) {}); }The following the the logs from my console, after i have pressed the button that executes phoneAuth()W/IInputConnectionWrapper(19618): getTextBeforeCursor on inactive InputConnectionW/IInputConnectionWrapper(19618): getSelectedText on inactive InputConnectionW/IInputConnectionWrapper(19618): getTextAfterCursor on inactive InputConnectionE/zzf (19618): Problem retrieving SafetyNet Token: 7:I/Timeline(19618): Timeline: Activity_launch_request time:708035128W/ActivityThread(19618): handleWindowVisibility: no activity for token android.os.BinderProxy@ad00795D/ForceDarkHelper(19618): updateByCheckExcludeList: pkg: com.hstacks.vigorous activity: com.google.firebase.auth.internal.RecaptchaActivity@ea08e50I/chatty (19618): uid=10314(com.hstacks.vigorous) identical 1 lineD/ForceDarkHelper(19618): updateByCheckExcludeList: pkg: com.hstacks.vigorous activity: com.google.firebase.auth.internal.RecaptchaActivity@ea08e50W/stacks.vigorou(19618): Accessing hidden method Lsun/misc/Unsafe;->getInt(Ljava/lang/Object;J)I (greylist, linking, allowed)W/stacks.vigorou(19618): Accessing hidden method Lsun/misc/Unsafe;->getObject(Ljava/lang/Object;J)Ljava/lang/Object; (greylist, linking, allowed)W/stacks.vigorou(19618): Accessing hidden method Lsun/misc/Unsafe;->getLong(Ljava/lang/Object;J)J (greylist,core-platform-api, linking, allowed)W/stacks.vigorou(19618): Accessing hidden method Lsun/misc/Unsafe;->objectFieldOffset(Ljava/lang/reflect/Field;)J (greylist,core-platform-api, linking, allowed)W/stacks.vigorou(19618): Accessing hidden method Lsun/misc/Unsafe;->putObject(Ljava/lang/Object;JLjava/lang/Object;)V (greylist, linking, allowed)W/stacks.vigorou(19618): Accessing hidden method Lsun/misc/Unsafe;->putInt(Ljava/lang/Object;JI)V (greylist, linking, allowed)I/chatty (19618): uid=10314(com.hstacks.vigorous) identical 1 lineW/stacks.vigorou(19618): Accessing hidden method Lsun/misc/Unsafe;->putInt(Ljava/lang/Object;JI)V (greylist, linking, allowed)W/stacks.vigorou(19618): Accessing hidden method Lsun/misc/Unsafe;->putLong(Ljava/lang/Object;JJ)V (greylist, linking, allowed)W/stacks.vigorou(19618): Accessing hidden method Lsun/misc/Unsafe;->putInt(Ljava/lang/Object;JI)V (greylist, linking, allowed)W/stacks.vigorou(19618): Accessing hidden method Lsun/misc/Unsafe;->allocateInstance(Ljava/lang/Class;)Ljava/lang/Object; (greylist, linking, allowed)W/stacks.vigorou(19618): Accessing hidden method Llibcore/io/Memory;->peekLong(JZ)J (greylist, reflection, allowed)W/stacks.vigorou(19618): Accessing hidden method Llibcore/io/Memory;->pokeLong(JJZ)V (greylist, reflection, allowed)W/stacks.vigorou(19618): Accessing hidden method Llibcore/io/Memory;->pokeInt(JIZ)V (greylist, reflection, allowed)W/stacks.vigorou(19618): Accessing hidden method Llibcore/io/Memory;->peekInt(JZ)I (greylist, reflection, allowed)W/stacks.vigorou(19618): Accessing hidden method Llibcore/io/Memory;->pokeByte(JB)V (greylist, reflection, allowed)W/stacks.vigorou(19618): Accessing hidden method Llibcore/io/Memory;->peekByte(J)B (greylist, reflection, allowed)W/stacks.vigorou(19618): Accessing hidden method Llibcore/io/Memory;->pokeByteArray(J[BII)V (greylist, reflection, allowed)W/stacks.vigorou(19618): Accessing hidden method Llibcore/io/Memory;->peekByteArray(J[BII)V (greylist, reflection, allowed)W/stacks.vigorou(19618): Accessing hidden method Lsun/misc/Unsafe;->arrayBaseOffset(Ljava/lang/Class;)I (greylist,core-platform-api, linking, allowed)W/stacks.vigorou(19618): Accessing hidden method Lsun/misc/Unsafe;->arrayIndexScale(Ljava/lang/Class;)I (greylist, linking, allowed)W/stacks.vigorou(19618): Accessing hidden method Lsun/misc/Unsafe;->getLong(Ljava/lang/Object;J)J (greylist,core-platform-api, reflection, allowed)W/stacks.vigorou(19618): Accessing hidden field Ljava/nio/Buffer;->address:J (greylist, reflection, allowed)W/stacks.vigorou(19618): Accessing hidden method Lsun/misc/Unsafe;->getInt(Ljava/lang/Object;J)I (greylist, reflection, allowed)W/stacks.vigorou(19618): Accessing hidden method Lsun/misc/Unsafe;->putInt(Ljava/lang/Object;JI)V (greylist, reflection, allowed)W/stacks.vigorou(19618): Accessing hidden method Lsun/misc/Unsafe;->getLong(Ljava/lang/Object;J)J (greylist,core-platform-api, reflection, allowed)W/stacks.vigorou(19618): Accessing hidden method Lsun/misc/Unsafe;->putLong(Ljava/lang/Object;JJ)V (greylist, reflection, allowed)W/stacks.vigorou(19618): Accessing hidden method Lsun/misc/Unsafe;->getObject(Ljava/lang/Object;J)Ljava/lang/Object; (greylist, reflection, allowed)W/stacks.vigorou(19618): Accessing hidden method Lsun/misc/Unsafe;->putObject(Ljava/lang/Object;JLjava/lang/Object;)V (greylist, reflection, allowed)2W/stacks.vigorou(19618): Accessing hidden method Lsun/misc/Unsafe;->getInt(Ljava/lang/Object;J)I (greylist, linking, allowed)W/stacks.vigorou(19618): Accessing hidden method Lsun/misc/Unsafe;->getObject(Ljava/lang/Object;J)Ljava/lang/Object; (greylist, linking, allowed)W/stacks.vigorou(19618): Accessing hidden method Lsun/misc/Unsafe;->getInt(Ljava/lang/Object;J)I (greylist, linking, allowed)I/chatty (19618): uid=10314(com.hstacks.vigorous) identical 1 lineW/stacks.vigorou(19618): Accessing hidden method Lsun/misc/Unsafe;->getInt(Ljava/lang/Object;J)I (greylist, linking, allowed)W/stacks.vigorou(19618): Accessing hidden method Lsun/misc/Unsafe;->putObject(Ljava/lang/Object;JLjava/lang/Object;)V (greylist, linking, allowed)W/stacks.vigorou(19618): Accessing hidden method Lsun/misc/Unsafe;->putInt(Ljava/lang/Object;JI)V (greylist, linking, allowed)W/stacks.vigorou(19618): Accessing hidden method Lsun/misc/Unsafe;->getInt(Ljava/lang/Object;J)I (greylist, linking, allowed)2W/stacks.vigorou(19618): Accessing hidden method Lsun/misc/Unsafe;->putObject(Ljava/lang/Object;JLjava/lang/Object;)V (greylist, linking, allowed)I/zzkn (19618): Provider GmsCore_OpenSSL not availableW/stacks.vigorou(19618): Accessing hidden method Lsun/misc/Unsafe;->putObject(Ljava/lang/Object;JLjava/lang/Object;)V (greylist, linking, allowed)V/PhoneWindow(19618): DecorView setVisiblity: visibility = 4, Parent = null, this = DecorView@1b3435e[]D/ViewRootImpl[RecaptchaActivity](19618): hardware acceleration = true , fakeHwAccelerated = false, sRendererDisabled = false, forceHwAccelerated = false, sSystemRendererDisabled = falseV/PhoneWindow(19618): DecorView setVisiblity: visibility = 0, Parent = android.view.ViewRootImpl@521d155, this = DecorView@1b3435e[RecaptchaActivity]W/System (19618): Ignoring header X-Firebase-Locale because its value was null.I/System.out(19618): [okhttp]:check permission begin!W/System (19618): ClassLoader referenced unknown path: system/framework/mediatek-cta.jarI/System.out(19618): [okhttp] e:java.lang.ClassNotFoundException: com.mediatek.cta.CtaUtilsI/System.out(19618): [socket]:check permission begin!W/System (19618): ClassLoader referenced unknown path: system/framework/mediatek-cta.jarI/System.out(19618): [socket] e:java.lang.ClassNotFoundException: com.mediatek.cta.CtaUtilsE/GraphicExt(19618): GraphicExtModuleLoader::CreateGraphicExtInstance falseD/Surface (19618): Surface::connect(this=0x7ba794c000,api=1)D/mali_winsys(19618): EGLint new_window_surface(egl_winsys_display *, void *, EGLSurface, EGLConfig, egl_winsys_surface **, EGLBoolean) returns 0x3000D/Surface (19618): Surface::setBufferCount(this=0x7ba794c000,bufferCount=3)D/Surface (19618): Surface::allocateBuffers(this=0x7ba794c000)I/System.out(19618): [OkHttp] sendRequest>>I/System.out(19618): [OkHttp] sendRequest<<D/AndroidRuntime(19618): Shutting down VME/AndroidRuntime(19618): FATAL EXCEPTION: mainE/AndroidRuntime(19618): Process: com.hstacks.vigorous, PID: 19618E/AndroidRuntime(19618): java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/browser/customtabs/CustomTabsIntent$Builder;E/AndroidRuntime(19618): at com.google.firebase.auth.internal.RecaptchaActivity.zza(com.google.firebase:firebase-auth@@20.0.2:13)E/AndroidRuntime(19618): at com.google.android.gms.internal.firebase-auth-api.zztw.zzb(com.google.firebase:firebase-auth@@20.0.2:7)E/AndroidRuntime(19618): at com.google.android.gms.internal.firebase-auth-api.zztw.onPostExecute(Unknown Source:2)E/AndroidRuntime(19618): at android.os.AsyncTask.finish(AsyncTask.java:755)E/AndroidRuntime(19618): at android.os.AsyncTask.access$900(AsyncTask.java:192)E/AndroidRuntime(19618): at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:772)E/AndroidRuntime(19618): at android.os.Handler.dispatchMessage(Handler.java:107)E/AndroidRuntime(19618): at android.os.Looper.loop(Looper.java:224)E/AndroidRuntime(19618): at android.app.ActivityThread.main(ActivityThread.java:7551)E/AndroidRuntime(19618): at java.lang.reflect.Method.invoke(Native Method)E/AndroidRuntime(19618): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)E/AndroidRuntime(19618): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:995)E/AndroidRuntime(19618): Caused by: java.lang.ClassNotFoundException: Didn't find class "androidx.browser.customtabs.CustomTabsIntent$Builder" on path: DexPathList[[zip file "/data/app/com.hstacks.vigorous-Squ6-rnc2y8vbv9T1Nrxew==/base.apk"],nativeLibraryDirectories=[/data/app/com.hstacks.vigorous-Squ6-rnc2y8vbv9T1Nrxew==/lib/arm64, /data/app/com.hstacks.vigorous-Squ6-rnc2y8vbv9T1Nrxew==/base.apk!/lib/arm64-v8a, /system/lib64, /system/product/lib64]]E/AndroidRuntime(19618): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:196)E/AndroidRuntime(19618): at java.lang.ClassLoader.loadClass(ClassLoader.java:379)E/AndroidRuntime(19618): at java.lang.ClassLoader.loadClass(ClassLoader.java:312)E/AndroidRuntime(19618): ... 12 moreI/Process (19618): Sending signal. PID: 19618 SIG: 9Lost connection to device.Exited (sigterm)NOTE :vigorous is the app name, hstacks is the organisation name and hence the package name com.hstacks.vogorousim stuck with for two days and still .Any help will be greatly appreciated ! 解决方案 I faced the same issue for several days. Recently Firebase have updated certain things one of them is they have included captcha verification before sending the code or OTP.To solve this issue :add the following to project/android/app/build.gradleimplementation "androidx.browser:browser:1.3.0"add this in the dependencies section ...dependencies {implementation "androidx.browser:browser:1.3.0"///}you can find the latest version here: android browser .REASON:The app tries to verify the captcha and send the code, for that it tries to launch a browser but because of the missing implementation it fails to load a browser and crashes the application. 这篇关于Flutter Firebase电话身份验证问题.应用突然关闭的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-02 01:52