ionic-cli icon indicating copy to clipboard operation
ionic-cli copied to clipboard

Ionic Build is stuck with Xcode 8.0

Open jgw96 opened this issue 10 years ago • 29 comments

From @chack on September 21, 2016 20:31

Short description of the problem:

With Xcode 8.0 I can't use ionic build command for iOS. I already removed and readded hooks and iOS platform. The command is stuck after the printed console log below:

Other information: (e.g. stacktraces, related issues, suggestions how to fix, stackoverflow links, forum links, etc)

Build settings from command line:

CONFIGURATION_BUILD_DIR = /Users/Jan/Documents/Wohntraum360/wohntraumapp/platforms/ios/build/emulator

SDKROOT = iphonesimulator10.0
SHARED_PRECOMPS_DIR = /Users/Jan/Documents/Wohntraum360/wohntraumapp/platforms/ios/build/sharedpch

Build settings from configuration file '/Users/Jan/Documents/Wohntraum360/wohntraumapp/platforms/ios/cordova/build-debug.xcconfig':

CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES

CODE_SIGN_IDENTITY = iPhone Developer
ENABLE_BITCODE = NO
GCC_PREPROCESSOR_DEFINITIONS = DEBUG=1

HEADER_SEARCH_PATHS = "$(TARGET_BUILD_DIR)/usr/local/lib/include" "$(OBJROOT)/UninstalledProducts/include" "$(OBJROOT)/UninstalledProducts/$(PLATFORM_NAME)/include" "$(BUILT_PRODUCTS_DIR)"
IPHONEOS_DEPLOYMENT_TARGET = 8.0
OTHER_LDFLAGS = -ObjC
SWIFT_OBJC_BRIDGING_HEADER = $(PROJECT_DIR)/$(PROJECT_NAME)/Bridging-Header.h

TARGETED_DEVICE_FAMILY = 1,2

Which Ionic Version? 1.x or 2.x

2.0 Beta 11

Run ionic info from terminal/cmd prompt: (paste output below)

Cordova CLI: 6.3.1 Ionic Framework Version: 2.0.0-beta.11 Ionic CLI Version: 2.0.0 Ionic App Lib Version: 2.0.0-beta.20 ios-deploy version: 1.8.6 ios-sim version: 5.0.8 OS: Mac OS X El Capitan Node Version: v4.4.7 Xcode version: Xcode 8.0 Build version 8A218a

Copied from original issue: driftyco/ionic#8161

jgw96 avatar Sep 22 '16 15:09 jgw96

+1

Build settings from configuration file /Users/quick1/Desktop/Apps/mpn/platforms/ios/cordova/build-debug.xcconfig':
    CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES
    CODE_SIGN_IDENTITY = iPhone Developer
    ENABLE_BITCODE = NO
    GCC_PREPROCESSOR_DEFINITIONS = DEBUG=1
    HEADER_SEARCH_PATHS = "$(TARGET_BUILD_DIR)/usr/local/lib/include" "$(OBJROOT)/UninstalledProducts/include" "$(OBJROOT)/UninstalledProducts/$(PLATFORM_NAME)/include" "$(BUILT_PRODUCTS_DIR)"
    IPHONEOS_DEPLOYMENT_TARGET = 8.0
    OTHER_LDFLAGS = -ObjC

    SWIFT_OBJC_BRIDGING_HEADER = $(PROJECT_DIR)/$(PROJECT_NAME)/Bridging-Header.h
    TARGETED_DEVICE_FAMILY = 1,2


Your system information:

Cordova CLI: 6.3.1
Gulp version:  CLI version 3.9.1
Gulp local:   Local version 3.9.1
Ionic Framework Version: 1.3.1
Ionic CLI Version: 2.0.0
Ionic App Lib Version: 2.0.0-beta.20
ios-deploy version: 1.9.0 
ios-sim version: 5.0.8 
OS: Mac OS X El Capitan
Node Version: v4.2.2
Xcode version: Xcode 8.0 Build version 8A218a 


quickly79 avatar Sep 22 '16 16:09 quickly79

Update.

I was able to remove Xcode 8 and revert back to Xcode 7.3 and it seems like everything is running fine.

However, 7.3 doesn't ship with the IOS 10 emulator.

Still running Sierra

quickly79 avatar Sep 22 '16 19:09 quickly79

@quickly79: Thanks for your response, but I need Xcode 10 for other projects ... Any fix ?

chack avatar Sep 25 '16 17:09 chack

If it helps, this is also happening on the latest and greatest Ionic release:

Cordova CLI: 6.3.1
Gulp version:  CLI version 3.9.1
Gulp local:  
Ionic Framework Version: 2.0.0-rc.0
Ionic CLI Version: 2.1.0
Ionic App Lib Version: 2.1.0-beta.1
ios-deploy version: Not installed
ios-sim version: 5.0.8 
OS: Mac OS X El Capitan
Node Version: v6.7.0
Xcode version: Xcode 8.0 Build version 8A218a

I have no idea why it's listing El Capitan as my OS X version however 😄.

mac os x version

kelvindart avatar Oct 05 '16 12:10 kelvindart

Yes, facing the same problem as well.

Cordova CLI: 6.3.1 Ionic Framework Version: 2.0.0-beta.11 Ionic CLI Version: 2.1.0 Ionic App Lib Version: 2.1.0-beta.1 ios-deploy version: 1.8.5 ios-sim version: 5.0.6 OS: Mac OS X El Capitan Node Version: v6.7.0 Xcode version: Xcode 8.0 Build version 8A218a

codespore avatar Oct 06 '16 01:10 codespore

Same problem here.

Cordova CLI: 6.3.1 Ionic Framework Version: 1.3.1 Ionic CLI Version: 2.1.0 Ionic App Lib Version: 2.1.0-beta.1 ios-deploy version: 1.9.0 ios-sim version: 5.0.8 OS: Mac OS X El Capitan Node Version: v6.6.0 Xcode version: Xcode 8.0 Build version 8A218a

Please note that ionic info says that I'm using El Captan, but I'm actually using Sierra.

fabianoarruda avatar Oct 09 '16 02:10 fabianoarruda

Removing the hooks and platform and re-adding them did the trick for me:

ionic hooks remove ionic platform remove ios

ionic hooks add ionic platform ios

ltalhouarne avatar Oct 09 '16 16:10 ltalhouarne

@ltalhouarne

This solution worked for me :)

Thanks

fabianoarruda avatar Oct 10 '16 18:10 fabianoarruda

Well, the problem now is that every time I need to build a new version of the app, I must use the commands mentioned by @ltalhouarne :(

fabianoarruda avatar Oct 13 '16 23:10 fabianoarruda

@fabianoarruda Here's what I'm doing now:

  • Rename XCode.app to Xcode 8.app
  • Download and install XCode 7.3.1
  • Copy Device Support for iOS 10.0 from Xcode 8 installation to Xcode 7.3.1 app. Follow answer in this post: http://stackoverflow.com/questions/37945376/use-xcode-7-with-ios-10
  • When you run ionic build ios on terminal it will now build against XCode 7.3.1
  • When running on actual device or emulator or Archiving to upload to iTunes, use XCode 8.app

It's damn annoying but this is the only way right now until this is fixed. Anyone have better idea, please share.

codespore avatar Oct 14 '16 02:10 codespore

Just a heads-up. I started to wonder if my issue was related to iCloud sync, so I turned off Desktop and Document sync in iCloud settings on my Mac. Doing so leaves you with NOTHING in the Desktop or Documents local folder, only your files in the iCloud root. But, after copying things back to where they started (Desktop and Documents content) I was able to build just fine with no modifications listed above. Worth noting that my project root is in ~/Documents/Code so it appears that disabling the sync "fixed" some conflict happening there.

So, if you are on Sierra, have a project in a sync path, and this is occurring you might want to try turning off the iCloud sync OR move your project to another location that is not in the path of the sync. Hope this helps.

TheMattRay avatar Oct 18 '16 19:10 TheMattRay

@TheMattRay you are absolutely right! Coincidentally my project root also resides under ~/Documents/code. I just moved it out as you said, and it is now building, no more hacking required! So, iCloud sync definitively interferes with the building process! Now I wonder why... Im not sure how but this needs to be investigated further and if its a issue related to iCloud we should report it to Apple.

fabianoarruda avatar Oct 20 '16 01:10 fabianoarruda

@TheMattRay change the directory worked for me too, thanks

fparrav avatar Oct 21 '16 17:10 fparrav

I had this issue in Cordova / Phonegap - Confirming moving it out of iCloud folder fixed issue

teamcoltra avatar Nov 04 '16 03:11 teamcoltra

Sounds, like a bad joke. Is there any topic in Apple forum or ticket in their ticket system?

yakimant avatar Nov 09 '16 13:11 yakimant

I faced with a same problem. I added build.json in root of project and it helped. I think that the problem with xcodebuild. It can't parse project file without correct signing properties. For manual(default xcode 7 method) signing use only provisioningProfile and codeSignIdentity

punksta avatar Nov 09 '16 14:11 punksta

@TheMattRay remove iCloud sync for desktop and documents and it works. thank you

ghost avatar Nov 22 '16 16:11 ghost

@TheMattRay removing my folder from the iCloud Sync domain (e.g. Documents, Desktop ..) solved my problem as well. Thanks!

DougBR avatar Mar 20 '17 16:03 DougBR

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 outcome.

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.

ravishtiwari avatar Jun 16 '17 05:06 ravishtiwari

@ravishtiwari: remove icloud sync from your project and also ionic rm platform ios and ionic add platform ios. That should fix the issue.

ghost avatar Jun 16 '17 14:06 ghost