firebase / flutterfire

🔥 A collection of Firebase plugins for Flutter apps.
https://firebase.google.com/docs/flutter/setup
BSD 3-Clause "New" or "Revised" License
8.5k stars 3.92k forks source link

Initial task failed for action RecaptchaAction(action=getOobCode)with exception - An internal error has occurred. [ unexpected end of stream on com.android.okhttp.Address@80d85b16 ] #12884

Open JuYiYang opened 3 weeks ago

JuYiYang commented 3 weeks ago

Is there an existing issue for this?

Which plugins are affected?

Auth

Which platforms are affected?

Android

Description

I use flutter + firebase to develop, I had some errors using firebase's email login I have been in the AndroidManifest. XML configuration for android: usesCleartextTraffic = "true" still rerun this mistake, my firebase console Also enable email login Errors are as follows

I/FirebaseAuth(21869): Email link sign in for juyiyang@qq.com with empty reCAPTCHA token W/System (21869): Ignoring header X-Firebase-Locale because its value was null. W/LocalRequestInterceptor(21869): Error getting App Check token; using placeholder token instead. Error: com.google.firebase.FirebaseException: Too many attempts. Initial task failed for action RecaptchaAction(action=getOobCode)with exception - An internal error has occurred. [ unexpected end of stream on com.android.okhttp.Address@80d85b16 ]

Here are some of my configurations

AndroidManifest.xml

<manifest xmlns:android="http://schemas.android.com/apk/res/android">
    <application
        android:label="wallpaper_book"
        android:name="${applicationName}"
        android:usesCleartextTraffic="true"
        android:icon="@mipmap/ic_launcher">
        <activity ......

firebase console enter image description here

Reproducing the issue

FirebaseAuth.instance
    .sendSignInLinkToEmail(
        email: 'juyiyang@qq.com',
        actionCodeSettings: ActionCodeSettings(
            url: 'https://wallpaper-book.firebaseapp.com/__/auth/',
            // This must be true
            handleCodeInApp: true,
            // iOSBundleId: 'com.example.ios',
            androidPackageName: 'com.example.wallpaper_book',
            // installIfNotAvailable
            androidInstallApp: true,
            // minimumVersion
            androidMinimumVersion: '12'))
    .catchError((onError) {
  OtherUtils.showToastInfo('Error sending email verification $onError',
      backgroundColor: const Color(0xFF7c2eed), textColor: Colors.white);
}).then((value) {
  Loading.dismiss();
});

}

Firebase Core version

2.31.1

Flutter Version

3.19.6

Relevant Log Output

I/FirebaseAuth(21869): Email link sign in for juyiyang@qq.com with empty reCAPTCHA token
W/System  (21869): Ignoring header X-Firebase-Locale because its value was null.
D/TrafficStats(21869): tagSocket(133) with statsTag=0xffffffff, statsUid=-1
D/Linux   (21869): [Posix_connect Debug]Process com.example.wallpaper_book :9099 
E/RecaptchaCallWrapper(21869): Initial task failed for action RecaptchaAction(action=getOobCode)with exception - An internal error has occurred. [ unexpected end of stream on com.android.okhttp.Address@80d85b16 ]

Flutter dependencies

dependencies { // Import the Firebase BoM implementation platform('com.google.firebase:firebase-bom:33.0.0')

// TODO: Add the dependencies for Firebase products you want to use // When using the BoM, don't specify versions in Firebase dependencies implementation 'com.google.firebase:firebase-analytics'

// Add the dependency for the Firebase Authentication library
// When using the BoM, you don't specify versions in Firebase library dependencies
implementation("com.google.firebase:firebase-auth-ktx")

// Also add the dependency for the Google Play services library and specify its version
implementation("com.google.android.gms:play-services-auth:20.7.0")

// Add the dependencies for any other desired Firebase products // https://firebase.google.com/docs/android/setup#available-libraries }

Additional context and comments

No response

TarekkMA commented 3 weeks ago

Can you try to reproduce this issue again with the latest flutterfire packages?

JuYiYang commented 3 weeks ago

您能尝试使用最新的 flutterfire 包再次重现此问题吗?

Yes, I tried it with the latest version. Same result firebase_auth: ^5.0.0 firebase_core: ^3.0.0

TarekkMA commented 3 weeks ago

Does the same also happen to the flutter auth example app?

https://github.com/firebase/flutterfire/tree/master/packages/firebase_auth/firebase_auth/example

JuYiYang commented 3 weeks ago

Flutter auth 示例应用程序是否也发生同样的事情?

https://github.com/firebase/flutterfire/tree/master/packages/firebase_auth/firebase_auth/example

Yes the same, is not my computer environment problem image

JuYiYang commented 3 weeks ago

Flutter auth 示例应用程序是否也发现了一些有趣的事情?

https://github.com/firebase/flutterfire/tree/master/packages/firebase_auth/firebase_auth/example

My own projects as well as flutter_auth_example have no problem logging in with google

TarekkMA commented 2 weeks ago

So is the issue still happening or it has been solved? if so please indicate what was the solution as other users might find it useful.

JuYiYang commented 2 weeks ago

So is the issue still happening or it has been solved? if so please indicate what was the solution as other users might find it useful.

It did not solve, I just explained my current operation situation, running on my machine, using google login is OK, using email login will report an error

TarekkMA commented 4 days ago

Hello @JuYiYang, Can you please send a complete minimal running reproduction of this issue?

cheejiayuan512 commented 2 days ago

Facing the same issue as well.

cheejiayuan512 commented 2 days ago

@TarekkMA https://github.com/firebase/flutterfire/tree/master/packages/firebase_auth/firebase_auth/example the OP mentioned that the example for email link sign-in is facing the same issue, is that enough for a complete minimal running reproduction of the issue?

TarekkMA commented 1 day ago

@cheejiayuan512 @JuYiYang I wasn't able to replicate this issue with the example app. Maybe check if you are using the AppCheck plugin to set the token correctly?

cheejiayuan512 commented 1 day ago

Hi Tarekk, turns out it was user error. The email was sent to my spam folder which I did not check, and I needed to click on the link within the emulator itself instead of copypasting it from desktop to emulator. Not sure about OP, thank you!

TarekkMA commented 1 day ago

@cheejiayuan512 Glad that the issue is solved for you. We'll keep this issue open until the OP provides more insight on whether this solution also helped them or not.

JuYiYang commented 1 day ago

Hello @JuYiYang, Can you please send a complete minimal running reproduction of this issue?

Of course this file is only 80mb but I wonder why the hard disk is so big[https://drive.google.com/file/d/13C9L8HrL_BcoytNg89rO6Jn7AmW1XbO-/view?usp=drive_link](https://github.com/firebase/flutterfire/issues/url)