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

bug: ionic build ios not working on Mac OS 10.11 #593

Closed
mhartington opened this issue Sep 23, 2015 · 36 comments
Closed

bug: ionic build ios not working on Mac OS 10.11 #593

mhartington opened this issue Sep 23, 2015 · 36 comments

Comments

@mhartington
Copy link
Member

From @stefankp on September 23, 2015 12:24

Type: bug

Platform: ios 9 webview

ionic build ios does not work anymore, therefore ionic run ios and ionic emulate ios also don't work, meaning I cannot run the app through the ionic CLI. The command runs for a few seconds and then exits without any logs or error messages.

ionic build android still works fine. Building and deploying the app to the simulator or phone works through Xcode.

I am on Mac OS 10.11.1, with Xcode 7 and a complete fresh ionic install.

Copied from original issue: ionic-team/ionic-framework#4414

@mhartington
Copy link
Member Author

From @mpm on September 23, 2015 12:42

I have the same issue :D according to the cordova docs, the build task runs two commands, prepare and compile. The one that breaks (returns without any error message) is

ionic prepare ios

while

ionic compile ios

compiles the stuff that is there (without prepare, the plugins are missing though). I'm trying to understand what the prepare command is doing and it must be somewhere in this repository IMHO, but I couldn't locate it yet.

@mhartington
Copy link
Member Author

From @mpm on September 23, 2015 15:39

@stefankp and me tracked it down to this line in the xcode npm package. I don't fully understand the fork magic going on there, but the worker object never receives the message message (or whatever is this).

Therefore it can never trigger the error neither the end message, which would finally execute the function in cb (and this function will resolve a promise that resolves a ton of other promises that are currently preventing the ionic prepare build command from succeeding.

So, if anybody knows a bit more about the fork magic going in on the xcode package, please explain where to dig down- where is the message event triggered?

PS:
I can build the same project where we spotted the error on a different machine, running the same xcode version but OS X 10.10.5. The problem seems to occur under OS X 10.11.0 and 10.11.1.

@mhartington
Copy link
Member Author

From @mpm on September 23, 2015 16:13

Alright, we digged down right to the bottom and the short version is:

This issue got fixed in the node-xcode package.

Ionic depends on xcode 0.6.7, so this should be bumped to 0.8.0 (but the 0.8.0 version we got earlier didn't contain this patch yet).

Anyway, everybody having the same issue, just open parseJob.js in your local npm repository and delete the process.exit() in Line 12.

We will post more helpful and proper instructions after we recovered from this exhausting investigation.

(Related: alunny/node-xcode#61).

@jasonfutch
Copy link

Still having issues with the plugins missing.

@mpm
Copy link

mpm commented Sep 24, 2015

@jasonfutch are these plugins in the project's plugins folder and only missing in the respective platform's plugin subfolder? (after running ionic state reset).

If they are also missing the project's plugin directory, this is probably a different issue. I created a different PR that improves error handling when installing plugins that helps diagnosing missing plugins, maybe that helps.

@jasonfutch
Copy link

ionic state reset did the trick!

@ravishtiwari
Copy link

I was having the same issue, but, I my case I was having issue with cordova-whitelist-plugin, removed the plugin, and re-installed version 1.0 using cordova-whitelist-plugin@1.0 and this fixed the issue for me.

@munzx
Copy link

munzx commented Oct 30, 2015

@jasonfutch thanks :) saved me alot of time and effort :)

@agconti
Copy link

agconti commented Nov 1, 2015

@mhartington I deleted process.exit() and even updated the rest of the file to reflect all of the changes in the PR but wasn't able to get this to work.

Have you found a new way to get it working since September?

@diyweb
Copy link

diyweb commented Nov 3, 2015

After updated to Mac OS 10.11, I got this problem also (Cannot add platform and build for both ios and android). Finally it was fixed by the following steps (only for my case):

  1. Uninstall Node.js v5.0.0 and install then Node.js v0.12.7
  2. Reinstall ionic and cordova
  3. Run the following command to clear of cache of old version cordova:
    $ rm -rf ~/.cordova

@stonexer
Copy link

stonexer commented Nov 3, 2015

For me, it caused of I update my npm to v5.
So reinstall it to v0.12.7 make sense.

@boyfunky
Copy link

boyfunky commented Nov 7, 2015

where do i find my local parseJob.js. I'm using mac

@jbavari
Copy link

jbavari commented Nov 11, 2015

All - try updating cordova - theres a fix available in Cordova 5.4.0 that fixes issues with Node v5.

npm install -g cordova

Let me know if this helps fix the issues.

@ligdeve
Copy link

ligdeve commented Nov 16, 2015

thanks jbavari
reinstall cordova solves my problem.

@chrishawn
Copy link

ionic state reset ftw

@mrzmyr
Copy link

mrzmyr commented Dec 9, 2015

+1 for ionic state reset

@prosenjit-manna
Copy link

thanks jbavari

@javiercr
Copy link

javiercr commented Jan 6, 2016

ionic state reset plus npm install -g cordova solved this for me. Thanks!

@prosenjit-manna
Copy link

after upgrade cordova cli I face another issue ionic build android not working.

I delete platform dir and run ionic state restore fix android build issue.

@OneMuppet
Copy link

@jbavari awesome! I missed the cordova -> node v5 issue, big thanks for your comment!

@shreyashag
Copy link

Reinstalling Cordova fixed this for me too!

Thanks!

@katrinsharp
Copy link

@prosenjit-itobuz works exactly as you said following by 'build ios' and 'emulate ios'. Thanks a lot!

@jimwilde
Copy link

jimwilde commented Feb 2, 2016

+1 for @jbavari
npm install -g cordova fixed it.

@syedfahad
Copy link

I also have the same problem. while i used command
npm install -g cordova
ionic state reset
and also installed the node.js v5 but still ionic build ios and ionic build android did't working on my desktop

@syedfahad
Copy link

Now it is giving me error of
cordova is not recognized as internal or external command
operable program or batch file

how i fix it???

@syedfahad
Copy link

this is view of cmd
324234234

@prosenjit-manna
Copy link

prosenjit-manna commented Mar 1, 2016

You can not build ios app in windows

@syedfahad
Copy link

this is not showing any version and it has been uninstalled from my system
@prosenjit-itobuz

@prosenjit-manna
Copy link

prosenjit-manna commented Mar 1, 2016

So you have to install by run npm install -g cordova

@nfodor
Copy link

nfodor commented Mar 22, 2016

Downgraded node to 0.12.7 did it.

@mixersoft
Copy link

I got this problem after upgrading xcode and ionic CLI

solved the problem as follows:

nvm use stable # Now using node v5.0.0 (npm v3.3.6)
npm install -g cordova
ionic state rebuild
# ionic info
Cordova CLI: 6.1.1
Gulp version:  Requiring external module coffee-script/register
Gulp local:   CLI version 3.9.0
Ionic CLI Version: 1.7.14
Ionic App Lib Version: 0.7.0
ios-deploy version: 1.8.2 
ios-sim version: 5.0.3 
OS: Mac OS X El Capitan
Node Version: v5.0.0
Xcode version: Xcode 7.2 Build version 7C68 

@subashbasnet8
Copy link

updating cordova did the trick for me.

@ctaihua
Copy link

ctaihua commented May 15, 2016

My cordova version was 5.3.3, and the ionic build/run is output nothing.
After I update the cordova version to 6.1.1 and it works.
Thank you

@davidpelayo
Copy link

ionic state reset
ionic build ios

Worked for me! 👍

@ravishtiwari
Copy link

I know I am bit late in the party, however, this has stopped working for me again, without any explanation.

My ionic info


Your system information:

Cordova CLI: 7.0.1
Gulp version:  CLI version 1.2.1
Gulp local:  
Ionic Version: 1.2.4-nightly-1917
Ionic CLI Version: 1.7.14
Ionic App Lib Version: 0.7.0
ios-deploy version: 1.9.0 
ios-sim version: 5.0.6 
OS: Mac OS X El Capitan
Node Version: v4.8.3
Xcode version: Xcode 8.1 Build version 8B62 

cordova-ios: 4.4.0

I've the node-xcode : 0.9.3 with following code:

// parsing is slow and blocking right now
// so we do it in a separate process
var fs = require('fs'),
    parser = require('./parser/pbxproj'),
    path = process.argv[2],
    fileContents, obj;

try {
    fileContents = fs.readFileSync(path, 'utf-8');
    obj = parser.parse(fileContents);
    process.send(obj);
} catch (e) {
    process.send(e);
    process.exitCode = 1;
}

Now, when I run

ionic build ios --verbose

it stops mid way after add to body class: platform-ios, on random lines, such as:


In module 'AssetsLibrary' imported from /Users/ravish/Ionic/platforms/ios/CordovaLib/Classes/Public/CDVURLProtocol.m:20:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.1.sdk/System/Library/Frameworks/AssetsLibrary.framework/Headers/ALAssetsLibrary.h:95:1: note: 'assetForURL:resultBlock:failureBlock:' has been explicitly marked deprecated here
- (void)assetForURL:(NSURL *)assetURL resultBlock:(ALAssetsLibraryAssetForURLResultBlock)resultBlock failureBlock:(ALAssetsLibraryAccessFailureBlock)failureBlock NS_DEPRECATED_IOS(4_0, 9_0, "Use fetchAssetsWithLocalIdentifiers:options: on PHAsset to fetch assets by local identifier (or to lookup PHAssets by a previously known ALAssetPropertyAssetURL use fetchAssetsWithALAssetURLs:options:) from the Photos framework instead");
^

and sometimes on this line:

platforms/ios/CordovaLib/Classes/Public/CDVURLProtocol.m:60:9:

the stops at random line numbers.

I tried running:

ionic prepare ios
ionic compile ios

Same result.

I also removed all my plugins to ensure that none them are causing problem, then did this:

ionic state reset
ionic build ios

Still same result, any suggestion?

PS: Build does not fails, it just stops mid way without any error.

@ionitron-bot
Copy link

ionitron-bot bot commented Jul 12, 2018

Thanks for the issue! This issue appears to be associated with an old version of the Ionic CLI. Please update to the latest CLI version, which supports all versions of the Ionic Framework. If the issue is relevant and if it persists after updating to the latest CLI version, please create a new issue.

Thank you for using Ionic!

@ionitron-bot ionitron-bot bot closed this as completed Jul 12, 2018
@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Jul 12, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests