iakta / flutter_flavors

A flutter app to show flavors in flutter
80 stars 12 forks source link

Issue when adding additional flutter dependencies and fails to builds. #3

Open rytedesigns opened 5 years ago

rytedesigns commented 5 years ago

I added dependencies to the project and it would no longer build.

Only change I did was to the pubspec.yaml

name: flutter_flavors
description: A flutter app with flavors

dependencies:
  flutter:
    sdk: flutter
  rxdart: ^0.18.1
  url_launcher: ^4.0.0
  http: ^0.12.0
  sqflite: ^0.12.1
  path_provider: ^0.4.1
  shared_preferences: ^0.4.3
  mockito: ^3.0.0
  flutter_html_textview: ^0.2.6
  cupertino_icons: ^0.1.2
  uuid: ^1.0.3
  package_info: ^0.3.2
  flutter_typeahead: ^0.4.1

dependency_overrides:
  http: ^0.12.0

dev_dependencies:
  flutter_test:
    sdk: flutter

# For information on the generic Dart part of this file, see the
# following page: https://www.dartlang.org/tools/pub/pubspec

# The following section is specific to Flutter.
flutter:

  # The following line ensures that the Material Icons font is
  # included with your application, so that you can use the icons in
  # the material Icons class.
  uses-material-design: true

  # To add assets to your application, add an assets section, like this:
  # assets:
  #  - images/a_dot_burr.jpeg
  #  - images/a_dot_ham.jpeg

  # An image asset can refer to one or more resolution-specific "variants", see
  # https://flutter.io/assets-and-images/#resolution-aware.

  # For details regarding adding assets from package dependencies, see
  # https://flutter.io/assets-and-images/#from-packages

  # To add custom fonts to your application, add a fonts section here,
  # in this "flutter" section. Each entry in this list should have a
  # "family" key with the font family name, and a "fonts" key with a
  # list giving the asset and other descriptors for the font. For
  # example:
  # fonts:
  #   - family: Schyler
  #     fonts:
  #       - asset: fonts/Schyler-Regular.ttf
  #       - asset: fonts/Schyler-Italic.ttf
  #         style: italic
  #   - family: Trajan Pro
  #     fonts:
  #       - asset: fonts/TrajanPro.ttf
  #       - asset: fonts/TrajanPro_Bold.ttf
  #         weight: 700
  #
  # For details regarding fonts from package dependencies, 
  # see https://flutter.io/custom-fonts/#from-packages

Console Output

flutter run -t ./lib/main-dev.dart -d E82D2E2D-6048-4F26-9A02-CDBB0DB92F96 --flavor=development
Running "flutter packages get" in flutter_flavors-master...      
! http 0.12.0                                                                                                                                                       0.7s
Launching ./lib/main-dev.dart on iPhone XR in debug mode...
Running pod install...                                       2.2s
Starting Xcode build...                                          
Xcode build done.                                            1.5s
Failed to build iOS app
Error output from Xcode build:
↳
    ** BUILD FAILED **

Xcode's output:
↳
    === BUILD TARGET Runner OF PROJECT Runner WITH CONFIGURATION Debug-development ===
    development.xcconfig line 8: Unable to find included file "Generated.xcconfig"
    development.xcconfig line 8: Unable to find included file "Generated.xcconfig"
    The use of Swift 3 @objc inference in Swift 4 mode is deprecated. Please address deprecated @objc inference warnings, test your code with “Use of deprecated Swift 3
    @objc inference” logging enabled, and then disable inference by changing the "Swift 3 @objc Inference" build setting to "Default" for the "Runner" target.
    === BUILD TARGET Runner OF PROJECT Runner WITH CONFIGURATION Debug-development ===
    diff: /Podfile.lock: No such file or directory
    diff: /Manifest.lock: No such file or directory
    error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.

Could not build the application for the simulator.
Error launching application on iPhone XR.
natezhengbne commented 5 years ago

Yes, same issue.

aharoldk commented 5 years ago

if you use cocoapods you should add #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release-development.xcconfig"

PauloKeller commented 5 years ago

Can be more clear on how to configure projects that already have dependencies. I facing the same issue.

natezhengbne commented 5 years ago

add #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release-development.xcconfig" to your flavors xcconfig file. image

PauloKeller commented 5 years ago

Thanks for the answer, regarding firebase you know how to setup multiple googleservice-info.plist? If yes, you can write steps plz!