From 64dbdada39638d763c1ef0dd07646eb95ecbd7bf Mon Sep 17 00:00:00 2001 From: Littlegnal <8847263+littleGnAl@users.noreply.github.com> Date: Wed, 1 Nov 2023 22:05:02 +0800 Subject: [PATCH] [example][ios] Fix build example failed with xcode 15 (#1418) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The user reports that it's failed to build the example with xcode 15 ``` Error (Xcode): Cycle inside Runner; building could produce unreliable results. Cycle details: → Target 'Runner': CodeSign /Users/joepritchard/Downloads/Agora-Flutter-SDK-main/example/build/ios/Debug-iphoneos/Runner.app ... ``` To fix it, we need to change the order in `Build Phases`. See - https://github.com/flutter/flutter/issues/135739 - https://github.com/flutter/flutter/issues/135056#issuecomment-1726407382 I added a new job to cover this case and retained the old `build_ios` job to ensure this change does not affect the user with xcode version < 15. --- .github/workflows/build.yml | 26 +++++++++++++++++++ example/ios/Flutter/AppFrameworkInfo.plist | 2 +- example/ios/Runner.xcodeproj/project.pbxproj | 23 +++++++++------- .../xcshareddata/xcschemes/Runner.xcscheme | 2 +- example/ios/Runner/Info.plist | 2 ++ 5 files changed, 43 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5576e547d..85e9057c1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -244,6 +244,32 @@ jobs: run: flutter build ios --no-codesign working-directory: example + # This job aim to cover https://github.com/flutter/flutter/issues/135739 + build_ios_xcode_15: + name: Build iOS with xcode 15.x + if: ${{ !contains(github.event.pull_request.labels.*.name, 'ci:skip') }} + strategy: + matrix: + version: ['3.13.6'] + runs-on: macos-13 + timeout-minutes: 120 + steps: + - uses: actions/checkout@v3 + - uses: subosito/flutter-action@v2 + with: + flutter-version: ${{ matrix.version }} + cache: true + - run: | # https://github.com/actions/runner-images/issues/6746#issuecomment-1380042553 + # set xcode version to use for build + sudo xcode-select -switch /Applications/Xcode_15.0.1.app + # Print used xCode version + xcode-select -print-path + xcodebuild -version + - run: flutter pub get + - name: Run flutter build ios --no-codesign + run: flutter build ios --no-codesign + working-directory: example + build_web: name: Build Web if: ${{ !contains(github.event.pull_request.labels.*.name, 'ci:skip') }} diff --git a/example/ios/Flutter/AppFrameworkInfo.plist b/example/ios/Flutter/AppFrameworkInfo.plist index 8d4492f97..9625e105d 100644 --- a/example/ios/Flutter/AppFrameworkInfo.plist +++ b/example/ios/Flutter/AppFrameworkInfo.plist @@ -21,6 +21,6 @@ CFBundleVersion 1.0 MinimumOSVersion - 9.0 + 11.0 diff --git a/example/ios/Runner.xcodeproj/project.pbxproj b/example/ios/Runner.xcodeproj/project.pbxproj index 3e27da7c3..01d61d20b 100644 --- a/example/ios/Runner.xcodeproj/project.pbxproj +++ b/example/ios/Runner.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 51; + objectVersion = 54; objects = { /* Begin PBXBuildFile section */ @@ -221,14 +221,14 @@ buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( 7E1B0C30D51B77496A1AE2E1 /* [CP] Check Pods Manifest.lock */, + 39CD36047290E845D66DC420 /* [CP] Embed Pods Frameworks */, + 71BBA3C328AB50E2007B0DBC /* Embed App Extensions */, 9740EEB61CF901F6004384FC /* Run Script */, 97C146EA1CF9000F007C117D /* Sources */, 97C146EB1CF9000F007C117D /* Frameworks */, 97C146EC1CF9000F007C117D /* Resources */, 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, - 39CD36047290E845D66DC420 /* [CP] Embed Pods Frameworks */, - 71BBA3C328AB50E2007B0DBC /* Embed App Extensions */, ); buildRules = ( ); @@ -246,7 +246,7 @@ 97C146E61CF9000F007C117D /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 1300; + LastUpgradeCheck = 1430; ORGANIZATIONNAME = ""; TargetAttributes = { 71BBA3B728AB50E2007B0DBC = { @@ -317,10 +317,12 @@ }; 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); inputPaths = ( + "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", ); name = "Thin Binary"; outputPaths = ( @@ -353,6 +355,7 @@ }; 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); @@ -479,7 +482,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -534,7 +537,7 @@ INFOPLIST_FILE = ScreenSharing/Info.plist; INFOPLIST_KEY_CFBundleDisplayName = ScreenSharing; INFOPLIST_KEY_NSHumanReadableCopyright = ""; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -571,7 +574,7 @@ INFOPLIST_FILE = ScreenSharing/Info.plist; INFOPLIST_KEY_CFBundleDisplayName = ScreenSharing; INFOPLIST_KEY_NSHumanReadableCopyright = ""; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -607,7 +610,7 @@ INFOPLIST_FILE = ScreenSharing/Info.plist; INFOPLIST_KEY_CFBundleDisplayName = ScreenSharing; INFOPLIST_KEY_NSHumanReadableCopyright = ""; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -671,7 +674,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -720,7 +723,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; diff --git a/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index c87d15a33..a6b826db2 100644 --- a/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,6 +1,6 @@ $(PRODUCT_BUNDLE_IDENTIFIER) + UIApplicationSupportsIndirectInputEvents +