Когда я добавляю firebase для flutter web, мое приложение не запускается

Я плавно запускал свое приложение. Когда я добавил firebase: ^ 7.2.1 для поддержки Flutter Web. Сборка для Интернета работает нормально, но сборка для Android всегда терпит неудачу.

Мои зависимости.

  flutter_timer: ^0.0.6
  http: any
  intl: ^0.16.1
  firebase: ^7.2.1 ```

---------------------------

These are Console message:



Launching lib/main.dart on SM G920L in debug mode...
Running Gradle task 'assembleDebug'...
Invalid depfile: /Users/mac/Developer/Flutter/FlutterProjects/podio/.dart_tool/flutter_build/c4534ac7f6d60d954ed69c0226286dfd/kernel_snapshot.d
Invalid depfile: /Users/mac/Developer/Flutter/FlutterProjects/podio/.dart_tool/flutter_build/c4534ac7f6d60d954ed69c0226286dfd/kernel_snapshot.d

Compiler message:
../../SDK/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.2.1/lib/src/top_level.dart:1:8: Error: Not found: 'dart:html'
import 'dart:html';
       ^
../../SDK/flutter/.pub-cache/hosted/pub.dartlang.org/js-0.6.1+1/lib/js.dart:8:1: Error: Not found: 'dart:js'
export 'dart:js' show allowInterop, allowInteropCaptureThis;
^
../../SDK/flutter/.pub-cache/hosted/pub.dartlang.org/js-0.6.1+1/lib/js_util.dart:8:1: Error: Not found: 'dart:js_util'
export 'dart:js_util';
^
../../SDK/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.2.1/lib/src/auth.dart:306:25: Error: The method 'allowInterop' isn't defined for the class 'Auth'.
 - 'Auth' is from 'package:firebase/src/auth.dart' ('../../SDK/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.2.1/lib/src/auth.dart').
Try correcting the name to the name of an existing method, or defining a method named 'allowInterop'.
      var nextWrapper = allowInterop((firebase_interop.UserJsImpl user) {
                        ^^^^^^^^^^^^
../../SDK/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.2.1/lib/src/auth.dart:310:26: Error: The method 'allowInterop' isn't defined for the class 'Auth'.
 - 'Auth' is from 'package:firebase/src/auth.dart' ('../../SDK/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.2.1/lib/src/auth.dart').
Try correcting the name to the name of an existing method, or defining a method named 'allowInterop'.
      var errorWrapper = allowInterop((e) => _changeController.addError(e));
                         ^^^^^^^^^^^^
../../SDK/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.2.1/lib/src/auth.dart:340:25: Error: The method 'allowInterop' isn't defined for the class 'Auth'.
 - 'Auth' is from 'package:firebase/src/auth.dart' ('../../SDK/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.2.1/lib/src/auth.dart').
Try correcting the name to the name of an existing method, or defining a method named 'allowInterop'.
      var nextWrapper = allowInterop((firebase_interop.UserJsImpl user) {
                        ^^^^^^^^^^^^
../../SDK/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.2.1/lib/src/auth.dart:345:11: Error: The method 'allowInterop' isn't defined for the class 'Auth'.
 - 'Auth' is from 'package:firebase/src/auth.dart' ('../../SDK/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.2.1/lib/src/auth.dart').
Try correcting the name to the name of an existing method, or defining a method named 'allowInterop'.
          allowInterop((e) => _idTokenChangedController.addError(e));
          ^^^^^^^^^^^^
../../SDK/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.2.1/lib/src/database.dart:164:9: Error: The method 'allowInterop' isn't defined for the class 'DatabaseReference<T>'.
 - 'DatabaseReference' is from 'package:firebase/src/database.dart' ('../../SDK/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.2.1/lib/src/database.dart').
Try correcting the name to the name of an existing method, or defining a method named 'allowInterop'.
        allowInterop((update) => jsify(transactionUpdate(dartify(update))));
        ^^^^^^^^^^^^
../../SDK/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.2.1/lib/src/database.dart:166:26: Error: The method 'allowInterop' isn't defined for the class 'DatabaseReference<T>'.
 - 'DatabaseReference' is from 'package:firebase/src/database.dart' ('../../SDK/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.2.1/lib/src/database.dart').
Try correcting the name to the name of an existing method, or defining a method named 'allowInterop'.
    var onCompleteWrap = allowInterop(
                         ^^^^^^^^^^^^
../../SDK/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.2.1/lib/src/database.dart:301:24: Error: The method 'allowInterop' isn't defined for the class 'Query<T>'.
 - 'Query' is from 'package:firebase/src/database.dart' ('../../SDK/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.2.1/lib/src/database.dart').
Try correcting the name to the name of an existing method, or defining a method named 'allowInterop'.
    var callbackWrap = allowInterop((database_interop.DataSnapshotJsImpl data,
                       ^^^^^^^^^^^^
../../SDK/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.2.1/lib/src/database.dart:325:30: Error: The method 'allowInterop' isn't defined for the class 'Query<T>'.
 - 'Query' is from 'package:firebase/src/database.dart' ('../../SDK/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.2.1/lib/src/database.dart').
Try correcting the name to the name of an existing method, or defining a method named 'allowInterop'.
    jsObject.once(eventType, allowInterop(
                             ^^^^^^^^^^^^
../../SDK/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.2.1/lib/src/database.dart:402:22: Error: The method 'allowInterop' isn't defined for the class 'DataSnapshot'.
 - 'DataSnapshot' is from 'package:firebase/src/database.dart' ('../../SDK/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.2.1/lib/src/database.dart').
Try correcting the name to the name of an existing method, or defining a method named 'allowInterop'.
    var actionWrap = allowInterop((d) => action(DataSnapshot.getInstance(d)));
                     ^^^^^^^^^^^^
../../SDK/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.2.1/lib/src/messaging.dart:72:27: Error: The method 'allowInterop' isn't defined for the class 'Messaging'.
 - 'Messaging' is from 'package:firebase/src/messaging.dart' ('../../SDK/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.2.1/lib/src/messaging.dart').
Try correcting the name to the name of an existing method, or defining a method named 'allowInterop'.
      final nextWrapper = allowInterop((payload) {
                          ^^^^^^^^^^^^
../../SDK/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.2.1/lib/src/messaging.dart:75:28: Error: The method 'allowInterop' isn't defined for the class 'Messaging'.
 - 'Messaging' is from 'package:firebase/src/messaging.dart' ('../../SDK/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.2.1/lib/src/messaging.dart').
Try correcting the name to the name of an existing method, or defining a method named 'allowInterop'.
      final errorWrapper = allowInterop((e) {
                           ^^^^^^^^^^^^
../../SDK/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.2.1/lib/src/messaging.dart:87:27: Error: The method 'allowInterop' isn't defined for the class 'Messaging'.
 - 'Messaging' is from 'package:firebase/src/messaging.dart' ('../../SDK/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.2.1/lib/src/messaging.dart').
Try correcting the name to the name of an existing method, or defining a method named 'allowInterop'.
      final nextWrapper = allowInterop((payload) {
                          ^^^^^^^^^^^^
../../SDK/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.2.1/lib/src/messaging.dart:97:27: Error: The method 'allowInterop' isn't defined for the class 'Messaging'.
 - 'Messaging' is from 'package:firebase/src/messaging.dart' ('../../SDK/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.2.1/lib/src/messaging.dart').
Try correcting the name to the name of an existing method, or defining a method named 'allowInterop'.
      final nextWrapper = allowInterop((_) => null);
                          ^^^^^^^^^^^^
../../SDK/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.2.1/lib/src/messaging.dart:98:28: Error: The method 'allowInterop' isn't defined for the class 'Messaging'.
 - 'Messaging' is from 'package:firebase/src/messaging.dart' ('../../SDK/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.2.1/lib/src/messaging.dart').
Try correcting the name to the name of an existing method, or defining a method named 'allowInterop'.
      final errorWrapper = allowInterop((e) {
                           ^^^^^^^^^^^^
../../SDK/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.2.1/lib/src/storage.dart:317:11: Error: The method 'allowInterop' isn't defined for the class 'UploadTask'.
 - 'UploadTask' is from 'package:firebase/src/storage.dart' ('../../SDK/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.2.1/lib/src/storage.dart').
Try correcting the name to the name of an existing method, or defining a method named 'allowInterop'.
          allowInterop((storage_interop.UploadTaskSnapshotJsImpl data) {
          ^^^^^^^^^^^^
../../SDK/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.2.1/lib/src/storage.dart:321:26: Error: The method 'allowInterop' isn't defined for the class 'UploadTask'.
 - 'UploadTask' is from 'package:firebase/src/storage.dart' ('../../SDK/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.2.1/lib/src/storage.dart').
Try correcting the name to the name of an existing method, or defining a method named 'allowInterop'.
      var errorWrapper = allowInterop((e) => _changeController.addError(e));
                         ^^^^^^^^^^^^
../../SDK/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.2.1/lib/src/storage.dart:322:26: Error: The method 'allowInterop' isn't defined for the class 'UploadTask'.
 - 'UploadTask' is from 'package:firebase/src/storage.dart' ('../../SDK/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.2.1/lib/src/storage.dart').
Try correcting the name to the name of an existing method, or defining a method named 'allowInterop'.
      var onCompletion = allowInterop(() => _changeController.close());
                         ^^^^^^^^^^^^
../../SDK/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.2.1/lib/src/top_level.dart:194:7: Error: Method not found: 'hasProperty'.
  if (js.hasProperty(error, 'message')) {
      ^^^^^^^^^^^
../../SDK/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.2.1/lib/src/top_level.dart:195:19: Error: Method not found: 'getProperty'.
    var message = js.getProperty(error, 'message');
                  ^^^^^^^^^^^
../../SDK/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.2.1/lib/src/utils.dart:29:7: Error: Method not found: 'hasProperty'.
  if (util.hasProperty(jsObject, 'firestore') &&
      ^^^^^^^^^^^
../../SDK/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.2.1/lib/src/utils.dart:30:7: Error: Method not found: 'hasProperty'.
      util.hasProperty(jsObject, 'id') &&
      ^^^^^^^^^^^
../../SDK/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.2.1/lib/src/utils.dart:31:7: Error: Method not found: 'hasProperty'.
      util.hasProperty(jsObject, 'parent')) {
      ^^^^^^^^^^^
../../SDK/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.2.1/lib/src/utils.dart:37:7: Error: Method not found: 'hasProperty'.
  if (util.hasProperty(jsObject, 'latitude') &&
      ^^^^^^^^^^^
../../SDK/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.2.1/lib/src/utils.dart:38:7: Error: Method not found: 'hasProperty'.
      util.hasProperty(jsObject, 'longitude') &&
      ^^^^^^^^^^^
../../SDK/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.2.1/lib/src/utils.dart:44:15: Error: Method not found: 'getProperty'.
  var proto = util.getProperty(jsObject, '__proto__');
              ^^^^^^^^^^^
../../SDK/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.2.1/lib/src/utils.dart:46:7: Error: Method not found: 'hasProperty'.
  if (util.hasProperty(proto, 'toDate') &&
      ^^^^^^^^^^^
../../SDK/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.2.1/lib/src/utils.dart:47:7: Error: Method not found: 'hasProperty'.
      util.hasProperty(proto, 'toMillis')) {
      ^^^^^^^^^^^
../../SDK/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.2.1/lib/src/utils.dart:52:7: Error: Method not found: 'hasProperty'.
  if (util.hasProperty(proto, 'isEqual') &&
      ^^^^^^^^^^^
../../SDK/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.2.1/lib/src/utils.dart:53:7: Error: Method not found: 'hasProperty'.
      util.hasProperty(proto, 'toBase64')) {
      ^^^^^^^^^^^
../../SDK/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.2.1/lib/src/utils.dart:67:24: Error: Method not found: 'getProperty'.
    map[key] = dartify(util.getProperty(jsObject, key));
                       ^^^^^^^^^^^
../../SDK/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.2.1/lib/src/utils.dart:91:17: Error: Method not found: 'newObject'.
    var jsMap = util.newObject();
                ^^^^^^^^^
../../SDK/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.2.1/lib/src/utils.dart:93:7: Error: Method not found: 'setProperty'.
      util.setProperty(jsMap, key, jsify(value));
      ^^^^^^^^^^^
../../SDK/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.2.1/lib/src/utils.dart:116:12: Error: Method not found: 'allowInterop'.
    return allowInterop(dartObject);
           ^^^^^^^^^^^^
../../SDK/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.2.1/lib/src/utils.dart:124:5: Error: Method not found: 'callMethod'.
    util.callMethod(jsObject, method, args);
    ^^^^^^^^^^
../../SDK/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.2.1/lib/src/utils.dart:139:19: Error: Method not found: 'promiseToFuture'.
    value = await util.promiseToFuture(thenable);
                  ^^^^^^^^^^^^^^^
../../SDK/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.2.1/lib/src/utils.dart:141:9: Error: Method not found: 'hasProperty'.
    if (util.hasProperty(e, 'code')) {
        ^^^^^^^^^^^
../../SDK/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.2.1/lib/src/utils.dart:152:27: Error: Method not found: 'allowInterop'.
  return PromiseJsImpl<S>(allowInterop((
                          ^^^^^^^^^^^^
../../SDK/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.2.1/lib/src/utils.dart:165:5: Error: Method not found: 'allowInterop'.
    allowInterop(c.completeError);
    ^^^^^^^^^^^^
../../SDK/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.2.1/lib/src/utils.dart:173:22: Error: Method not found: 'getProperty'.
  String get code => util.getProperty(_source, 'code');
                     ^^^^^^^^^^^
../../SDK/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.2.1/lib/src/utils.dart:176:25: Error: Method not found: 'getProperty'.
  String get message => util.getProperty(_source, 'message');
                        ^^^^^^^^^^^
../../SDK/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.2.1/lib/src/utils.dart:179:22: Error: Method not found: 'getProperty'.
  String get name => util.getProperty(_source, 'name');
                     ^^^^^^^^^^^
../../SDK/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.2.1/lib/src/utils.dart:182:32: Error: Method not found: 'getProperty'.
  Object get serverResponse => util.getProperty(_source, 'serverResponse');
                               ^^^^^^^^^^^
../../SDK/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.2.1/lib/src/utils.dart:185:23: Error: Method not found: 'getProperty'.
  String get stack => util.getProperty(_source, 'stack');
                      ^^^^^^^^^^^
../../SDK/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.2.1/lib/src/firestore.dart:105:30: Error: The method 'allowInterop' isn't defined for the class 'Firestore'.
 - 'Firestore' is from 'package:firebase/src/firestore.dart' ('../../SDK/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.2.1/lib/src/firestore.dart').
Try correcting the name to the name of an existing method, or defining a method named 'allowInterop'.
    var updateFunctionWrap = allowInterop((transaction) =>
                             ^^^^^^^^^^^^
../../SDK/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.2.1/lib/src/firestore.dart:306:11: Error: The method 'allowInterop' isn't defined for the class 'DocumentReference'.
 - 'DocumentReference' is from 'package:firebase/src/firestore.dart' ('../../SDK/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.2.1/lib/src/firestore.dart').
Try correcting the name to the name of an existing method, or defining a method named 'allowInterop'.
          allowInterop((firestore_interop.DocumentSnapshotJsImpl snapshot) {
          ^^^^^^^^^^^^
../../SDK/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.2.1/lib/src/firestore.dart:310:26: Error: The method 'allowInterop' isn't defined for the class 'DocumentReference'.
 - 'DocumentReference' is from 'package:firebase/src/firestore.dart' ('../../SDK/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.2.1/lib/src/firestore.dart').
Try correcting the name to the name of an existing method, or defining a method named 'allowInterop'.
      var errorWrapper = allowInterop((e) => controller.addError(e));
                         ^^^^^^^^^^^^
../../SDK/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.2.1/lib/src/firestore.dart:445:9: Error: The method 'allowInterop' isn't defined for the class 'Query<T>'.
 - 'Query' is from 'package:firebase/src/firestore.dart' ('../../SDK/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.2.1/lib/src/firestore.dart').
Try correcting the name to the name of an existing method, or defining a method named 'allowInterop'.
        allowInterop((firestore_interop.QuerySnapshotJsImpl snapshot) {
        ^^^^^^^^^^^^
../../SDK/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.2.1/lib/src/firestore.dart:449:24: Error: The method 'allowInterop' isn't defined for the class 'Query<T>'.
 - 'Query' is from 'package:firebase/src/firestore.dart' ('../../SDK/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.2.1/lib/src/firestore.dart').
Try correcting the name to the name of an existing method, or defining a method named 'allowInterop'.
    var errorWrapper = allowInterop((e) => controller.addError(e));
                       ^^^^^^^^^^^^
../../SDK/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.2.1/lib/src/firestore.dart:775:9: Error: The method 'allowInterop' isn't defined for the class 'QuerySnapshot'.
 - 'QuerySnapshot' is from 'package:firebase/src/firestore.dart' ('../../SDK/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.2.1/lib/src/firestore.dart').
Try correcting the name to the name of an existing method, or defining a method named 'allowInterop'.
        allowInterop((s) => callback(DocumentSnapshot.getInstance(s)));
        ^^^^^^^^^^^^
../../SDK/flutter/.pub-cache/hosted/pub.dartlang.org/firebase-7.2.1/lib/src/interop/js_interop.dart:17:7: Error: Method not found: 'hasProperty'.
  if (util.hasProperty(jsObject, 'toDateString')) {
      ^^^^^^^^^^^
../../SDK/flutter/packages/flutter/lib/src/painting/_network_image_web.dart:64:12: Error: Method not found: 'webOnlyInstantiateImageCodecFromUrl'.
    return ui.webOnlyInstantiateImageCodecFromUrl(resolved) as Future<ui.Codec>; // ignore: undefined_function
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Unhandled exception:
FileSystemException(uri=org-dartlang-untranslatable-uri:dart%3Ahtml; message=StandardFileSystem only supports file:* and data:* URIs)
#0      StandardFileSystem.entityForUri (package:front_end/src/api_prototype/standard_file_system.dart:33:7)
#1      asFileUri (package:vm/kernel_front_end.dart:604:37)
#2      writeDepfile (package:vm/kernel_front_end.dart:799:21)
<asynchronous suspension>
#3      FrontendCompiler.compile (package:frontend_server/frontend_server.dart:474:15)
<asynchronous suspension>
#4      _FlutterFrontendCompiler.compile (package:flutter_frontend_server/server.dart:38:22)
#5      starter (package:flutter_frontend_server/server.dart:149:27)
#6      main (file:///b/s/w/ir/cache/builder/src/flutter/flutter_frontend_server/bin/starter.dart:8:30)
#7      _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:299:32)
#8      _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12)

Target kernel_snapshot failed: Exception: Errors during snapshot creation: null
build failed.

FAILURE: Build failed with an exception.

* Where:
Script '/Users/mac/Developer/Flutter/SDK/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 801

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command '/Users/mac/Developer/Flutter/SDK/flutter/bin/flutter'' finished with non-zero exit value 1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 32s
Finished with error: Gradle task assembleDebug failed with exit code 1

Когда я запускаю код перед добавлением сети, то трепещет. В Android все нормально работало. Но когда я добавил firebase для Интернета, в трепете. Он перестает работать на Android, но нормально работает в Интернете.


person Sharjeel Ali    schedule 06.03.2020    source источник
comment
Пожалуйста, опубликуйте и свой flutter doctor ответ здесь ...   -  person Doomd    schedule 18.03.2020
comment
эта проблема существует почти 2 месяца ... решения пока не найдено ..   -  person softmarshmallow    schedule 30.03.2020


Ответы (3)


Я нашел ответ @davidmcharo очень полезным, но хотел предоставить обновление.

1) Firebase имеет несколько пакетов, которые работают как с мобильными устройствами, так и с Интернетом, из единой кодовой базы, но Realtime Database не является одним из них. (как сказал @ Dazza5000.) Вместо этого я предлагаю использовать cloud_firestore.

2) Теперь, когда эти пакеты поддерживают как мобильные, так и веб-сайты, вам не нужно добавлять зависимость firebase в ваш pubspec.yaml. Эта зависимость является причиной описанных выше проблем. Однако, если вы ранее зависели от него, простой запуск pub get после его удаления из вашего pubspec.yaml не избавит от этой ошибки. Вам нужно перейти по пути, который описал выше @davidmcharo (flutter / .pub-cache / hosted / pub.dartlang.org /), и удалить папку firebase-7.3.0, следуя его инструкциям. Как только вы это сделаете, ваше мобильное приложение должно запуститься.

3) Есть несколько статей, в которых подробно рассказывается, как создать кроссплатформенное веб-приложение и мобильное приложение с использованием firebase, но они быстро устаревают. Мне удалось заставить мое приложение работать БЕЗ использования глобального kIsWeb для указания пакета firebase.

Еще одно примечание: проблема, с которой я столкнулся, заключалась в том, что я мог заставить свое мобильное приложение работать, но мое веб-приложение продолжало иметь проблемы, пока я не удалил базу данных Realtime из своего приложения. Я случайно оставил StreamProvider, который обращался к моей старой базе данных Realtime в дереве, и это помешало правильному функционированию веб-приложения. Будьте осторожны с любыми затяжными вызовами базы данных реального времени при преобразовании из RTB в Cloud Firestore.

person Eric Duffett    schedule 26.05.2020

База данных Firebase в реальном времени не работает на мобильных устройствах и в Интернете - firestore, auth и некоторые другие работают.

Здесь вы можете найти библиотеки firebase, которые поддерживаются на мобильных устройствах и в Интернете:

https://github.com/FirebaseExtended/flutterfire

введите здесь описание изображения

person dazza5000    schedule 08.03.2020
comment
Это означает, что мне нужно удалить firebase_database. Если я хочу использовать firebase с Flutter Web? - person Sharjeel Ali; 10.03.2020
comment
да ... или вы можете использовать веб-версию в Интернете и мобильную версию на мобильном телефоне. - person dazza5000; 10.03.2020
comment
Хорошо! Но что вы имеете в виду конкретно под веб-версией / мобильной версией !! Не могли бы вы объяснить еще немного! - person Sharjeel Ali; 11.03.2020
comment
@JEEALI он имеет в виду, что вам придется разработать два отдельных приложения для флаттера. Один для iOS / Android, использующий этот плагин: pub.dev/packages/firebase_database и один для Flutter Web использующий этот пакет: pub.dev/packages/firebase. Вы можете довольно легко поделиться большей частью своей кодовой базы / виджетов в обоих приложениях flutter ... (можно следовать символическим ссылкам). - person Doomd; 10.04.2020
comment
Абсолютно нет ... вы создаете только одно приложение с условным импортом ... это означает Stub файл..a Switcher, содержащий только объявления методов и два разных файла реализации WebRepository (с использованием пакета firebase) и содержащий все переопределения методов для Интернета пакет, а DeviceRepository, содержащий те же переопределения методов, но для пакета firebase_database Android / iOS. Кроме того, я использую Singleton для инициализации firebase, когда используется пакет firebase (WEB). - person Vincenzo; 20.02.2021
comment
Я поставлю ответ, показывающий все это, как только исправлю одну вещь .. Я только что обновился до последней версии стабильного канала Flutter и переключенный пакет firebase теперь выдает странные ошибки с жалобами на http import и другие вещи .. - person Vincenzo; 20.02.2021
comment
ознакомьтесь со всем процессом здесь stackoverflow.com/questions/59670753/ - person Vincenzo; 20.02.2021

Firebase не работает как для Интернета, так и для мобильных устройств. Вам понадобится два отдельных проекта: один для Интернета с firebase 7.2.1, а другой - для мобильных устройств без firebase 7.2.1. Итак, чтобы ваш мобильный телефон (Android и iOS) работал, вам нужно будет удалить или удалить firebase 7.2.1 из своего проекта. И если вы хотите это сделать, сделайте следующее:

1. Перейдите в свой файл pubspec.yaml, внутри него в разделе зависимостей удалите firebase 7.2.1 или, если вы обновили его до firebase 7.3.0 и у вас есть обе эти зависимости, удалите их обе.

2. Затем с помощью терминала удалите папку firebase-7.2.1 и firebase-7.3.0, если обе они находятся внутри pub.dartlang.org. И как удалить это, открыв терминал, затем перейдите в папку flutter, затем внутри папки flutter перейдите в .pub-cache с помощью cd .pub-cache, затем cd hosted, затем cd pub.dartlang.org. Это путь к pub.dartlang.org: flutter / .pub-cache / hosted / pub.dartlang.org /. Затем внутри pub.dartlang.org введите следующую команду, чтобы удалить папку firebase-7.2.1, а именно: rm -r firebase-7.2.1, а затем rm -r firebase-7.3.0, если у вас есть папка firebase. -7.3.0.

  1. После удаления папок firebase-7.2.1 и firebase-7.3.0 с шага 2 выше запустите flutter clean, а затем снова запустите приложение с помощью эмулятора Android или iOS, и теперь оно должно работать нормально.
person davidmcharo    schedule 22.04.2020
comment
Я начал использовать Firestore вместо базы данных реального времени. Решает все :) - person Sharjeel Ali; 18.06.2020
comment
@JEEALI, если вам нужны только пакеты, доступные как для WEB, так и для устройства, чем вы все отсортировали, но если вместо этого вам нужно использовать какой-то пакет (как я), который еще не поддерживается, например Remote Config, вам придется использовать firebase. Я поставлю ответ, чтобы показать весь процесс позже ... нужно написать немного шаблонного кода, но он работает .. - person Vincenzo; 20.02.2021
comment
Ну ... на самом деле вы можете проверить весь процесс в моем собственном ответе здесь .. stackoverflow.com/questions/59670753/ - person Vincenzo; 20.02.2021