Closed lucasdidur closed 3 years ago
Hi @lucasdidur,
did you put the Pods include in each of your xcconfig flavor just before the Generated include?
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.<destination>.xcconfig"
where destination is debug or release
I'm also having a similar issue if you could help, please :-) I have added the below to my devDebug.xcconfig file resulting in the below:
Any help would be amazing.
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include "Generated.xcconfig"
FLUTTER_TARGET=lib/main-dev.dart
ASSET_PREFIX=dev
BUNDLE_NAME=Appname DEV
I have cleaned and rebuild but still get the below error, I know what the issue is I just don't have the iOS knowledge to figure it out.
/Users/admin/Development/Flutter/karbon_fit_app/ios/Runner/GeneratedPluginRegistrant.m:10:9: fatal error: module 'shared_preferences' not found
@import shared_preferences;
~~~~~~~^~~~~~~~~~~~~~~~~~
1 error generated.
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
I just started a new project to try it out and got it working. The only thing I had to change was to exchange iphoneos
from the Base SDK
setting in Xcode to iOS
. Strange that it was set to that, but whatever. Also had to include those Pod imports, and then got it working.
However, I also got this GeneratedPluginRegistrant.m
error in an existing project, and I could trace that down to a wrong configuration in the Info
tab inside the Runner Project
configuration in Xcode. Basically, the new environment was configured for the Runner
project, and not the Runner target
. By setting my new flavor (in my case qaDebug
) for the target, it compiled and worked. See my next screenshot.
So:
So: all working, can you check if that also solves it for you @adamanderson86 ?
Can anyone please tell me if something has changed with flutter_flavorizr 1.0.11 ?
Same problem here, I have solved it adding the imports to the xxcconfig files:
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.<destination>.xcconfig"
And then we have to open xcode and update the config:
Still seeing the issue at top. Tried everything here, none of it made sense, and was unable to build in Xcode.
What did work....is
flavorizr: ide: "vscode"
as described in: https://pierre-dev.hashnode.dev/get-the-best-out-of-flutter-flavors-with-flutterflavorizr
I ran into the same issue and what helped was to touch the build settings for the generated configurations in xcode:
This is of course not really a "fix", but this results in the addition of the following lines in the project.pbxproj
:
72234490296727B400F3F89E /* Debug-dev */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 3F86FA4672AABCB51C577040 /* Pods-Runner.debug-dev.xcconfig */;
buildSettings = {
PRODUCT_NAME = Runner;
};
name = "Debug-dev";
};
72234491296727B400F3F89E /* Profile-dev */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = DA01EB1BCE28D1C54F0CA6CA /* Pods-Runner.profile-dev.xcconfig */;
buildSettings = {
PRODUCT_NAME = Runner;
};
name = "Profile-dev";
};
72234492296727B400F3F89E /* Release-dev */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 905FC84C19864588829C60C2 /* Pods-Runner.release-dev.xcconfig */;
buildSettings = {
PRODUCT_NAME = Runner;
};
name = "Release-dev";
};
72234493296727B400F3F89E /* Debug-prod */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = AA5357F7199284C3C08928CF /* Pods-Runner.debug-prod.xcconfig */;
buildSettings = {
PRODUCT_NAME = Runner;
};
name = "Debug-prod";
};
72234494296727B400F3F89E /* Profile-prod */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 997507D4D51591BD1E842AE7 /* Pods-Runner.profile-prod.xcconfig */;
buildSettings = {
PRODUCT_NAME = Runner;
};
name = "Profile-prod";
};
72234495296727B400F3F89E /* Release-prod */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 75150F32C9248992B4630230 /* Pods-Runner.release-prod.xcconfig */;
buildSettings = {
PRODUCT_NAME = Runner;
};
name = "Release-prod";
};
i.e. some sort of configuration for each of the flavors, which seems to not exist beforehands.
As my main goal with using flutter is to not try and understand whatever things happen in xcode, I hope that his helps you @AngeloAvv to maybe get an idea what the problem is.
Hello,
I create 2 flavors, and added just this dependency:
When i try to run, i get this error.
flutter run --flavor dev -t lib/main-dev.dart
When i run just
flutter run
works normally.