1
votes

I have successfully created a build with Codemagic of an Android Flutter app that uses Firebase Google Sign In and Cloud Firestore. Im only working with Android (not IOS). The google-services.json from Firebase is used in the build of the apk with Codemagic. Im not publishing, only creating build. The problem is that the app runs perfectly with flutter run (on VsCode), but with the apk build from Codemagic I can`t log in / fecth data from Cloud Firestore.

After debugging with Android Studio the error is as following:

2021-05-13 11:58:08.006 7011-7011/com.luisbarqueira.expenses_control E/libEGL: call to OpenGL ES API with no current context (logged once per thread) 2021-05-13 11:58:29.297 7011-7475/com.luisbarqueira.expenses_control E/flutter: [ERROR:flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception: PlatformException(network_error, com.google.android.gms.common.api.ApiException: 7: , null, null) #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:581:7) #1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:158:18) <asynchronous suspension> #2 MethodChannel.invokeMapMethod (package:flutter/src/services/platform_channel.dart:358:43) <asynchronous suspension>

Could you please help me to solve this issue?

Thank you and best regards, Luis

2

2 Answers

0
votes

This could be, because you don't added permission for internet on android. In debug mode this is enabled by default, but on release mode (apk), you have to add the following lines in your AndroidManifest.xml:

<manifest xmlns:android...>
 ...
 <uses-permission android:name="android.permission.INTERNET" />
 <application ...
</manifest>

Reference on flutter.dev

-3
votes

Have you resolve this problem? I am facing almost the same issue