Skip to content

Commit 5df8e59

Browse files
committed
Fix 3572: More aggressive iOS SDK 18.1 support fix (Qt workaround)
1 parent 46221b0 commit 5df8e59

File tree

2 files changed

+77
-3
lines changed

2 files changed

+77
-3
lines changed

.github/autobuild/ios.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ setup() {
7979
build_app_as_ipa() {
8080
# Add the Qt binaries to the PATH:
8181
export PATH="${QT_DIR}/${QT_VERSION}/ios/bin:${PATH}"
82+
# Set deployment target and SDK version to match what Xcode 16.2.0 provides
83+
export IPHONEOS_DEPLOYMENT_TARGET=15.0
8284
./ios/deploy_ios.sh
8385
}
8486

ios/deploy_ios.sh

Lines changed: 75 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,81 @@ set -eu -o pipefail
33

44
## Builds an ipa file for iOS. Should be run from the repo-root
55

6-
# Create Xcode file and build
7-
qmake -spec macx-xcode Jamulus.pro
8-
/usr/bin/xcodebuild -project Jamulus.xcodeproj -scheme Jamulus -configuration Release clean archive -archivePath "build/Jamulus.xcarchive" CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO CODE_SIGN_ENTITLEMENTS=""
6+
# Find the latest iOS SDK available in Xcode
7+
AVAILABLE_SDK=$(xcrun --sdk iphoneos --show-sdk-version 2>/dev/null || echo "")
8+
if [ -z "$AVAILABLE_SDK" ]; then
9+
echo "Error: No iOS SDK found in Xcode"
10+
exit 1
11+
fi
12+
echo "Using iOS SDK: $AVAILABLE_SDK"
13+
14+
# Create Xcode file and build with explicit iOS deployment target and SDK version
15+
qmake -spec macx-xcode QMAKE_IPHONEOS_DEPLOYMENT_TARGET=15.0 QMAKE_IOS_DEPLOYMENT_VERSION=15.0 Jamulus.pro
16+
17+
# Fix the Xcode project to remove references to iOS versions not available in the current Xcode
18+
# Replace iOS 18.2+ with 18.1 (the latest available in Xcode 16.2.0)
19+
# This is a temporary workaround and should be removed once Qt is built with compatible SDK versions
20+
if [ -f "Jamulus.xcodeproj/project.pbxproj" ]; then
21+
# Search for storyboard files that contain iOS 18.2+ references
22+
STORYBOARD_FILES=$(find Jamulus.xcodeproj -name "*.storyboard" -type f)
23+
FOUND_ISSUES=0
24+
25+
for STORYBOARD in $STORYBOARD_FILES; do
26+
# Check for iOS 18.2+ references
27+
if grep -qE '18\.[2-9]' "$STORYBOARD" 2>/dev/null; then
28+
echo "Found iOS 18.2+ references in: $STORYBOARD"
29+
FOUND_ISSUES=1
30+
# Replace various formats of iOS versions
31+
# Use -E for extended regex to handle edge cases
32+
sed -i '' -E 's/18\.[2-9]/18.1/g' "$STORYBOARD"
33+
echo "Applied fixes to: $STORYBOARD"
34+
fi
35+
done
36+
37+
# Also check and fix pbxproj file
38+
if grep -qE '18\.[2-9]' Jamulus.xcodeproj/project.pbxproj; then
39+
echo "Found iOS 18.2+ references in project.pbxproj, applying fixes..."
40+
FOUND_ISSUES=1
41+
sed -i '' -E 's/18\.[2-9]/18.1/g' Jamulus.xcodeproj/project.pbxproj
42+
fi
43+
44+
if [ $FOUND_ISSUES -eq 0 ]; then
45+
echo "WARNING: No iOS 18.2+ references found in Xcode project files."
46+
echo "The sed workaround in deploy_ios.sh may no longer be needed and should be reviewed for removal."
47+
fi
48+
fi
49+
# After qmake generates the project, try to modify storyboards with plutil (XML plist editor)
50+
# This handles both binary and XML plist formats
51+
echo "Attempting to modify storyboard iOS version requirements..."
52+
for storyboard in $(find Jamulus.xcodeproj -name "*.storyboard" 2>/dev/null || true); do
53+
echo "Found storyboard: $storyboard"
54+
echo " Type: $(file "$storyboard")"
55+
# Try plutil to modify any iOS version requirements
56+
if command -v plutil &> /dev/null; then
57+
# Try to set iOS version to 18.1 if present
58+
echo " Attempting plutil modifications..."
59+
if plutil -replace targetRuntimeVersion -string 18.1 "$storyboard" 2>&1; then
60+
echo " ✓ Modified targetRuntimeVersion"
61+
fi
62+
# Also try to set deployment target
63+
if plutil -replace 'NSStoryboardVersion' -string 18.1 "$storyboard" 2>&1; then
64+
echo " ✓ Modified NSStoryboardVersion"
65+
fi
66+
# Try another possible key
67+
if plutil -replace minimumVersion -string 18.1 "$storyboard" 2>&1; then
68+
echo " ✓ Modified minimumVersion"
69+
fi
70+
# Try to dump and see what keys exist
71+
echo " Storyboard keys:"
72+
plutil -p "$storyboard" 2>/dev/null | head -20 || true
73+
fi
74+
done
75+
76+
# Build with explicit iOS deployment target and device SDK to avoid simulator and SDK mismatch errors
77+
/usr/bin/xcodebuild -project Jamulus.xcodeproj -scheme Jamulus -configuration Release -sdk iphoneos clean archive -archivePath "build/Jamulus.xcarchive" \
78+
IPHONEOS_DEPLOYMENT_TARGET=15.0 \
79+
SDKROOT=iphoneos \
80+
CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO CODE_SIGN_ENTITLEMENTS=""
981

1082
# Generate ipa by copying the .app file from the xcarchive directory
1183
mkdir build/Payload

0 commit comments

Comments
 (0)