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

Exception: Xcodeproj is not installed even when XcodeProj is installed #250

Open
Kontrano opened this issue Mar 28, 2024 · 15 comments
Open

Comments

@Kontrano
Copy link

I tried to update a flavor today and got the error that Xcodeproj is not installed. This worked fine a few weeks ago.

So I do the command gem install xcodeproj, It says its already installed. I also removed both versions I had and ran the command again but still, the same issue persists where Flavorizr is saying that I don't have it installed.

I get the following error in the console:

Executing task ios:xcconfig
Running XcodeprojProcessor: Checking if xcodeproj is installed
Unhandled exception:
Exception: Xcodeproj is not installed. Please install it by running gem install xcodeproj
#0 XcodeprojProcessor.execute (package:flutter_flavorizr/src/processors/darwin/xcodeproj_processor.dart:20:7)
#1 QueueProcessor.execute (package:flutter_flavorizr/src/processors/commons/queue_processor.dart:44:17)
#2 Processor.execute (package:flutter_flavorizr/src/processors/processor.dart:140:24)

Any idea what could be happening? I also updated Ruby Gems and xcodeproj to the latest version but no change.

@GivDavidL
Copy link

Any update on this?

@EvertonMJunior
Copy link

Same error here. Error when running even though xcodeproj is installed.
image

@AngeloAvv
Copy link
Owner

Can you please provide the output of:

gem list -i ^xcodeproj$

and

gem list xcodeproj

@anas43950
Copy link

The output for first command is true
And for second command: xcodeproj (1.24.0)

@anas43950
Copy link

image
Everything is installed as you can see, still throwing error

@yousefak007
Copy link

same problem

@yousefak007
Copy link

yousefak007 commented Jul 26, 2024

Hi, for temp solution:

You must add a .cmd extension for gem in xcodeproj_processor.dart.
you can find it in Pub\Cache\hosted\pub.dev\flutter_flavorizr-[VERSION]\lib\src\processors\darwin\xcodeproj_processor.dart

image

cc: @AngeloAvv

@Kontrano
Copy link
Author

Hi, for temp solution:

You must add a .cmd extension for gem in xcodeproj_processor.dart. you can find it in Pub\Cache\hosted\pub.dev\flutter_flavorizr-[VERSION]\lib\src\processors\darwin\xcodeproj_processor.dart

image

cc: @AngeloAvv

This still seems to be the only thing that works

@Kontrano Kontrano reopened this Sep 17, 2024
@AngeloAvv
Copy link
Owner

AngeloAvv commented Sep 17, 2024

Hi, for temp solution:
You must add a .cmd extension for gem in xcodeproj_processor.dart. you can find it in Pub\Cache\hosted\pub.dev\flutter_flavorizr-[VERSION]\lib\src\processors\darwin\xcodeproj_processor.dart
image
cc: @AngeloAvv

This still seems to be the only thing that works

It doesn't work for me, it says command not found: gem.cmd, so it's not a good solution that would work for everyone

Question: .cmd files are used on Windows, are you running flutter_flavorizr on Windows?
If you have iOS/macOS flavors, you must run flutter_flavorizr on macOS. There's no way you could use xcodeproj gem on other operating systems

@Kontrano
Copy link
Author

Kontrano commented Sep 17, 2024

Hi, for temp solution:
You must add a .cmd extension for gem in xcodeproj_processor.dart. you can find it in Pub\Cache\hosted\pub.dev\flutter_flavorizr-[VERSION]\lib\src\processors\darwin\xcodeproj_processor.dart
image
cc: @AngeloAvv

This still seems to be the only thing that works

It doesn't work for me, it says command not found: gem.cmd, so it's not a good solution that would work for everyone

Question: .cmd files are used on Windows, are you running flutter_flavorizr on Windows? If you have iOS/macOS flavors, you must run flutter_flavorizr on macOS. There's no way you could use xcodeproj gem on other operating systems

@AngeloAvv I am indeed running on windows, and its actually always worked perfectly on windows, no need to be on macOS to create flavors, which is also the thing i love so much about this package. This issue that i needs to be set to .cmd has only happened the last 6 months or so before that i never had an issue

Edit: In this case would a platform switch that changes the command based on either being on macOS or Windows be a good solution?

@AngeloAvv
Copy link
Owner

Ok, now I see the bigger picture caused by the introduction of more restricted checks on xcodeproj.

A lot of people do not read the README and forget about installing the gem, therefore they keep opening the same issue repeatedly, that's why I introduced this kind of check.

I honestly never ran flutter_flavorizr on other OSes than macOS when I needed to flavorize iOS/macOS apps, that's why I'm saying it will never work (I mean, it could, but I never tested it)

At this point, at least I know how to reproduce this issue. Let me think about it and I will come back with a solution

@Kontrano
Copy link
Author

No worries, very understandable! But great that where the issue lies is now clear, if you need any additional info from me let me know!

@suhailthajudeen
Copy link

Same issue am also facing
image

@Mr-yuwei
Copy link

need help

@Kontrano
Copy link
Author

@Mr-yuwei @suhailthajudeen see the fix/workaround above

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

8 participants