Skip to content

Revise 'Enabling Firebase emulators' page as FirebaseAuthException due to Cleartext HTTP traffic #7939

Open
@stevenrobson

Description

@stevenrobson

Page URL

https://firebase.google.com/codelabs/get-started-firebase-emulators-and-flutter#3

Page source

No response

Describe the problem

Cleartext over http is now disabled by default. This causes the following exception to be thrown when the developer uses the published emulator Codelabs as guides when creating new projects of their own. The exception is thrown when the user executes the method FirebaseAuth.instance.signInWithEmailAndPassword()

Exception has occurred.
FirebaseAuthException ([firebase_auth/unknown] com.google.firebase.FirebaseException: An internal error has occurred. [ Cleartext HTTP traffic to 10.0.2.2 not permitted ])

Expected fix

Instruct the developer to perform the following.

  1. Add the following to: android\app\src\main\AndroidManifest.xml
   <application
        android:networkSecurityConfig="@xml/network_security_config"
  1. Create the following directory if it doesn't exist: android\app\src\main\res\xml
  2. Create a file in the xml directory named: network_security_config.xml
  3. Add the following XML to android\app\src\main\res\xml\network_security_config.xml
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
    <base-config cleartextTrafficPermitted="false" >
    </base-config>
    <domain-config cleartextTrafficPermitted="true">
       <domain includeSubdomains="true">10.0.2.2</domain>
    </domain-config>
</network-security-config>
  1. Inform the developer that additional domain nodes may need to be added if they continue to receive http cleartext errors while debugging on their devices.

Additional context

No response

Metadata

Metadata

Assignees

Labels

a.tut.codelab-googleRelates to codelabs hosted on codelabs.developers.google.come1-hoursEffort: < 8 hrsp2-mediumNecessary but not urgent concern. Resolve when possible.t.firebaseRelates to Firebase or FlutterFire

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions