-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Description
Steps to reproduce
- Create new Flutter project,
flutter create custom_product_name. - Change product name in iOS project build settings to contain dots, something like
Name.With.Dots.open ios/Runner.xcworkspace-> in Xcode UI goRunner-> Build Settings -> Packaging -> Product Name -> change it and save. - Set up code signing settings to be able to build ipa.
- Run
flutter build ipa(include your code signing arguments based on previous step).
Expected results
Running command flutter build ipa completes successfully and ipa is created in ./build/ios/ipa.
Actual results
Running command flutter build ipa exits with error messages, but with successful status code 0.
Underlying xcodebuild archive completes successfully, but generated xcarchive is not exported because the archive does not exist in expected path, where the expectation is wrong. Expected archive path is
./build/ios/archive/Custom.XCarchive.xcarchive
whereas it should be
./build/ios/archive/Custom.XCarchive.Name.xcarchive
That is, if we split the product name on dots, then the rightmost part with the dot is discarded from expected archive name.
Eventually building ipa is halted because archive not found. Moreover, Flutter even suggests to try distribute the archive in Xcode, even though it is already clear that the the archive does not exist.
So I see at least three issues here:
- Successful exit code
0on failed build. - Archive is looked up from wrong place.
- Invalid suggestion to resolve the issue.
Code sample
Sample repository: https://github.com/priitlatt/flutter_ios_project_name_with_dots
Relevant Xcode project chagnes
12:37:37 priit@marmot custom_xcarchive_name main grep -r "Custom.XCarchive.Name" .
./ios/Runner.xcodeproj/project.pbxproj: 97C146EE1CF9000F007C117D /* Custom.XCarchive.Name.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Custom.XCarchive.Name.app; sourceTree = BUILT_PRODUCTS_DIR; };
./ios/Runner.xcodeproj/project.pbxproj: 97C146EE1CF9000F007C117D /* Custom.XCarchive.Name.app */,
./ios/Runner.xcodeproj/project.pbxproj: productReference = 97C146EE1CF9000F007C117D /* Custom.XCarchive.Name.app */;
./ios/Runner.xcodeproj/project.pbxproj: PRODUCT_NAME = Custom.XCarchive.Name;
./ios/Runner.xcodeproj/project.pbxproj: PRODUCT_NAME = Custom.XCarchive.Name;
./ios/Runner.xcodeproj/project.pbxproj: PRODUCT_NAME = Custom.XCarchive.Name;
./ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: BuildableName = "Custom.XCarchive.Name.app"
./ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: BuildableName = "Custom.XCarchive.Name.app"
./ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: BuildableName = "Custom.XCarchive.Name.app"
./ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: BuildableName = "Custom.XCarchive.Name.app"Screenshots or Video
Logs
flutter build ipa --export-options-plist export_options.plist logs
Archiving io.nevercode.customXcarchiveName...
Automatically signing iOS for device deployment using specified development team in Xcode project: X8NNQ9CYL2
Running Xcode build...
└─Compiling, linking and signing... 1,617ms
Xcode archive done. 8.2s
Archive succeeded but the expected xcarchive at /Users/priit/development/nevercode/custom_xcarchive_name/build/ios/archive/Custom.XCarchive.xcarchive not found
Built /Users/priit/development/nevercode/custom_xcarchive_name/build/ios/archive/Custom.XCarchive.xcarchive.
Invalid iOS archive. Does not contain Info.plist.
[!] App Icon and Launch Image Assets Validation
! App icon is set to the default placeholder icon. Replace with unique icons.
! Launch image is set to the default placeholder icon. Replace with unique launch image.
To update the settings, please refer to https://docs.flutter.dev/deployment/ios
Building App Store IPA... 393ms
Encountered error while creating the IPA:
error: archive not found at path '/Users/priit/development/nevercode/custom_xcarchive_name/build/ios/archive/Custom.XCarchive.xcarchive'
Try distributing the app in Xcode: "open /Users/priit/development/nevercode/custom_xcarchive_name/build/ios/archive/Custom.XCarchive.xcarchive"See verbose logs from https://gist.github.com/priitlatt/2fa74c6a47c19eb2a8055f40eaaf4dfa
Flutter Doctor output
Doctor output
[✓] Flutter (Channel stable, 3.16.4, on macOS 14.1.1 23B81 darwin-arm64, locale en-GB)
• Flutter version 3.16.4 on channel stable at /Users/priit/Library/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 2e9cb0aa71 (4 days ago), 2023-12-11 14:35:13 -0700
• Engine revision 54a7145303
• Dart version 3.2.3
• DevTools version 2.28.4
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
• Android SDK at /Users/priit/Library/Android/sdk
• Platform android-34, build-tools 34.0.0
• Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 15.0.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 15A507
• CocoaPods version 1.14.3
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2023.1)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314)
[✓] VS Code (version 1.84.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension can be installed from:
🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
[✓] Connected device (2 available)
• macOS (desktop) • macos • darwin-arm64 • macOS 14.1.1 23B81 darwin-arm64
• Chrome (web) • chrome • web-javascript • Google Chrome 120.0.6099.109
[✓] Network resources
• All expected network resources are available.
• No issues found!