'Flutter with flavors not building to iOS

Goody day,

When building to android I have no issues with using the flavors.

This is not the case for iOS, I receive the following error:

Finished with error: Exception: Source directory "/Users/[HOME]/[PROJECT]/build/ios/Release-iphonesimulator/Runner.app" does not exist, nothing to copy

Please see flutter doctor -v:

[✓] Flutter (Channel stable, v1.12.13+hotfix.9, on Mac OS X 10.15.4 19E266, locale en-ZA) • Flutter version 1.12.13+hotfix.9 at /Users/[HOME]/flutter • Framework revision f139b11009 (4 days ago), 2020-03-30 13:57:30 -0700 • Engine revision af51afceb8 • Dart version 2.7.2

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3) • Android SDK at /Users/[HOME]/Library/Android/sdk • Android NDK location not configured (optional; useful for native profiling support) • Platform android-29, build-tools 29.0.3 • ANDROID_HOME = /Users/[HOME]/Library/Android/sdk • ANDROID_SDK_ROOT = /Users/[HOME]/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_212-release-1586-b4-5784211) • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.4) • Xcode at /Applications/Xcode.app/Contents/Developer • Xcode 11.4, Build version 11E146 • CocoaPods version 1.9.1

[✓] Android Studio (version 3.6) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin version 44.0.2 • Dart plugin version 192.7761 • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)

[✓] Connected device (2 available) • Android SDK built for x86 • emulator-5554 • android-x86 • Android 5.1.1 (API 22) (emulator) • iPhone 11 Pro Max • 96D35F20-F138-40BA-BC95-0DF38DFCA21E • ios • com.apple.CoreSimulator.SimRuntime.iOS-13-4 (simulator)

• No issues found!



Solution 1:[1]

You'll need to configure a custom scheme to define flavors for the iOS build. From the error you've received, it seems that the build is non-existent. Follow this guide to configure the custom scheme for your iOS build's flavor.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Omatt