小编Roh*_*ily的帖子

Flutter Web 错误pluginConstants['isCrashlyticsCollectionEnabled'] != null

我有如下代码,最初我将此代码用于 iOS 和 Android 应用程序,现在我希望该应用程序在网络上运行,但是当我运行时出现此错误

runZonedGuarded:在我的根区域中捕获错误。pluginConstants['isCrashlyticsCollectionEnabled'] != null 不是 true

有人建议使用kisweb,我已经使用了它,但我仍然遇到同样的错误,请帮忙,这是我的代码

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  if(!kIsWeb) {
    await Firebase.initializeApp();
  }

  runZonedGuarded(() async {
    if (kDebugMode) {
    await FirebaseCrashlytics.instance.setCrashlyticsCollectionEnabled(false);
    }else{
    await FirebaseCrashlytics.instance.setCrashlyticsCollectionEnabled(true);
    }
    runApp(App(
      authenticationRepository: AuthenticationRepository(),
      userRepository: UserRepository(),
    ));
  }, (error, stackTrace) async {
    print('runZonedGuarded: Caught error in my root zone. $error');
  });
}
Run Code Online (Sandbox Code Playgroud)

索引.html

<!DOCTYPE html>
<html>
<head>
  <!-- The core Firebase JS SDK is always required and must be listed first -->
<script src="https://www.gstatic.com/firebasejs/8.6.1/firebase-app.js"></script>
<script src="https://www.gstatic.com/firebasejs/8.6.1/firebase-auth.js"></script>
<script src="https://www.gstatic.com/firebasejs/8.6.1/firebase-analytics.js"></script> …
Run Code Online (Sandbox Code Playgroud)

web flutter flutter-web

7
推荐指数
1
解决办法
2840
查看次数

未找到覆盖文件,请尝试使用“-f”,或使用“-R”更改项目根目录

我的文件夹中有文件:coverage/lcov.info

我将在 CI Gitlab 中使用 codecov uploader version 0.2.4 上传文件(使用 flutter),但出现错误

There was an error running the uploader: No coverage files located, please try use `-f`, or change the project root with `-R`
Run Code Online (Sandbox Code Playgroud)

我怎样才能解决这个问题?请帮忙

在此输入图像描述

code-coverage gitlab gitlab-ci flutter codecov

5
推荐指数
1
解决办法
1398
查看次数

标签 统计

flutter ×2

code-coverage ×1

codecov ×1

flutter-web ×1

gitlab ×1

gitlab-ci ×1

web ×1