Connection failed with realtime database

Hello everyone :wave:,

I stuck on something since 3 weeks ago…:sweat:

I use Firebase Realtime Database, everything fine on iOS and on Android emulator, but the client stay offline on Android device. I already put the <uses-permission android:name="android.permission.INTERNET"/> into the manifest file, and I fetch data from get/post http request. I try with Supabase (really great tool by the way) and I got a similar issue.

SocketException: Connection failed with Supabase
java.util.concurrent.ExecutionException: java.lang.Exception: Client is offline with Firebase

Any guidance on the best way to fix the issue this would be appreciated, thanks

macOS Montereyv12.0.1
Android Studio Artic fox 2020.3.1 Patch 4
Flutter 2.8.1 channel stable
Dart 2.15.1

Hey! @Smartiiez Could you please share the code present in your android manifest file.

hey :wave: @sakina ,

Here, all the manifest file content

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.********.**">

   <uses-permission android:name="android.permission.INTERNET"/>
   
   <application
        android:label="LTE"
        android:icon="@mipmap/ic_launcher"
       android:usesCleartextTraffic="true"
       android:requestLegacyExternalStorage="true">
        <activity
            android:name=".MainActivity"
            android:launchMode="singleTop"
            android:theme="@style/LaunchTheme"
            android:screenOrientation="portrait"
            android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
            android:hardwareAccelerated="true"
            android:windowSoftInputMode="adjustResize">
            <meta-data
              android:name="io.flutter.embedding.android.NormalTheme"
              android:resource="@style/NormalTheme"
              />
            <meta-data
              android:name="io.flutter.embedding.android.SplashScreenDrawable"
              android:resource="@drawable/launch_background"
              />
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
        </activity>
        <meta-data
            android:name="flutterEmbedding"
            android:value="2" />
    </application>

</manifest>

Hey @Smartiiez

Are we sure this is an internet permission issue because it looks like it’s been added correctly in the manifest file. Easiest way to verify this is by trying Image.network(<url>) in your app somewhere.

You’re right, it doesn’t appear to be an Internet permission issue :confused:
Another message appears in the log: core_booster, getBoosterConfig = false
I don’t understand what that means :pensive:

1 Like

hi :wave: @sakina, thanks for you time. I’m still stuck but I discover it’s not a problem with supabase or firebase, but with connectivity or authorization.

I implemented OneSignal for push notification, and it work fine on iOS device, Android simulator but nothing on Android devices.

1 Like