Closed salamanders closed 10 years ago
I did a complete un-install of npm and node and phonegap, and re-installed. Problem went away. Still strange to get a syntax error there, but c'est la vie.
Drat, spoke too soon.
$ phonegap local plugin remove org.apache.cordova.device
[phonegap] removing the plugin: org.apache.cordova.device
/usr/local/lib/node_modules/phonegap/node_modules/cordova/node_modules/plugman/node_modules/xcode/lib/parser/pbxproj.js:2654
throw new this.SyntaxError(
^
SyntaxError: Expected "/*", "=" or [A-Za-z0-9_] but "." found.
Having the same issue trying to get https://git-wip-us.apache.org/repos/asf/cordova-plugin-media.git installed.
It was working fine for me for last 2 weeks. Suddenly i cannot build it for ios (its failing on splashscreen and dialogs)
its still fine for android.
I checked code history nothing is changed.
Phonegap : 3.1.0-0.15.0
phonegap build ios -V [phonegap] detecting iOS SDK environment... [phonegap] Checking iOS requirements... [phonegap] Running "xcodebuild -version" (output to follow) [phonegap] Xcode 5.0.1 Build version 5A2053
[phonegap] using the local environment [phonegap] compiling iOS... [phonegap] cordova library for "ios" already exists. No need to download. Continuing. [phonegap] Wrote out iOS Bundle Identifier to "com.freerangefuture...." [phonegap] Wrote out iOS Bundle Version to "1.0.0" [phonegap] iOS Product Name has not changed (still "StreetEats") [phonegap] Calling plugman.prepare for platform "ios" [phonegap] Ensuring plugin "com.freerangefuture.plugins.sharekitplugin" is installed correctly... [phonegap] Plugin "com.freerangefuture.plugins.sharekitplugin" is good to go. [phonegap] Ensuring plugin "org.apache.cordova.core.console" is installed correctly... [phonegap] Plugin "org.apache.cordova.core.console" is good to go. [phonegap] Ensuring plugin "org.apache.cordova.core.device" is installed correctly... [phonegap] Plugin "org.apache.cordova.core.device" is good to go. [phonegap] Ensuring plugin "org.apache.cordova.core.geolocation" is installed correctly... [phonegap] Plugin "org.apache.cordova.core.geolocation" is good to go. [phonegap] Ensuring plugin "org.apache.cordova.device-motion" is installed correctly... [phonegap] Plugin "org.apache.cordova.device-motion" is good to go. [phonegap] Ensuring plugin "org.apache.cordova.dialogs" is installed correctly...
/usr/local/lib/node_modules/phonegap/node_modules/cordova/node_modules/plugman/nodemodules/xcode/lib/parser/pbxproj.js:2654 throw new this.SyntaxError( ^ SyntaxError: Expected "/*", "=" or [A-Za-z0-9] but "." found.
Same issue here, did you find a solution ?
phonegap build ios -V and see where it is failing. in my case it was failing on splashscreen and dialogs.
i removed related code (splashscreen and dialogs) from plugins/ios.json. file and after that i removed its related code from plugins folder.
and used alternate code for hiding splashscreen and alerts.
I did this and it failed on camera, and I cannot use alternate codefor this part. I hope a solution will be found soon.
+1 to being stuck here too :(
Far-fetched theory: could it have something to do with running the CLI while Xcode 5 was running?
-Benjamin
On Nov 8, 2013, at 7:13 AM, Chris Emerson notifications@github.com wrote:
+1 to being stuck here too :(
— Reply to this email directly or view it on GitHub.
My initials tests point to probably not (good idea though)
From: salamanders [mailto:notifications@github.com] Sent: Friday, November 08, 2013 10:51 AM To: phonegap/phonegap-cli Cc: Chris Emerson Subject: Re: [phonegap-cli] Plugin install fails with pbxproj.js syntax error (#188)
Far-fetched theory: could it have something to do with running the CLI while Xcode 5 was running?
-Benjamin
On Nov 8, 2013, at 7:13 AM, Chris Emerson notifications@github.com<mailto:notifications@github.com> wrote:
+1 to being stuck here too :(
— Reply to this email directly or view it on GitHub.
— Reply to this email directly or view it on GitHubhttps://github.com/phonegap/phonegap-cli/issues/188#issuecomment-28072691.
Having the same problem. Project builds, but can't add any plugin.
UPDATE: Works with a new empty project.
Same problem, came totally out of nowhere - phonegap build ios -V
output:
[phonegap] detecting iOS SDK environment...
[phonegap] Checking iOS requirements...
[phonegap] Running "xcodebuild -version" (output to follow)
[phonegap] Xcode 5.0.2
Build version 5A3005
[phonegap] using the local environment
[phonegap] compiling iOS...
[phonegap] cordova library for "ios" already exists. No need to download. Continuing.
[phonegap] Wrote out iOS Bundle Identifier to "com.ninjatronic.tranquilify"
[phonegap] Wrote out iOS Bundle Version to "1.0.0"
[phonegap] iOS Product Name has not changed (still "Tranquilify")
[phonegap] Calling plugman.prepare for platform "ios"
[phonegap] Ensuring plugin "com.phonegap.LowLatencyAudio" is installed correctly...
[phonegap] Plugin "com.phonegap.LowLatencyAudio" is good to go.
[phonegap] Ensuring plugin "org.apache.cordova.device" is installed correctly...
[phonegap] Plugin "org.apache.cordova.device" is good to go.
[phonegap] Ensuring plugin "org.apache.cordova.media" is installed correctly...
[phonegap] Plugin "org.apache.cordova.media" is good to go.
[phonegap] Ensuring plugin "org.apache.cordova.splashscreen" is installed correctly...
/usr/local/lib/node_modules/phonegap/node_modules/cordova/node_modules/plugman/node_modules/xcode/lib/parser/pbxproj.js:2654
throw new this.SyntaxError(
^
SyntaxError: Expected "/*", "=" or [A-Za-z0-9_] but "." found.
I had the following error which just popped out of nowhere some time yesterday, and I found a solution:
$ phonegap local build ios
[phonegap] compiling iOS...
/usr/local/lib/node_modules/phonegap/node_modules/cordova/node_modules/plugman/node_modules/xcode/lib/parser/pbxproj.js:2654
throw new this.SyntaxError(
^
SyntaxError: Expected "/*", "=" or [A-Za-z0-9_] but "." found.
So the .xcodproj
file is not a file but a special folder with other files and folders within. One of the files inside there is project.pbxproj
- which for all intensive purposes the "main" project file. Somewhere along the lines this file got modified in a way which the cordova parser cannot handle. This most likely happens because the XCode IDE was used to change a setting.
I set up a new project and got the CLI build working again with all my plugins installed and [almost] everything back to normal. Then I ran a diff against my old project and noticed this:
One of the things I did yesterday was set my application to run in the background, and then turned it back off. Even though I turned it off, the pbxproj
file contained new content. This new content included some periods (.
) in a way which did not seem consistent with the rest of the file and consequently is not handled by the cordova parser. Once I removed these lines from my file, everything started working again.
Synopsis: The Cordova parser needs to be updated to handle object keys with dot notation. Solution:
platforms/ios
folder and run your build command phonegap local build ios
- this may require you to reinstall every plugin manually. You will also need to reapply any other configuration changes made directly through XCode. I recommend running the build command after every change you make in XCode as this will give you an idea of what's breaking the Cordova CLI.I updated my cordova parser (pbxproj.js) to allow for dots inside of an identifier, and now my problems are gone. Find the parse_Identifier
function near line 1500 and update all regexs to allow for period: /^[A-Za-z0-9_\.]/
.
/usr/local/lib/node_modules/phonegap/node_modules/cordova/node_modules/plugman/node_modules/xcode/lib/parser/pbxproj.js
UPDATE: there are 2 regexs inside of parse_Identifier
- the first checks the first character of an identifier... which should NOT contain a period. You only need to update the SECOND regex which checks the remainder of the identifier.
UPDATE 2: Upon going to submit a pull request I can see that the xcode parser was updated 2 months ago to account for periods: view the commit here - just update your local phonegap and everything should start working again: sudo npm install -g phonegap
as noted by @DesignByOnyx, this issue has been resolved.
Trying to install a plugin fails after updating phonegap to the latest CLI.
PS: I've tried the following, same result: sudo npm cache clear sudo npm update -g sudo npm update -g phonegap