Open
Description
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.
- Add the following to: android\app\src\main\AndroidManifest.xml
<application
android:networkSecurityConfig="@xml/network_security_config"
- Create the following directory if it doesn't exist:
android\app\src\main\res\xml
- Create a file in the xml directory named:
network_security_config.xml
- 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>
- 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