jeudi 18 février 2021

I can't initalize firebase in test

When ı run this

void main() async {
  TestWidgetsFlutterBinding.ensureInitialized();
  await Firebase.initializeApp();
    group('group', (){

      test('test', (){
        var t = 'a';
        expect(t, 'a'); //I have an other test but the problem isn't about it.
      });

    });

I take this exception. I am new at testing on flutter so I don't know anything to solve the problem

package:flutter/src/services/platform_channel.dart 157:7                                        MethodChannel._invokeMethod
===== asynchronous gap ===========================
package:flutter/src/services/platform_channel.dart 332:12                                       MethodChannel.invokeMethod
package:flutter/src/services/platform_channel.dart 345:41                                       MethodChannel.invokeListMethod
package:firebase_core_platform_interface/src/method_channel/method_channel_firebase.dart 30:36  MethodChannelFirebase._initializeCore
package:firebase_core_platform_interface/src/method_channel/method_channel_firebase.dart 75:13  MethodChannelFirebase.initializeApp
package:firebase_core/src/firebase.dart 43:25                                                   Firebase.initializeApp
test\services_unit_test.dart 23:18                                                              main

Failed to load "C:\Users\%UserName%\AndroidStudioProjects\%ProjectName%\test\services_unit_test.dart": MissingPluginException(No implementation found for method Firebase#initializeCore on channel plugins.flutter.io/firebase_core)

Aucun commentaire:

Enregistrer un commentaire