9

I tried to run flutter after updating to the newest stable version

Error output from Xcode build:
↳
    ** BUILD FAILED **


Xcodes output:
↳
    Writing result bundle at path:
        /var/folders/56/fc0b38hx7dv7ldxkbs9flh_m0000gn/T/flutter_tools.sDq2W5/flutter_ios_build_temp_dirGNvLvF/temporary_xcresult_bundle

    /usr/local/Caskroom/flutter/2.5.2/flutter/.pub-cache/hosted/pub.dartlang.org/platform-3.0.0/lib/src/interface/local_platform.dart:46:19: Error: Member not
    found: 'packageRoot'.
          io.Platform.packageRoot; // ignore: deprecated_member_use
                      ^^^^^^^^^^^
    
    Command PhaseScriptExecution failed with a nonzero exit code
    note: Using new build system
    note: Planning
    note: Build preparation complete
    note: Building targets in parallel

    Result bundle written to path:
        /var/folders/56/fc0b38hx7dv7ldxkbs9flh_m0000gn/T/flutter_tools.sDq2W5/flutter_ios_build_temp_dirGNvLvF/temporary_xcresult_bundle


Could not build the application for the simulator.
Error launching application on iPhone 13 Pro.

I've tried flutter clean and flutter pub get but that isn't the fix. Anyone any idea how to fix this?

3
  • 1
    Have you tried flutter pub cache repair? Commented Feb 9, 2022 at 0:08
  • Yes I tried that, but it isn't the fix. Have you any other idea? Commented Feb 9, 2022 at 17:04
  • Check this may help : stackoverflow.com/a/75947102/6667442 Commented Apr 6, 2023 at 7:58

4 Answers 4

10

As i see you are currently using flutter 2.5.2 which is newest,So Update you flutter SDK by running command

flutter upgrade

Then Upgrade the current package's dependencies to latest versions by running command

flutter pub upgrade

Go to iOS folder of the project run

pod init

and

pod install

I hope this solution solve your problem.

Please up the vote if this answer help you.

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

2 Comments

This answer is good way to start. For me it wasn't a complete fix. Migrate for Android is needed also: github.com/flutter/flutter/wiki/…
flutter version upgrade solved my issue.
5

I spent way too much time on this issue.

For me the problem was related to the Flutter cache and running the following command resolved the issue:

flutter pub cache repair

The solution made sense to me when I noticed a plugin trying to reference [flutter-sdk-path]/flutter/packages/flutter/lib/screens.dart--which did not exist in my Flutter SDK.

Ref: Update flutter dependencies in /.pub-cache

Guys, sometimes it better to just GO TO SLEEP! It helps a great deal to have fresh eyes looking at a problem.

Comments

1

Same problem on Xcode 14 with me and This solution worked for me as well

Update the following code in -frameworks.sh files to add the -f flag to calls to readlink. In other words

source="$(readlink "${source}")"

 with

source="$(readlink -f "${source}")"

enter image description here

Comments

0

if you have Podfile in iOS folder

Go to iOS folder of the project

run

flutter clean

and

flutter pub get

and

pod update

1 Comment

Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center. Especially information about what those commands do, so others won't run commands without thinking about them. Additionally pod update might not always be the right tool, so explaining why use pod update instead of pod install would be beneficial.

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.