Skip to content

Cannot open file ios/Runner.xcodeproj/project.pbxproj #22886

Closed
@ChristBKK

Description

@ChristBKK

Steps to Reproduce

  1. Flutter Run

Logs

command

flutter run

exception

FileSystemException: FileSystemException: Cannot open file, path = '/Users/christian/Documents/coding/spirit4/spirit4/ios/Runner.xcodeproj/project.pbxproj' (OS Error: No such file or directory, errno = 2)
#0      _File.open.<anonymous closure> (dart:io/file_impl.dart:368:9)
#1      _rootRunUnary (dart:async/zone.dart:1132:38)
#2      _CustomZone.runUnary (dart:async/zone.dart:1029:19)
#3      _FutureListener.handleValue (dart:async/future_impl.dart:129:18)
#4      Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:642:45)
#5      Future._propagateToListeners (dart:async/future_impl.dart:671:32)
#6      Future._completeWithValue (dart:async/future_impl.dart:486:5)
#7      Future._asyncComplete.<anonymous closure> (dart:async/future_impl.dart:516:7)
#8      _rootRun (dart:async/zone.dart:1124:13)
#9      _CustomZone.run (dart:async/zone.dart:1021:19)
#10     _CustomZone.bindCallback.<anonymous closure> (dart:async/zone.dart:947:23)
#11     _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#12     _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#13     _runPendingImmediateCallback (dart:isolate/runtime/libisolate_patch.dart:115:13)
#14     _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:172:5)

flutter doctor

[✓] Flutter (Channel beta, v0.9.4, on Mac OS X 10.13.6 17G2307, locale en-TH)
    • Flutter version 0.9.4 at /Users/christian/documents/coding/flutter
    • Framework revision f37c235c32 (2 weeks ago), 2018-09-25 17:45:40 -0400
    • Engine revision 74625aed32
    • Dart version 2.1.0-dev.5.0.flutter-a2eb050044

[✓] Android toolchain - develop for Android devices (Android SDK 28.0.1)
    • Android SDK at /Users/christian/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.1
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)
    • All Android licenses accepted.

[✓] iOS toolchain - develop for iOS devices (Xcode 10.0)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 10.0, Build version 10A255
    • ios-deploy 1.9.2
    • CocoaPods version 1.5.3

[✓] Android Studio (version 3.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 27.0.1
    • Dart plugin version 173.4700
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)

[✓] VS Code (version 1.28.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 2.19.0

[✓] Connected devices (1 available)
    • iPhone XS Max • F701DB9C-85B5-425E-A5B8-9749A44CA6D2 • ios • iOS 12.0 (simulator)

• No issues found!

Pubspec:

dependencies:
  flutter:
    sdk: flutter

  # The following adds the Cupertino Icons font to your application.
  # Use with the CupertinoIcons class for iOS style icons.
  cupertino_icons: ^0.1.0
  scoped_model: "^0.3.0"
  http: "^0.11.3+16"
  shared_preferences: "^0.4.3"
  rxdart: "^0.18.1"
  map_view: "^0.0.12"
  location: "^1.4.1"
  image_picker: "^0.4.5"
  mime: "^0.9.6"
  url_launcher: "^3.0.2"

dev_dependencies:
  flutter_launcher_icons: "^0.6.1"

Activity

added
c: crashStack traces logged to the console
platform-iosiOS applications specifically
toolAffects the "flutter" command-line tool. See also t: labels.
on Oct 10, 2018
added this to the Goals milestone on Oct 10, 2018
qtbeee

qtbeee commented on Oct 31, 2018

@qtbeee

I had this error today and I found that the file in question was actually in the .ios directory instead of ios. So I flutter createed to repair the project and removed the .ios directory and now it works.

JonasJW

JonasJW commented on Dec 15, 2018

@JonasJW

I have the same issue.

@qtbeee What do you mean by "flutter createed"? flutter create is not a command I can run to repair anything, just to create new projects.

zoechi

zoechi commented on Dec 16, 2018

@zoechi
Contributor

@JonasJW you can indeed use flutter create . to "repair" the current project to a limited degree.
If the ios/ or android/ folders are missing, they are created.
You can use this to switch native language Java/Kotlin, ObjC/Swift or to get the generated files updated to match newer Flutter versions by deleting the directories and running flutter create . [options]. You need to re-apply previously made manual changes yourself though.

zoechi

zoechi commented on Dec 16, 2018

@zoechi
Contributor

@ChristBKK did @qtbeee's suggestion apply to your problem as well?

added
waiting for customer responseThe Flutter team cannot make further progress on this issue until the original reporter responds
on Dec 16, 2018
JonasJW

JonasJW commented on Dec 16, 2018

@JonasJW

flutter create . indeed solved the problem for me. Thank you!

px200

px200 commented on Dec 22, 2018

@px200

I was following https://codelabs.developers.google.com/codelabs/first-flutter-app-pt2/#5
Xcode could build for real phone, then I changed the name from Runner to HelloFlutter, and Xcode can still build for iphone, but flutter run is not working, generate Cannot open file ios/Runner.xcodeproj/project.pbxproj error.

And I changed the name back, everything is working again.

added
t: xcode"xcodebuild" on iOS and general Xcode project management
on Jan 8, 2019
no-response

no-response commented on Jan 8, 2019

@no-response

Without additional information, we are unfortunately not sure how to resolve this issue. We are therefore reluctantly going to close this bug for now. Please don't hesitate to comment on the bug if you have any more information for us; we will reopen it right away!
Thanks for your contribution.
cc @Hixie

removed
waiting for customer responseThe Flutter team cannot make further progress on this issue until the original reporter responds
on Jan 8, 2019
zoechi

zoechi commented on Jan 8, 2019

@zoechi
Contributor

Reopening in case there can something done to prevent that in the future.

bMil21

bMil21 commented on Mar 20, 2019

@bMil21

@JonasJW flutter create . works for me. Thanks!

bruno-farias

bruno-farias commented on Mar 23, 2019

@bruno-farias

Delete the flutter cache folder located at /Users/username/Documents/flutter/bin/cache and run flutter doctor, it will download all dependencies again. Worked for me.

Zhaimm

Zhaimm commented on May 7, 2019

@Zhaimm

flutter create . 解决了问题,非常感谢

blackwiz4rd

blackwiz4rd commented on Mar 11, 2020

@blackwiz4rd

The only solution for me is to remove the build folder: rm -rf build/

lock

lock commented on Apr 4, 2020

@lock

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

locked and limited conversation to collaborators on Apr 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    c: crashStack traces logged to the consoleplatform-iosiOS applications specificallyt: xcode"xcodebuild" on iOS and general Xcode project managementtoolAffects the "flutter" command-line tool. See also t: labels.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @zoechi@bMil21@px200@bruno-farias@blackwiz4rd

        Issue actions

          Cannot open file ios/Runner.xcodeproj/project.pbxproj · Issue #22886 · flutter/flutter