【问题标题】:How to downgrade packages in flutter?如何在颤振中降级软件包?
【发布时间】:2020-03-31 12:23:19
【问题描述】:

cloud_firestore 0.12.11 在颤振中不适合我,它不允许我的应用程序在调试中启动。我将如何降级这个包?在 pubspec 文件中,我使用了较低版本的 cloud_firestore,即。 (cloud_firestore: ^0.12.9+4) 然后保存并且 VS Code 得到了包但是当我尝试再次启动时它给出了同样的错误:

                     ~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /Users/kev/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore- 
    0.12.11/ios/Classes/CloudFirestorePlugin.m:157:24: error: no visible @interface for 
    'FIRQuery' declares the selector 'queryWhereFieldPath:arrayContainsAny:'
                query = [query queryWhereFieldPath:fieldPath arrayContainsAny:value];
                     ~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /Users/kev/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore- 
   0.12.11/ios/Classes/CloudFirestorePlugin.m:163:24: error: no visible @interface for 
   'FIRQuery' declares the selector 'queryWhereField:in:'
            query = [query queryWhereField:fieldName in:value];
                     ~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /Users/kev/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore- 
   0.12.11/ios/Classes/CloudFirestorePlugin.m:165:24: error: no visible @interface for 
  'FIRQuery' declares the selector 'queryWhereFieldPath:in:'
                query = [query queryWhereFieldPath:fieldPath in:value];
                     ~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /Users/kev/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore- 
   0.12.11/ios/Classes/CloudFirestorePlugin.m:764:16: warning: 'timestampsInSnapshotsEnabled' 
    is deprecated [-Wdeprecated-declarations]
              settings.timestampsInSnapshotsEnabled = 
    (bool)call.arguments[@"timestampsInSnapshotsEnabled"];
                   ^
    In module 'FirebaseFirestore' imported from 

  /Users/kev/Documents/flutterprojects/shopapp/ios/Pods/Headers/Public/Firebase/Firebase.h:45:

 /Users/kev/Documents/flutterprojects/shopapp/ios/Pods/FirebaseFirestore/Firestore/Source/Public .   /FIRFirestoreSettings.h:69:20: note: 'timestampsInSnapshotsEnabled' has been explicitly marked 
    deprecated here
           __attribute__((deprecated));
                       ^
       1 warning and 4 errors generated.
       note: Using new build systemnote: Planning buildnote: Constructing build description
   Could not build the application for the simulator.
   Error launching application on iPhone X.

当我检查 .pubcache 内的颤振 SDK -> 托管 -> pub.dartlang.org -> 那里有一个文件夹 cloud_firestore 0.12.11 我该如何解决这个问题?当我在 pubspec 文件中注释掉 cloud_firestore 启动时,我的应用程序开始正常。

【问题讨论】:

    标签: ios firebase flutter google-cloud-firestore


    【解决方案1】:

    如果您有任何包冲突,只需在末尾输入any 而不是版本号。而不是flutter_hive: 1.0.0,你喜欢=> flutter_hive: any。 它会解决一切。

    【讨论】:

      【解决方案2】:

      是的,您需要删除插入符号,但您还需要清除那些旧(新)文件夹!

      在终端窗口中,您需要在项目根目录中运行“$flutter clean”和“$flutter pub upgrade”,并可能删除 Pods/ 文件夹并从头开始重置所有内容。

      还可能需要使用“文件/无效缓存”(在 android studio 中)。

      【讨论】:

        【解决方案3】:
        cloud_firestore: ^0.12.9+4
        

        这个小符号^ 称为插入符号,用于告诉pub 获得 版本或更高。要选择特定版本,您需要将其删除。

        cloud_firestore: 0.12.9+4
        

        要了解有关依赖项的更多信息,请访问有关 caret syntaxversion constraints 的 Dart 文档。

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 2021-06-11
          • 1970-01-01
          • 2021-07-09
          • 2021-04-05
          • 2020-10-31
          • 1970-01-01
          • 2021-11-10
          • 2021-03-30
          相关资源
          最近更新 更多