AngeloAvv / flutter_flavorizr

A flutter utility to easily create flavors in your flutter application
https://pub.dev/packages/flutter_flavorizr
MIT License
456 stars 81 forks source link

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

Open Kontrano opened 6 months ago

Kontrano commented 6 months ago

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 commented 4 months ago

Any update on this?

EvertonMJunior commented 3 months ago

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

AngeloAvv commented 3 months ago

Can you please provide the output of:

gem list -i ^xcodeproj$

and

gem list xcodeproj

anas43950 commented 2 months ago

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

anas43950 commented 2 months ago

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

yousefak007 commented 2 months ago

same problem

yousefak007 commented 2 months ago

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 commented 2 weeks ago

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

AngeloAvv commented 2 weeks ago

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 commented 2 weeks ago

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 commented 2 weeks ago

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 commented 2 weeks ago

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!