Когда я добавляю Firebase для веб-сайта флаттера, мое приложение не запускается - PullRequest
1 голос
/ 07 марта 2020

Я гладко запустил свое приложение. Когда я добавил FireBase: ^ 7.2.1 для поддержки Flutter Web. Сборка для 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 и нормально работает в сети.

Ответы [ 2 ]

1 голос
/ 08 марта 2020

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

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

https://github.com/FirebaseExtended/flutterfire

enter image description here

0 голосов
/ 22 апреля 2020

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

1. Go для вашего файла pubspe c .yaml, внутри него под зависимостями, удалите firebase 7.2.1 или, если вы обновили его до firebase 7.3 .0 и у вас есть обе эти зависимости, удалите их обе.

2. Затем используйте терминал для удаления папки firebase-7.2.1 и firebase-7.3.0, если у вас есть оба в pub.dartlang .org. И как удалить его, открыв терминал, затем go туда, где находится ваша папка флаттера, затем внутри папки флаттера go в .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.

После удаления папок firebase-7.2.1 и firebase-7.3.0 из шага 2 выше, затем запустите flutter clean, а затем снова запустите приложение, используя эмулятор android или iOS, и теперь он должен работать хорошо.
...