Going crazy. Firebase just WON'T let my app run on the Android emulator, had no issues before I upgraded Flutter. Note that on iOS, there are NO issues and the app runs just fine.
I am using the following packages (I have updated all to latest versions):
firebase_core: ^2.1.0
firebase_messaging: ^14.0.2
firebase_core_platform_interface: ^4.4.1
The error message I keep getting is 'PlatformException(channel-error, Unable to establish connection on channel., null, null)':
E/flutter (32105): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(channel-error, Unable to establish connection on channel., null, null)
E/flutter (32105): #0 FirebaseCoreHostApi.initializeCore
package:firebase_core_platform_interface/…/pigeon/messages.pigeon.dart:199
E/flutter (32105): <asynchronous suspension>
E/flutter (32105): #1 MethodChannelFirebase._initializeCore
package:firebase_core_platform_interface/…/method_channel/method_channel_firebase.dart:29
E/flutter (32105): <asynchronous suspension>
E/flutter (32105): #2 MethodChannelFirebase.initializeApp
package:firebase_core_platform_interface/…/method_channel/method_channel_firebase.dart:73
E/flutter (32105): <asynchronous suspension>
E/flutter (32105): #3 Firebase.initializeApp
package:firebase_core/src/firebase.dart:43
E/flutter (32105): <asynchronous suspension>
E/flutter (32105): #4 main
package:cadsys_adm/main.dart:13
E/flutter (32105): <asynchronous suspension>
E/flutter (32105):
My main() code:
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform);
runApp(MyApp());
}
Here is the results of FLUTTER PUB OUTDATED:
Here is an interesting thing I noticed: my pubspec is set to version 4.4.1 of firebase_core_platform_interface, but seems a version 4.5.1 is being used?
I have beeb stuck at this issue for over month at least, even had to take a break from looking at it for two weeks because it is making me crazy. I have googled, tested other solutions, downgraded the packages, tried providing specific options (API, projectID and so on) when initializing, nothing works.
I sincerely hope someone can help.