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

Xcode 15 Beta 5 fix: Fix build failed due to DT_TOOLCHAIN_DIR #12009

Merged
merged 5 commits into from Jul 30, 2023

Conversation

marcuswu0814
Copy link
Contributor

Fix build failed on Xcode 15 Beta 5, also try on 14.3.1 and worked.

marcuswu0814 added a commit to marcuswu0814/cocoapods-integration-specs that referenced this pull request Jul 26, 2023
@marcuswu0814
Copy link
Contributor Author

Also update spec for test CocoaPods/cocoapods-integration-specs#345

@andrea-vultaggio
Copy link

You beat me on time @marcuswu0814 , I was going to raise the same PR! Thank you, this is needed ASAP. It completely broke our CI and I am pretty sure we won't be alone.

@jmanalang3
Copy link

Screenshot 2023-07-26 at 1 30 43 PM

Xcode 15 beta 5
same issue

@marcuswu0814
Copy link
Contributor Author

Hi, @dnkoutso, could you please help to merge this PR and let me update the submodule and make CI green 🙏

CHANGELOG.md Outdated Show resolved Hide resolved
@marcuswu0814
Copy link
Contributor Author

@dnkoutso Submodules already updated, please take a look, thanks.

@marcuswu0814
Copy link
Contributor Author

I'm not sure is testing failed due to my change? Could someone please help me to figure it out. 😕

@bohdanpodvirnyi
Copy link

bohdanpodvirnyi commented Jul 27, 2023

@marcuswu0814 to me, it looks like you've changed Reachability spec, is it needed?
i think if you can revert changes in Reachability, tests should run successfully

@marcuswu0814
Copy link
Contributor Author

Hi @bohdanpodvirnyi, thanks so much for your help, I update the submodule with wrong command, now revert no need change.

@bohdanpodvirnyi
Copy link

@dnkoutso check pls

@bohdanpodvirnyi
Copy link

@marcuswu0814 still failing, but I don't get where the issue is

@dnkoutso
Copy link
Contributor

There is still a diff in integration specs

-LIBRARY_SEARCH_PATHS = $(inherited) "$(PLATFORM_DIR)/Developer/Library/Frameworks" "${TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" "${PODS_CONFIGURATION_BUILD_DIR}/MixedPod-library-iOS" "${PODS_CONFIGURATION_BUILD_DIR}/ObjCPod-library-iOS" "${PODS_CONFIGURATION_BUILD_DIR}/SwiftPod-library-iOS" /usr/lib/swift
+LIBRARY_SEARCH_PATHS = $(inherited) "$(PLATFORM_DIR)/Developer/Library/Frameworks" "${PODS_CONFIGURATION_BUILD_DIR}/MixedPod-library-iOS" "${PODS_CONFIGURATION_BUILD_DIR}/ObjCPod-library-iOS" "${PODS_CONFIGURATION_BUILD_DIR}/SwiftPod-library-iOS" "${TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" /usr/lib/swift

@marcuswu0814
Copy link
Contributor Author

@dnkoutso Seems a different path order cause the failed, but I'm not sure it relative with my change, should I update integration spec again?

@marcuswu0814
Copy link
Contributor Author

I create another PR for fix this, I'm pretty not sure the order of LIBRARY_SEARCH_PATHS is important, and also don't know why my change lead to this problem.

@justinseanmartin
Copy link
Contributor

@dnkoutso Seems a different path order cause the failed, but I'm not sure it relative with my change, should I update integration spec again?

This is because of the :sorted => true here. I've approved and merged CocoaPods/cocoapods-integration-specs#346, please bump the submodule here again.

As far as the ordering of the LIBRARY_SEARCH_PATHS, I don't think it'll cause new issues, but I could be wrong. Either way, it wasn't intentional before that the DT_TOOLCHAIN_DIR came earlier, and any pods specified ones came later.

@marcuswu0814
Copy link
Contributor Author

Hi @justinseanmartin, thanks for your explanation, and now the integration specs is update to date, please help to rerun the CI if you can. 🙏

@Sun3
Copy link

Sun3 commented Sep 23, 2023

New version worked for me... yea.

@engrkhalid
Copy link

i did the above. but i guess, it is pointing out to previous version of cocopods.

akind@Akshays-MacBook-Air ios % gem which cocoapods /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.13.0/lib/cocoapods.rb akind@Akshays-MacBook-Air ios % pod --version 1.12.1

Also, when i did the above mentioned steps, still I get COCOAPODS: 1.12.1 in Podfile.lock

Same issue!
Any solution?

@engrkhalid
Copy link

engrkhalid commented Sep 24, 2023

I found the solution 😃
I have to use Homebrew:

brew upgrade cocoapods

pod --version -> 1.13.0

It's updated now 👍
But, my app need this before it works:
pichillilorenzo/flutter_inappwebview#1735 (comment)

@AkshayND
Copy link

The above issue is fixed, but i'm getting the below error now.

ios-deploy[7757:54806] [ !! ] Unable to locate DeviceSupport directory with suffix 'DeveloperDiskImage.dmg'. This probably means you don't have Xcode installed, you will need to launch the app manually and logging output will not be shown!

Not finding 17.0 in DeviceSupport.

Any idea on how to fix this?

You guys not having this issue??

@rraayy
Copy link

rraayy commented Sep 25, 2023

Try this!!

  1. sudo gem uninstall cocoapods

  2. brew uninstall cocoapods

  3. sudo gem install cocoapods

  4. pod setup

  5. flutter build ios

@sourabhbankar
Copy link

getting same issue on macOS(darwin)

@AkshayND
Copy link

Try this!!

  1. sudo gem uninstall cocoapods
  2. brew uninstall cocoapods
  3. sudo gem install cocoapods
  4. pod setup
  5. flutter build ios

Didn't work for me :(

cbracken added a commit to cbracken/flutter that referenced this pull request Sep 26, 2023
Due to changes in Xcode 15, several variables such as `DT_TOOLCHAIN_DIR`
have been eliminateed in favour of others such as `TOOLCHAIN_DIR`. This
broke CocoaPods support under Xcode 15, as reported in:
CocoaPods/CocoaPods#12012

@vashworth worked around this in Flutter in:
flutter#132803

The CocoaPods issue was resolved by the following PR to their repo:
CocoaPods/CocoaPods#12009
and was released in CocoaPods 1.13.0.

Also switches from an if-else chain to a switch for CocoaPodsStatus
handling.

Issue: flutter#133584
Related: flutter#132755
@alok2811
Copy link

alok2811 commented Sep 29, 2023

Upgarade Cocoapods v1.13.0

brew command

brew upgrade cocoapods

without brew

sudo gem upgrade cocoapods

@ismetdemirer
Copy link

Is there anyone who can help with this? I get the following error in Xcode 15 for all pods. Especially in objc files

Ekran Resmi 2023-09-29 23 56 30

@luizKorg
Copy link

luizKorg commented Oct 2, 2023

Ok, try [sudo] gem uninstall cocoapods and then try reinstall.

This worked for me, thank you very much!

sudo gem uninstall cocoapods
sudo gem install cocoapods
pod install

@UzairKhalid-crypto
Copy link

Issue Solved by simple One Command

  1. cd "Path of Your Project"
  2. pod repo update

@CodingMarkus
Copy link

Issue Solved by simple One Command

1. cd "Path of Your Project"

2. pod repo update

But only if you have CocoaPods 1.13.0 installed, which was just released a few days ago and explicitly addresses this issue in the release notes. So would everyone here please stop making it appear as all the posters before were just too stupid to run that command, as running that command two weeks ago or any time earlier fixed absolutely nothing. This is is now fixed with the latest version as @alok2811 pointed out 5 days ago.

@CodingMarkus
Copy link

Is there anyone who can help with this? I get the following error in Xcode 15 for all pods. Especially in objc files

Please create a new issue for that. Your problem is not related to the problem that this issue here was all about and thus people having a similar problem or the solution won't ever find your report here. This issue is only about builds failing because DT_TOOLCHAIN_DIR no longer works in Xcode 15 and must be replaced with TOOLCHAIN_DIR instead. Anything other than that is an issue of its own.

confiks pushed a commit to MinBZK/nl-wallet that referenced this pull request Oct 11, 2023
chrisbobbe pushed a commit to gnprice/zulip-flutter that referenced this pull request Oct 18, 2023
This is needed on Xcode 15, at least once certain packages are
pulled in.  (In particular, firebase_core, which I have in a
draft branch for handling notifications.)

Upstream issue thread:
  CocoaPods/CocoaPods#12009
@dknewman
Copy link

Im still having this issue with cocoapod v1.14.2 and XCode15.0.1 . I have a work around with a bash script I wrote that will replace DT_TOOLCHAIN_DIR with TOOLCHAIN_DIR, however now I'm running into an issue when I upload to the app store, it says my binaries are corrupt. I was just curious if anyone else ran into this?

@DevKasun
Copy link

DevKasun commented Dec 3, 2023

This is what I did and it's worked for me

Whenever you update the XCode, you need to update Cocoapods

brew upgrade cocoapods

clean the the installed packages using the command “flutter clean” and install again saving pubspec.yaml file. then on the project folder redirect to the ios folder and install pods again

pod install

That's it.

My Xcode version:
Version 15.0.1 (15A507)

@CodingMarkus
Copy link

Whenever you update the XCode, you need to update Cocoapods

That's what he did, he said he had version v1.14.2 installed what at the time of his posting was the latest released version.

@CodingMarkus
Copy link

Im still having this issue with cocoapod v1.14.2 and XCode15.0.1

If you still have this issue with 1.14.3, it may be related specifically to your project or setup, since in general this issue is fixed for most people, so you should probably create a new issue and provide as much detail as you can about your setup. You can refer to this issue in your report, so people can find your new issue just in case they accidentally end up here.

cbracken added a commit to flutter/flutter that referenced this pull request Dec 15, 2023
Due to changes in Xcode 15, several variables such as `DT_TOOLCHAIN_DIR`
have been eliminateed in favour of others such as `TOOLCHAIN_DIR`. This
broke CocoaPods support under Xcode 15, as reported in:
CocoaPods/CocoaPods#12012

@vashworth worked around this in Flutter in:
#132803

The CocoaPods issue was resolved by the following PR to their repo:
CocoaPods/CocoaPods#12009
and was released in CocoaPods 1.13.0.

Also switches from an if-else chain to a switch for CocoaPodsStatus
handling.

Related: #133584
Related: #132755

## Pre-launch Checklist

- [X] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [X] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [X] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [X] I signed the [CLA].
- [X] I listed at least one issue that this PR fixes in the description
above.
- [X] I updated/added relevant documentation (doc comments with `///`).
- [X] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [X] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#overview
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[test-exempt]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/wiki/Chat

Co-authored-by: Greg Spencer <gspencergoog@users.noreply.github.com>
Michal-MK pushed a commit to Michal-MK/flutter that referenced this pull request Jan 8, 2024
Due to changes in Xcode 15, several variables such as `DT_TOOLCHAIN_DIR`
have been eliminateed in favour of others such as `TOOLCHAIN_DIR`. This
broke CocoaPods support under Xcode 15, as reported in:
CocoaPods/CocoaPods#12012

@vashworth worked around this in Flutter in:
flutter#132803

The CocoaPods issue was resolved by the following PR to their repo:
CocoaPods/CocoaPods#12009
and was released in CocoaPods 1.13.0.

Also switches from an if-else chain to a switch for CocoaPodsStatus
handling.

Related: flutter#133584
Related: flutter#132755

## Pre-launch Checklist

- [X] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [X] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [X] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [X] I signed the [CLA].
- [X] I listed at least one issue that this PR fixes in the description
above.
- [X] I updated/added relevant documentation (doc comments with `///`).
- [X] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [X] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#overview
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[test-exempt]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/wiki/Chat

Co-authored-by: Greg Spencer <gspencergoog@users.noreply.github.com>
Markzipan pushed a commit to Markzipan/flutter that referenced this pull request Jan 9, 2024
Due to changes in Xcode 15, several variables such as `DT_TOOLCHAIN_DIR`
have been eliminateed in favour of others such as `TOOLCHAIN_DIR`. This
broke CocoaPods support under Xcode 15, as reported in:
CocoaPods/CocoaPods#12012

@vashworth worked around this in Flutter in:
flutter#132803

The CocoaPods issue was resolved by the following PR to their repo:
CocoaPods/CocoaPods#12009
and was released in CocoaPods 1.13.0.

Also switches from an if-else chain to a switch for CocoaPodsStatus
handling.

Related: flutter#133584
Related: flutter#132755

## Pre-launch Checklist

- [X] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [X] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [X] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [X] I signed the [CLA].
- [X] I listed at least one issue that this PR fixes in the description
above.
- [X] I updated/added relevant documentation (doc comments with `///`).
- [X] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [X] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#overview
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[test-exempt]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/wiki/Chat

Co-authored-by: Greg Spencer <gspencergoog@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet