FlineDev / BartyCrouch

Localization/I18n: Incrementally update/translate your Strings files from .swift, .h, .m(m), .storyboard or .xib files.
MIT License
1.37k stars 121 forks source link

BartyCrouch generates warning "not installed" when run in Xcode Build Phases, but runs fine from CLI #231

Closed otzbergnet closed 3 years ago

otzbergnet commented 3 years ago

Before I start, I apologise, if this is down to me being very inexperienced

Expected Behavior

When building my Xcode project, BartyCrouch will be executed based on the Build Phase Script (from readme.md) and update string files.

Actual Behavior

When building my Xcode project the build process succeeds, but the following warning is generated warning: BartyCrouch not installed, download it from https://github.com/Flinesoft/BartyCrouch

If I manually go into the Xcode directory in Terminal and run the same script (or just the individual commands) they run perfectly fine

Steps to Reproduce the Problem

  1. Follow instructions on readme.md to install BartyCrouch
  2. Follow readme.md to initialise project and add BartyCrouch.swift, .bartycrouch.toml (etc)
  3. Build & Run project

Specifications

Screenshot of BartyCrouch working just fine in Terminal

Screenshot 2021-07-31 at 10 13 52

Screenshot of BartyCrouch "failing" in XCode

Screenshot 2021-07-31 at 10 14 59

I am very sorry for not being very helpful in my bug report, I fear it isn't a bug at all, but just me being dumb and overlooking something. Sorry in advance :(

Sam-Spencer commented 3 years ago

Same issue here, but only having this issue on my new M1 Mac mini. This doesn't seem to occur with my intel-based MacBook Pro. Maybe it has something to do with how Homebrew works on Apple Silicon?

noafredman commented 3 years ago

I'm having the same issue on my M1 Mabook Air

Jeehut commented 3 years ago

@otzbergnet @Sam-Spencer @noafredman I am sorry the build script doesn't work as is on M1 Macs.

Can you maybe give some additional info, e.g. the following might be helpful:

  1. What's the output of echo $PATH in both the Terminal and from within Xcode (build scripts)? If /opt/homebrew/bin is missing in the Xcode output, it might be an issue with Homebrew installation and adding export PATH="$PATH:/opt/homebrew/bin" to your .zshrc file might help.
  2. What's the output of which bartycrouch in both Terminal and Xcode?
  3. What version of macOS do you have installed on your machine, is it the beta?
  4. What version of Xcode command line tools is the default on your machine, is it the beta?
  5. What version of Homebrew do you have installed on you machine? Did you try reinstalling Homebrew? There might have been a path fix in there.
otzbergnet commented 3 years ago

Hello @Jeehut -

Thank you so much for responding and for the suggestion. I will be honest I didn't figure out your first suggestion fully, but I did add the export statement before the if statement and that not only silences the warning, but makes things work for me. So I am happy :)

export PATH="$PATH:/opt/homebrew/bin"

  1. /opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/opt/homebrew/bin
  2. /opt/homebrew/bin/bartycrouch
  3. macOS 11.5.2
  4. Version 12.5.1
  5. I had tried reinstalling Homebrew | Homebrew 3.2.6
Jeehut commented 3 years ago

@otzbergnet Then probably something was broken with your Homebrew setup. Could it be that you installed Homebrew on your M1 Mac quite some time ago when Homebrew had this issue? As not many are facing this, I'm assuming it's fixed in a later version of Homebrew.

otzbergnet commented 3 years ago

I am happy to close this issue, as there is a viable workaround and I am also happy to assume that this was down to a homebrew issue. I hope that for @Sam-Spencer and @noafredman the problem is equally fixable by either adding the path into the build script or updating homebrew.

THANK YOU so much for your suggestions, this was very helpful. Thank you so much! Grüße nach Karlsruhe!