Skip to content
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

Project does not build in ios #24

Closed
lucasdidur opened this issue Aug 31, 2020 · 7 comments
Closed

Project does not build in ios #24

lucasdidur opened this issue Aug 31, 2020 · 7 comments

Comments

@lucasdidur
Copy link

Hello,

I create 2 flavors, and added just this dependency:

  firebase_core: "^0.5.0"
  cloud_firestore: ^0.14.0+2

When i try to run, i get this error.

flutter run --flavor dev -t lib/main-dev.dart

    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.
    note: Using new build system
    note: Planning build
    note: Constructing build description

When i run just flutter run works normally.

@AngeloAvv
Copy link
Owner

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

@adamanderson86
Copy link

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

@wwwdata
Copy link

wwwdata commented Oct 28, 2020

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.

Screen Shot 2020-10-28 at 11 57 22

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:

  • blue thingie -> select nothing
  • target -> select new config

Screen Shot 2020-10-28 at 12 04 00

So: all working, can you check if that also solves it for you @adamanderson86 ?

@AngeloAvv
Copy link
Owner

Can anyone please tell me if something has changed with flutter_flavorizr 1.0.11 ?

@p02diada
Copy link

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:

  1. Go to Xcode > Project > Info > Configurations
  2. Set the values for Debug > Pods-XXX.debug and Release = Pods-XXX.release

@h-unterp
Copy link

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

@fpoppinga
Copy link

I ran into the same issue and what helped was to touch the build settings for the generated configurations in xcode:

image

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants