Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails to run iOS app (clang-4.0: error: no such file or directory...) #32457

Closed
8Gitbrix opened this issue May 10, 2019 · 7 comments
Closed

Fails to run iOS app (clang-4.0: error: no such file or directory...) #32457

8Gitbrix opened this issue May 10, 2019 · 7 comments
Labels
platform-ios iOS applications specifically t: xcode "xcodebuild" on iOS and general Xcode project management tool Affects the "flutter" command-line tool. See also t: labels.

Comments

@8Gitbrix
Copy link

8Gitbrix commented May 10, 2019

Steps to Reproduce

  1. Create a new app
  2. Run flutter: flutter run

Logs

Launching lib/main.dart on iPhone Xʀ in debug mode...
Running Xcode build...                                                  
 ├─Assembling Flutter resources...                           1.3s
 └─Compiling, linking and signing...                         0.1s
Xcode build done.                                            3.2s
Failed to build iOS app
Error output from Xcode build:
↳
    ** BUILD FAILED **


Xcode's output:
↳
    === BUILD TARGET Runner OF PROJECT Runner WITH CONFIGURATION Debug ===
    clang-4.0: error: no such file or directory:
    '/Users/ashwinjeyaseelan/Library/Developer/Xcode/DerivedData/Runner-erppndhrorptvigfgyiagzaujsuv/Index/Data
    Store'
    clang-4.0: error: no such file or directory:
    '/Users/ashwinjeyaseelan/Library/Developer/Xcode/DerivedData/Runner-erppndhrorptvigfgyiagzaujsuv/Index/Data
    Store'
    clang-4.0: error: no such file or directory:
    '/Users/ashwinjeyaseelan/Library/Developer/Xcode/DerivedData/Runner-erppndhrorptvigfgyiagzaujsuv/Index/Data
    Store'
    clang-4.0: error: no such file or directory:
    '/Users/ashwinjeyaseelan/Library/Developer/Xcode/DerivedData/Runner-erppndhrorptvigfgyiagzaujsuv/Index/Data
    Store'
    === BUILD TARGET Runner OF PROJECT Runner WITH CONFIGURATION Debug ===
    error: the following command failed with exit code 1 but produced no further output
    CompileC
    /Users/ashwinjeyaseelan/Library/Developer/Xcode/DerivedData/Runner-erppndhrorptvigfgyiagzaujsuv/Build/Inter
    mediates.noindex/Runner.build/Debug-iphonesimulator/Runner.build/Objects-normal/x86_64/GeneratedPluginRegis
    trant.o Runner/GeneratedPluginRegistrant.m normal x86_64 objective-c
    com.apple.compilers.llvm.clang.1_0.compiler

Could not build the application for the simulator.
Error launching application on iPhone Xʀ.
Exited (sigterm)

Flutter Doctor Output

[✓] Flutter (Channel stable, v1.5.4-hotfix.2, on Mac OS X 10.14.4 18E226, locale
    en-US)
    • Flutter version 1.5.4-hotfix.2 at
      /Users/ashwinjeyaseelan/Developer/flutter
    • Framework revision 7a4c33425d (10 days ago), 2019-04-29 11:05:24 -0700
    • Engine revision 52c7a1e849
    • Dart version 2.3.0 (build 2.3.0-dev.0.5 a1668566e5)

[!] Android toolchain - develop for Android devices (Android SDK version 22.0.1)
    • Android SDK at /Users/ashwinjeyaseelan/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling
      support)
    ✗ Flutter requires Android SDK 28 and the Android BuildTools 28.0.3
      To update using sdkmanager, run:
        "/Users/ashwinjeyaseelan/Library/Android/sdk/tools/bin/sdkmanager"
        "platforms;android-28" "build-tools;28.0.3"
      or visit https://flutter.dev/setup/#android-setup for detailed
      instructions.
    ✗ Android license status unknown.
      Try re-installing or updating your Android SDK Manager.
      See https://developer.android.com/studio/#downloads or visit
      https://flutter.dev/setup/#android-setup for detailed instructions.

[✓] iOS toolchain - develop for iOS devices (Xcode 10.2.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 10.2.1, Build version 10E1001
    • ios-deploy 1.9.4
    • CocoaPods version 1.6.1

[!] Android Studio (not installed)
    • Android Studio not found; download from
      https://developer.android.com/studio/index.html
      (or visit https://flutter.dev/setup/#android-setup for detailed
      instructions).

[!] IntelliJ IDEA Community Edition (version 2019.1.1)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
    • For information about installing plugins, see
      https://flutter.dev/intellij-setup/#installing-the-plugins

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

[✓] Connected device (1 available)
    • iPhone Xʀ • F8BA2D1A-D0A1-4B42-97FB-C526864542C3 • ios •
      com.apple.CoreSimulator.SimRuntime.iOS-12-2 (simulator)
@8Gitbrix 8Gitbrix changed the title Fails to build iOS app Fails to run iOS app (clang-4.0: error: no such file or directory...) May 10, 2019
@justinmc justinmc added t: xcode "xcodebuild" on iOS and general Xcode project management tool Affects the "flutter" command-line tool. See also t: labels. platform-ios iOS applications specifically labels May 10, 2019
@8Gitbrix
Copy link
Author

I reinstalled xcode, but now I'm getting new issues:

    === BUILD TARGET Runner OF PROJECT Runner WITH CONFIGURATION Debug ===
    clang-4.0: error: cannot specify -o when generating multiple output files
    clang-4.0: error: cannot specify -o when generating multiple output files
    === BUILD TARGET Runner OF PROJECT Runner WITH CONFIGURATION Debug ===
    error: the following command failed with exit code 1 but produced no further output
    CompileC /Users/ashwinjeyaseelan/Library/Developer/Xcode/DerivedData/Runner-gqqtdoegguocrzffetsuejzqayme/Build/Intermediates.noindex/Runner.build/Debug-iphonesimulator/Runner.build/Objects-normal/x86_64/AppDelegate.o Runner/AppDelegate.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
    clang-4.0: error: cannot specify -o when generating multiple output files
    clang-4.0: error: cannot specify -o when generating multiple output files

@pmargom
Copy link

pmargom commented May 27, 2019

Hi,

My xCode info is:

image

I faced similar errors during xcode building projects (native swift, flutter, react native, native script) in which I got error messages related to clang compilar. Errors like:

  • clang-4.0: error: no such file or directory: '/Users/xxxxxxxx/Library/Developer/Xcode/DerivedData/xxxxxxxxxxxxxxx/Index/Data Store'
  • clang-4.0: error: cannot specify -o when generating multiple output files
  • others

Despite of errors related with DerivedData for native apps can be fixed by deleting the directory and, eventually, restart xCode and even restart the machine... in this case, you will see that after deleting the directory and start building process again, the error comes back.

Then, is the moment of checking the clang installation by running clang --version. The normal output will be something like:

image

as you can see the InstalledDir is incorrect for xCode. In my case, some days ago I needed to install Anaconda app (R, Python, etc) and, now, I remember that I had to install some dependencies and one of them was clang and its installation was altered.
To fix this problem (in my case that I will not need anaconda any more): (edited)

1.- Delete anaconda and all its dependencies (I recommend to use App Cleaner).
2.- Re-install xCode

After reinstalling xCode, if you type again clang --version, you'll get this:

image

This fix will helps you to prevent not only the mentioned issue, in addition, all issues related to clang compiler.

Hopefully, this info helps some else.

Best

@8Gitbrix
Copy link
Author

Thank you!
I had the same issue. I deactivated my conda environment using conda deactivate, and was able to run the ios simulator through my terminal.
I still don't know how to use the debugger in VSCode though, since it seems to activate the conda environment before it runs.

@woodymoo
Copy link

woodymoo commented Jun 7, 2019

Thank you!
I had the same issue. I deactivated my conda environment using conda deactivate, and was able to run the ios simulator through my terminal.
I still don't know how to use the debugger in VSCode though, since it seems to activate the conda environment before it runs.

Thank you very much. "conda deactive" works. It works.

@lord-zeus
Copy link

Thank you!
I had the same issue. I deactivated my conda environment using conda deactivate, and was able to run the ios simulator through my terminal.
I still don't know how to use the debugger in VSCode though, since it seems to activate the conda environment before it runs.

Thank you very much. "conda deactive" works. It works.

conda deactivate

@CollectEstate
Copy link

Hi,

My xCode info is:

image

I faced similar errors during xcode building projects (native swift, flutter, react native, native script) in which I got error messages related to clang compilar. Errors like:

  • clang-4.0: error: no such file or directory: '/Users/xxxxxxxx/Library/Developer/Xcode/DerivedData/xxxxxxxxxxxxxxx/Index/Data Store'
  • clang-4.0: error: cannot specify -o when generating multiple output files
  • others

Despite of errors related with DerivedData for native apps can be fixed by deleting the directory and, eventually, restart xCode and even restart the machine... in this case, you will see that after deleting the directory and start building process again, the error comes back.

Then, is the moment of checking the clang installation by running clang --version. The normal output will be something like:

image

as you can see the InstalledDir is incorrect for xCode. In my case, some days ago I needed to install Anaconda app (R, Python, etc) and, now, I remember that I had to install some dependencies and one of them was clang and its installation was altered.
To fix this problem (in my case that I will not need anaconda any more): (edited)

1.- Delete anaconda and all its dependencies (I recommend to use App Cleaner).
2.- Re-install xCode

After reinstalling xCode, if you type again clang --version, you'll get this:

image

This fix will helps you to prevent not only the mentioned issue, in addition, all issues related to clang compiler.

Hopefully, this info helps some else.

Best

This made my day! I wasted 3 days on debugging what is going on and the deactivation conda works fine. Thanks a lot!

@github-actions
Copy link

github-actions bot commented Aug 9, 2021

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
platform-ios iOS applications specifically t: xcode "xcodebuild" on iOS and general Xcode project management tool Affects the "flutter" command-line tool. See also t: labels.
Projects
None yet
Development

No branches or pull requests

6 participants