0

I have been trying to archive a flutter project but it doesn't seem to work. First i got this error https://github.com/CocoaPods/CocoaPods/issues/11808#issuecomment-1500907375 . Following the solution fixed my first issue, but now im getting this error message, could enyone shed some light on this situation? :)

../../.pub-cache/hosted/pub.dartlang.org/file-6.1.2/lib/src/interface/file.dart:15:16: Error: The method 'File.create' has fewer named arguments than those of overridden method 'File.create'. Future create({bool recursive = false}); ^ org-dartlang-sdk:///third_party/dart/sdk/lib/io/file.dart:232:16: Context: This is the overridden method ('create'). Future create({bool recursive = false, bool exclusive = false}); ^ ../../.pub-cache/hosted/pub.dartlang.org/file-6.1.2/lib/src/interface/file.dart:15:16: Error: The method 'File.create' doesn't have the named parameter 'exclusive' of overridden method 'File.create'. Future create({bool recursive = false}); ^ org-dartlang-sdk:///third_party/dart/sdk/lib/io/file.dart:232:16: Context: This is the overridden method ('create'). Future create({bool recursive = false, bool exclusive = false}); ^ ../../.pub-cache/hosted/pub.dartlang.org/file-6.1.2/lib/src/forwarding/forwarding_file.dart:22:8: Error: The method 'ForwardingFile.createSync' has fewer named arguments than those of overridden method 'File.createSync'. void createSync({bool recursive = false}) => ^ org-dartlang-sdk:///third_party/dart/sdk/lib/io/file.dart:248:8: Context: This is the overridden method ('createSync'). void createSync({bool recursive = false, bool exclusive = false}); ^ ../../.pub-cache/hosted/pub.dartlang.org/file-6.1.2/lib/src/forwarding/forwarding_file.dart:22:8: Error: The method 'ForwardingFile.createSync' doesn't have the named parameter 'exclusive' of overridden method 'File.createSync'. void createSync({bool recursive = false}) => ^ org-dartlang-sdk:///third_party/dart/sdk/lib/io/file.dart:248:8: Context: This is the overridden method ('createSync'). void createSync({bool recursive = false, bool exclusive = false}); ^ Failed to package /Users/williamsonesson/AndroidStudioProjects/WhyAppen. Command PhaseScriptExecution failed with a nonzero exit code

I have not found any helpful solutions

1 Answer 1

0

In android, adding file:^6.1.2 in pubspec.yaml will work. But in Ios, error will be shown.

I have solved it using the following steps:

Do not add file:^6.1.2

Run following commands

  1. flutter pub outdated

it will show some file dependencies are outdated, along with other if any.

  1. flutter pub upgrade (mind you that all of your dependencies that has a resolvable newer version will be added, and you may need to change your code if there any needed. In my case i have added:

dependency_overrides: firebase_core_platform_interface: 4.5.1 just above dev_dependencies in my pubspec.yaml due to firebase_core package problem)

  1. flutter clean
  2. flutter pub get
  3. cd ios pod install
  4. flutter pub get

now goto xcode > product> run

it will work. if issue still exists, run following commands:

  1. delete podfile.lock(in android studio using project organiser)

  2. flutter pub get

  3. flutter clean

  4. flutter pub get

  5. cd ios pod install

  6. flutter pub get

again goto xcode > product> run the issue will be gone.


when you are running:(xcode > product> run ) you can see all errors in xcode's navigator on clicking the first row's last icon which is report navigator.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.