Skip to content

iOS bundle ID output is incorrect when using flavors #72916

Closed
@harsimranmaan

Description

@harsimranmaan

I am observing an issue when building flavors. Building flavors picks up the defaultConfigurationName instead of the -configuration when looking at BuildSettings. This causes wrong messaging on console when printing the bundle id being built . In my case, I have two configs - Release-Dev and Release-prod. When showing the output for the prod build I see the dev BUNDLE_IDENTIFIER printed to the console. Below is a selective grep for -scheme in the verbose mode.

 If no build configuration is specified and -scheme is not passed then "Release-dev" is used.
[   +4 ms] executing: [/myapp/ios/Runner.xcodeproj/] /usr/bin/xcodebuild -project /myapp/ios/Runner.xcodeproj -scheme prod -showBuildSettings
[        ] executing: [/myapp/ios/Runner.xcodeproj/] /usr/bin/xcodebuild -project /myapp/ios/Runner.xcodeproj -scheme prod -showBuildSettings
               /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -project /myapp/ios/Runner.xcodeproj -scheme prod -showBuildSettings
[        ] executing: [/myapp/ios/] xcrun xcodebuild -configuration Release-prod VERBOSE_SCRIPT_LOGGING=YES -workspace Runner.xcworkspace -scheme prod BUILD_DIR=/myapp/build/ios -sdk iphoneos CODE_SIGNING_ALLOWED=NO CODE_SIGNING_REQUIRED=NO CODE_SIGNING_IDENTITY="" SCRIPT_OUTPUT_STREAM_FILE=/var/folders/wh/fhcq39c902q526w__rn697340000gn/T/flutter_tools.TlDLsq/flutter_build_log_pipe.p6V1GC/pipe_to_stdout FLUTTER_SUPPRESS_ANALYTICS=true COMPILER_INDEX_STORE_ENABLE=NO

As you can see the showBuildSettings do not include the -configuration.

Running /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -project /myapp/ios/Runner.xcodeproj -scheme prod -showBuildSettings -configuration Release-prod | grep BUNDLE_IDENTIFIER does pick up the correct identifier as expected. I think adding the -configuration to the showBuildSettings command would be an improvement. The build seems to be working as expected bar the console messaging.

[✓] Flutter (Channel stable, 1.22.4, on Mac OS X 10.15.7 19H15 darwin-x64, locale en-CA)
    • Flutter version 1.22.4 at /somepath/s/flutter
    • Framework revision 1aafb3a8b9 (2 weeks ago), 2020-11-13 09:59:28 -0800
    • Engine revision 2c956a31c0
    • Dart version 2.10.4


[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
    • Android SDK at /somepath/Library/Android/sdk
    • Platform android-30, build-tools 30.0.2
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 12.2)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.2, Build version 12B45b
    • CocoaPods version 1.10.0

[!] Android Studio (version 4.0)
    • Android Studio at /Applications/Android Studio.app/Contents
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)

[✓] VS Code (version 1.51.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.16.0


[✓] Connected device (2 available)
    • sdk gphone x86 arm (mobile) • emulator-5554                        • android-x86 • Android 11 (API 30) (emulator)
    • iPhone 12 Pro Max (mobile)  • 7C5E6E60-FCD0-4E02-85E0-37311B1E2D47 • ios         • com.apple.CoreSimulator.SimRuntime.iOS-14-2 (simulator)

! Doctor found issues in 1 category.

Issue extracted from #70576. @jmagman

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listt: xcode"xcodebuild" on iOS and general Xcode project managementtoolAffects the "flutter" command-line tool. See also t: labels.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions