Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to downgrade packages in flutter?

cloud_firestore 0.12.11 isn't working for me in flutter, it won't allow my app to launch in debug. How would i downgrade this package? In the pubspec file I used a lower version of cloud_firestore ie. (cloud_firestore: ^0.12.9+4) and then saved and VS Code got the packages but when I try to launch again it gives the same error :

                     ~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /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.

When i checked the flutter SDK inside of the .pubcache -> hosted -> pub.dartlang.org -> there is a folder in there cloud_firestore 0.12.11 how do i fix this? my applicatoin starts fine when i launch with cloud_firestore commented out in the pubspec file.

like image 426
Satrogan Avatar asked Dec 06 '19 13:12

Satrogan


1 Answers

cloud_firestore: ^0.12.9+4

This little sign ^ called caret is used to tell the pub to get this version or higher. To pick a specific version you need to remove it.

cloud_firestore: 0.12.9+4

To learn more about dependencies visit Dart documentation about caret syntax and version constraints.

like image 128
pr0gramist Avatar answered Oct 31 '22 20:10

pr0gramist