New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to rename debug/release configurations in Xcode #11412

Closed
KevinTheGray opened this Issue Jul 26, 2017 · 9 comments

Comments

Projects
None yet
4 participants
@KevinTheGray
Copy link

KevinTheGray commented Jul 26, 2017

Some times you don't want a debug/release build, you want more specifically named builds. For example, you have a Staging server and a Production server. In these cases you want to have four configurations: debug-staging, debug-production, release-staging, release-production.

If you rename the default debug/release configurations. Flutter run will fail, and it is not possible to build from Xcode. The errors I see are listed below

Currently I can work around this by keeping the default configurations there, and adding the specific configurations as well. But I'm not sure if there are any unknown implications and it is not ideal.

Steps to Reproduce

Make a flutter project, rename the debug/release configurations

Logs

Running pod install...                                3.2s
Running Xcode build...                               26.3s
Failed to build iOS app
Error output from Xcode build:
↳
    ** BUILD FAILED **
    
    
    The following build commands failed:
    	Ld /Users/KG/Developer/Client/app-flutter/build/ios/Release-FBDebug-iphoneos/Runner.app/Runner normal arm64
    (1 failure)
Xcode's output:
↳
    Build settings from command line:
        ARCHS = arm64
        BUILD_DIR = /Users/KG/Developer/Client/app-flutter/build/ios
        ONLY_ACTIVE_ARCH = YES
        SDKROOT = iphoneos10.3
    
    === CLEAN TARGET GTMSessionFetcher OF PROJECT Pods WITH CONFIGURATION Release ===
    
    Check dependencies
    
    Clean.Remove clean /Users/KG/Developer/Client/app-flutter/build/ios/Release-iphoneos/GTMSessionFetcher/libGTMSessionFetcher.a
        builtin-rm -rf /Users/KG/Developer/Client/app-flutter/build/ios/Release-iphoneos/GTMSessionFetcher/libGTMSessionFetcher.a
// .... more but it's a lot more 

Flutter Doctor

[✓] Flutter (on Mac OS X 10.12.4 16E195, locale en-US, channel master)
    • Flutter at /Users/KG/Developer/Flutter/flutter
    • Framework revision 5278588d80 (2 days ago), 2017-07-24 14:00:48 -0700
    • Engine revision 3a12bc092d
    • Tools Dart version 1.25.0-dev.7.0

[✓] Android toolchain - develop for Android devices (Android SDK 26.0.0)
    • Android SDK at /Users/KG/Library/Android/sdk
    • Platform android-26, build-tools 26.0.0
    • ANDROID_HOME = /Users/KG/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_112-release-b06)

[✓] iOS toolchain - develop for iOS devices (Xcode 8.3.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 8.3.3, Build version 8E3004b
    • ios-deploy 1.9.1
    • CocoaPods version 1.2.1

[✓] Android Studio
    • Android Studio at /Applications/Android Studio 3.0 Preview.app/Contents
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-884-b01)

[✓] Android Studio (version 2.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Java version OpenJDK Runtime Environment (build 1.8.0_112-release-b06)

[✓] IntelliJ IDEA Community Edition (version 2017.2)
    • Flutter plugin version 15.2
    • Dart plugin version 172.3317.48
@eseidelGoogle

This comment has been minimized.

Copy link
Contributor

eseidelGoogle commented Jul 26, 2017

I believe @cbracken looked at this at one point.

@mravn-google

This comment has been minimized.

Copy link
Contributor

mravn-google commented Nov 2, 2017

You can set up custom Xcode schemes and use them with the --flavor option in Flutter tooling:

flutter run --debug --flavor staging
flutter run --debug --flavor production
flutter run --release --flavor staging
flutter run --release --flavor production
@xster

This comment has been minimized.

Copy link
Contributor

xster commented Nov 17, 2017

@alardizabal, we talked about this this week.

Do you think this solution works for you? It's a bit different from your current setup but could accomplish the same options you want currently.

Right now you guys have 1 scheme:

  • We'll call it A

and 8 build configurations:

  • Debug
  • Debug-B
  • Debug-C
  • Debug-D
  • Release
  • Release-B
  • Release-C
  • Release-D

and they're all disconnected from your flutter build modes.

The way @mravn-google built it means you can have your intended effects (I think) by having 3 schemes:

  • B
  • C
  • D

Keep your build configurations as is:

  • Debug
  • Debug-B
  • Debug-C
  • Debug-D
  • Release
  • Release-B
  • Release-C
  • Release-D

Though I'm not sure what 'Debug' and 'Release' without the FB toggle means.

Then also use the flutter build modes to cross multiply.

So to get Debug-B, you'd build flutter run --debug --flavor B.

The build config names are bound to the flutter build modes (fixed to Debug and Release) and your scheme names (anything you want) in the form of [flutter build mode]-[scheme name].

Would that work for you?

@mravn-google is the project flavor customization documented?

@mravn-google

This comment has been minimized.

Copy link
Contributor

mravn-google commented Nov 17, 2017

@xster So far only in flutter run --help and here.

You don't have to name your Xcode build configurations [build mode]-[scheme name] with a hyphen. Flutter tooling insists that there be a unique build configuration whose name contains both the build mode and the scheme name as substrings.

@xster

This comment has been minimized.

Copy link
Contributor

xster commented Nov 17, 2017

Ah cool. So pragmatically, it gives them the option to have something like
Debug-B-X, Debug-C-X, Debug-X-D, X-Release-B etc be still valid as long as schemes are B, C, D and build modes Debug and Release?

@mravn-google

This comment has been minimized.

Copy link
Contributor

mravn-google commented Nov 17, 2017

@xster Yes. And they may have spaces or dots or whatever instead of hyphens. As long as Xcode accepts the build config name and it maps uniquely to a scheme/build mode pair, we're good.

@xster

This comment has been minimized.

Copy link
Contributor

xster commented Nov 17, 2017

@KevinTheGray, @alardizabal, is the current customizability good enough for you guys so far?

@KevinTheGray

This comment has been minimized.

Copy link

KevinTheGray commented Mar 13, 2018

@xster yes this works for our needs, thanks

@xster

This comment has been minimized.

Copy link
Contributor

xster commented Mar 16, 2018

Tentatively closing this for now since it's possible to customize via schemes. Please reopen if there are additional needs.

@xster xster closed this Mar 16, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment