Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

phonegap build ios exception with HelloWorld Application

I am trying to build a helloWorld application using PhoneGap but it seems that is trying to find the .xcodeproj file twice.

phonegap version: 3.3.0-0.18.0

cordova version: 3.3.1-0.1.2

$ phonegap build ios
[phonegap] detecting iOS SDK environment...
[phonegap] using the local environment
[phonegap] compiling iOS...
   [error] An error occurred while building the ios project.xcodebuild: error: 'HelloWorld.xcodeproj.xcodeproj' does not exist.
xcodebuild: error: 'HelloWorld.xcodeproj.xcodeproj' does not exist.
xcodebuild: error: 'HelloWorld.xcodeproj.xcodeproj' does not exist.

It works fine when I build and run from the XCode IDE.

like image 278
Maverick Avatar asked Feb 15 '23 05:02

Maverick


1 Answers

In my case it was grep output which was confusing the build script.

Try running the following command just before build or run:

export GREP_OPTIONS="--color=never"    

Backstory

Source of the problem is in platforms/ios/cordova/build script:

My local environment contains:

export GREP_COLOR='1;37;40'
export GREP_OPTIONS="--color=always"

.. which produces nice colored grep output, but it is confusing the above script, exactly at this line:

XCODEPROJ=$( ls "$PROJECT_PATH" | grep .xcodeproj  )
PROJECT_NAME=$(basename "$XCODEPROJ" .xcodeproj)

A permanent fix would involve changing the line to something like:

XCODEPROJ=$( ls "$PROJECT_PATH" | grep --color=never .xcodeproj  )
PROJECT_NAME=$(basename "$XCODEPROJ" .xcodeproj)

Cheers!

like image 108
Artur Bodera Avatar answered Feb 23 '23 00:02

Artur Bodera