swhitty
(Simon Whitty)
June 30, 2023, 3:57am
1
Feedback raised: FB12477645
β Reporting here for visibility of others.
I maintain a project that was failing to build in Xcode 15 beta 1/2. It failed with error:
Cycle inside <Target>; building could produce unreliable results.
I narrowed it down and reproduced in a new project with these 2 steps:
Add blank build script phase with input files: $(TARGET_BUILD_DIR)/$(INFOPLIST_PATH)
Add a binary SPM package like twilio-video-ios or medallia
Either of the steps on their own is OK, but when both are applied the build error occurs.
6 Likes
aurora14
(Alexei )
July 7, 2023, 1:14am
2
For what it's worth, it's still happening in Beta 3. We have two production apps that aren't building because of this :(
The issue is still present in beta 4.
I was using a build phase to inject values in Info.plist during the build and in Xcode 15 betas this results in a "cycle".
The workaround I came up with is using Info.plist preprocessor prefix file.
Instead of modifying Info.plist directly in the build phase, it now adds values to the prefix header
echo "#define KEY VALUE" > "${BUILT_PRODUCTS_DIR}/My-Info.plist-Prefix.pch"
And set $(BUILT_PRODUCTS_DIR)/My-Info.plist-Prefix.pch
as an output file of the build phase.
Then, enable Preprocess Info.plist File
build setting and set prefix file to the same path as in the build phase.
If everything is done correctly, Xcode will replace stubs in Info.plist with values from the prefix file.
This isn't a perfect solution, but at least it unblocks builds on Xcode 15.
1 Like
@azarovalex Thanks for replying. I encountered the same issue. Could you give a more specified clarification for each step? Thanks very much.
Sure thing, @jonathanim .
Let's say you had a build phase that injected some dynamic value INJECTED_VALUE
to Info.plist with a key PLIST_KEY
. This is my use case that stopped working in Xcode 15 betas, and here is what I did as a workaround:
First, add this key to Info.plist with a mocked value that later will be replaced, let's say
<key>PLIST_KEY</key>
<string>MOCKED_VALUE</string>
Then change the build phase that previously modified the Info.plist to generate a .pch file:
echo "#define MOCKED_VALUE INJECTED_VALUE" > "${BUILT_PRODUCTS_DIR}/My-Info.plist-Prefix.pch"
Add $(BUILT_PRODUCTS_DIR)/My-Info.plist-Prefix.pch
as an output file of the build phase.
Lastly, enable the "Preprocess Info.plist File" build setting in your target and set "Info.plist Preprocessor Prefix File" to the same prefix file $(BUILT_PRODUCTS_DIR)/Dash-Info.plist-Prefix.pch
.
After following these steps Xcode will now substitute the value in your Info.plist with runtime generated values that the build phase is writing in the prefix header. Hope that solves your problem.
2 Likes
Oh my goodness. This is a lifesaver post, I didn't know we could use precompiled headers in Info.plist and this worked a treat! Thank you!
2 Likes
aurora14
(Alexei )
July 25, 2023, 11:38pm
7
This is still present in the Beta 5, - however for those with Crashlytics in their project, this might help:
opened 03:21AM - 25 Jun 23 UTC
api: crashlytics
needs-attention
Xcode 15 - iOS 17
### Description
When I use Xcode 15 beta1 and beta2 to build my product, Xcode β¦ show up an error message:
```
Showing All Messages
Cycle inside SaleAppDev; building could produce unreliable results.
Cycle details:
β Target 'SaleAppDev': ExtractAppIntentsMetadata
β That command depends on command in Target 'SaleAppDev': script phase βRun Firebase Crashlytics Frameworkβ
β Target 'SaleAppDev' has a command with output '/Users/galvin/Library/Developer/Xcode/DerivedData/SaleApp-bflooukvzshbnyftcyfhikcrvfzk/Build/Products/Debug-iphonesimulator/SaleAppDev.app.dSYM'
β Target 'SaleAppDev' has process command with output '/Users/galvin/Library/Developer/Xcode/DerivedData/SaleApp-bflooukvzshbnyftcyfhikcrvfzk/Build/Products/Debug-iphonesimulator/SaleAppDev.app/Info.plist'
β Target 'SaleAppDev' has copy command from '/Users/galvin/Library/Developer/Xcode/DerivedData/SaleApp-bflooukvzshbnyftcyfhikcrvfzk/SourcePackages/artifacts/aws-sdk-ios-spm/AWSCore/AWSCore.xcframework/ios-arm64_i386_x86_64-simulator/AWSCore.framework' to '/Users/galvin/Library/Developer/Xcode/DerivedData/SaleApp-bflooukvzshbnyftcyfhikcrvfzk/Build/Products/Debug-iphonesimulator/SaleAppDev.app/Frameworks/AWSCore.framework'
Raw dependency cycle trace:
target: ->
node: <all> ->
command: <all> ->
node: /Users/galvin/Library/Developer/Xcode/DerivedData/SaleApp-bflooukvzshbnyftcyfhikcrvfzk/Build/Intermediates.noindex/SaleApp.build/Debug-iphonesimulator/SaleAppDev.build/Objects-normal/arm64/ExtractedAppShortcutsMetadata.stringsdata ->
command: P0:target-SaleAppDev-9158ce05fb5c3595d8f47cfea6cad708268edd9a57a401552e80349710d5b9ad-:Debug:ExtractAppIntentsMetadata ->
node: <target-SaleAppDev-9158ce05fb5c3595d8f47cfea6cad708268edd9a57a401552e80349710d5b9ad--package-copy-files-phase> ->
command: P0:::Gate target-SaleAppDev-9158ce05fb5c3595d8f47cfea6cad708268edd9a57a401552e80349710d5b9ad--package-copy-files-phase ->
CYCLE POINT ->
node: <target-SaleAppDev-9158ce05fb5c3595d8f47cfea6cad708268edd9a57a401552e80349710d5b9ad--fused-phase3-copy-files> ->
command: P0:::Gate target-SaleAppDev-9158ce05fb5c3595d8f47cfea6cad708268edd9a57a401552e80349710d5b9ad--fused-phase3-copy-files ->
node: <target-SaleAppDev-9158ce05fb5c3595d8f47cfea6cad708268edd9a57a401552e80349710d5b9ad--fused-phase2-run-firebase-crashlytics-framework> ->
command: P0:::Gate target-SaleAppDev-9158ce05fb5c3595d8f47cfea6cad708268edd9a57a401552e80349710d5b9ad--fused-phase2-run-firebase-crashlytics-framework ->
node: <execute-shell-script-9158ce05fb5c3595d8f47cfea6cad70818949a790f5e1b8e3c3cfd1c5335f867-target-SaleAppDev-9158ce05fb5c3595d8f47cfea6cad708268edd9a57a401552e80349710d5b9ad-> ->
command: P2:target-SaleAppDev-9158ce05fb5c3595d8f47cfea6cad708268edd9a57a401552e80349710d5b9ad-:Debug:PhaseScriptExecution Run Firebase Crashlytics Framework /Users/galvin/Library/Developer/Xcode/DerivedData/SaleApp-bflooukvzshbnyftcyfhikcrvfzk/Build/Intermediates.noindex/SaleApp.build/Debug-iphonesimulator/SaleAppDev.build/Script-3AE1F9A71AA6D7E600F7C8E5.sh ->
node: /Users/galvin/Library/Developer/Xcode/DerivedData/SaleApp-bflooukvzshbnyftcyfhikcrvfzk/Build/Products/Debug-iphonesimulator/SaleAppDev.app.dSYM/Contents/Resources/DWARF/SaleAppDev ->
command: P0:target-SaleAppDev-9158ce05fb5c3595d8f47cfea6cad708268edd9a57a401552e80349710d5b9ad-:Debug:GenerateDSYMFile /Users/galvin/Library/Developer/Xcode/DerivedData/SaleApp-bflooukvzshbnyftcyfhikcrvfzk/Build/Products/Debug-iphonesimulator/SaleAppDev.app.dSYM /Users/galvin/Library/Developer/Xcode/DerivedData/SaleApp-bflooukvzshbnyftcyfhikcrvfzk/Build/Products/Debug-iphonesimulator/SaleAppDev.app/SaleAppDev ->
node: /Users/galvin/Library/Developer/Xcode/DerivedData/SaleApp-bflooukvzshbnyftcyfhikcrvfzk/Build/Products/Debug-iphonesimulator/SaleAppDev.app/Info.plist ->
command: P0:target-SaleAppDev-9158ce05fb5c3595d8f47cfea6cad708268edd9a57a401552e80349710d5b9ad-:Debug:ProcessInfoPlistFile /Users/galvin/Library/Developer/Xcode/DerivedData/SaleApp-bflooukvzshbnyftcyfhikcrvfzk/Build/Products/Debug-iphonesimulator/SaleAppDev.app/Info.plist /*project path*/SaleAppDev-Info.plist ->
node: /Users/galvin/Library/Developer/Xcode/DerivedData/SaleApp-bflooukvzshbnyftcyfhikcrvfzk/Build/Products/Debug-iphonesimulator/SaleAppDev.app/Frameworks/AWSCore.framework ->
command: P0:target-SaleAppDev-9158ce05fb5c3595d8f47cfea6cad708268edd9a57a401552e80349710d5b9ad-:Debug:Copy /Users/galvin/Library/Developer/Xcode/DerivedData/SaleApp-bflooukvzshbnyftcyfhikcrvfzk/Build/Products/Debug-iphonesimulator/SaleAppDev.app/Frameworks/AWSCore.framework /Users/galvin/Library/Developer/Xcode/DerivedData/SaleApp-bflooukvzshbnyftcyfhikcrvfzk/SourcePackages/artifacts/aws-sdk-ios-spm/AWSCore/AWSCore.xcframework/ios-arm64_i386_x86_64-simulator/AWSCore.framework ->
node: <target-SaleAppDev-9158ce05fb5c3595d8f47cfea6cad708268edd9a57a401552e80349710d5b9ad--fused-phase3-copy-files>
```
This error only show up in some specific situations. My app contains some SPM libraries:
a. firebase (https://github.com/firebase/firebase-ios-sdk, 10.10.0, with Crashlytics upload script)
b. aws ios sdk (https://github.com/aws-amplify/aws-sdk-ios-spm, 2.33.0)
c. cardio (https://github.com/verygoodsecurity/CardIOSDK-iOS.git, 5.5.7)
d. some other library, not important
For Xcode 14:
a+b+c+d: build success β
For Xcode 15 beta1 and beta2:
a+b+c+d: build failed, cycle inside error β
a+c+d: build failed, cycle inside error β
a+b+d: build failed, cycle inside error β
a+d: build success β
b+c+d: build success β
a+b+c+d, but remove the `${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}/Contents/Resources/DWARF/${TARGET_NAME}` for Crashlytics upload script in `Input Files`: build success β
Looks like there is a conflict with the input files of Crashlytics upload script and some xcframework library.
### Reproducing the issue
_No response_
### Firebase SDK Version
10.10.0
### Xcode Version
15.0 beta.2
### Installation Method
Swift Package Manager
### Firebase Product(s)
Crashlytics
### Targeted Platforms
iOS
### Relevant Log Output
_No response_
### If using Swift Package Manager, the project's Package.resolved
<details>
<summary>Expand <code>Package.resolved</code> snippet</summary>
<br>
```json
{
"identity" : "firebase-ios-sdk",
"kind" : "remoteSourceControl",
"location" : "https://github.com/firebase/firebase-ios-sdk",
"state" : {
"revision" : "5034479ca0c4f32f299677fb0ba1fe4d3e3e20b4",
"version" : "10.10.0"
}
}
```
</details>
### If using CocoaPods, the project's Podfile.lock
<details>
<summary>Expand <code>Podfile.lock</code> snippet</summary>
<br>
```yml
Replace this line with the contents of your Podfile.lock!
```
</details>
5calls:main
β 5calls:abizern/build-cycle
opened 12:11PM - 24 Jul 23 UTC
When building with Xcode 17 there is a error caused by a build cycle being detec⦠ted.
Turns out this is an issue with the Crashlytics script and fixed with the suggestion here: https://github.com/firebase/firebase-ios-sdk/issues/11471
This worked to make builds compile successfully for me, - might be worth checking to make sure it doesn't have any ill side effects for the Crashlytics functionality though
Not sure if it helps in your situation. I fixed this problem by following the answers in this post Cycle inside my app on XCode 15 be⦠| Apple Developer Forums
Check comments of Akira_Hayakawa_Atsurae .
In my case, the following solved the problem. I paid attention again to the order of the Build Phase. When I was checking the Build Phase, I found that the "Embed Foundation Extensions" (Widget Extension) related to WatchApp were last in the order. (RunScript was also executed in the middle). I noticed this and solved the problem by rearranging the order of Embed Foundation Extensions to be right after Copy Bundle Resources.
2 Likes
jaleel
(Jaleel Akbashev)
July 26, 2023, 8:07am
9
Oh, thx, this helped in my case!