Just updated Xcode to 7 and attempting to build app in iOS9; build errors

#1

I just updated my Xcode because I want this app to be ready for iOS 9 when I submit it next week. But I’m not sure where to start with debugging these errors.

My dev environment is as follows:

  • Ionic 1.6.4
  • Node 0.10.32
  • Cordova - 5.1.1
  • Xcode 7.0

I’ve been getting an upgrade warning for node:


Upgrade warning - for the CLI to run correctly,
it is highly suggested to upgrade the following:

Please update your Node runtime to version >=0.12.x


But last time I did this, it broke Ionic CLI. Just mentioning this to be thorough in case it is somehow related.

#2

I managed to get rid of the first two errors by updating Cordova to 3.9.0. Now I have the following errors that have persisted.

I basically updated as many of the packages as I thought relevant to building this project in Xcode. ios-deploy, cordova, and I updated all the dependencies on my project as well.

I’ve also included the info.plist fix that deals with how iOS 9 App Transport Security demands HTTPS instead of HTTP.

Any suggestions now that I’ve narrowed down the issue some?

#3

They are unrelated warnings I believe (yellow triangles"). I believe you need to double click the error to take you to the correct log line which should give you more of a hint as to whats going on?

#4

I also found another error related to the UI Interface.

Below are screenshots for the log lines.

As for the issue of the GCD Web Server, here is the associated log line.

#5

My bad, is related.

I think this is a bitcode issue. Just got hit with that today as well. It’s default set to “on” in XCode7 but you can safely switch it off.

https://forums.developer.apple.com/thread/8991

2 Likes
#6

Okay, now it’s throwing 43 issues related to how the build being linked is 6.0 and GCD Web Server is built for 8.3. However, in my Info tab, I set the iOS Development Target for 9.0.

#7

To resolve the first error I had, regarding supportedInterfaceOrientationsForWindow, it turns out to be a return value data type issue.

Originally, I had this:

 - (NSUInteger)application:(UIApplication*)application supportedInterfaceOrientationsForWindow:(UIWindow*)window
 {
     // iPhone doesn't support upside down by default, while the iPad does.  Override to allow all orientations always, and let the root view controller decide what's allowed (the supported orientations mask gets intersected).
     NSUInteger supportedInterfaceOrientations = (1 << UIInterfaceOrientationPortrait) | (1 << UIInterfaceOrientationLandscapeLeft) | (1 << UIInterfaceOrientationLandscapeRight) | (1 << UIInterfaceOrientationPortraitUpsideDown);

     return supportedInterfaceOrientations;
}

I changed it to this:

#if __IPHONE_OS_VERSION_MAX_ALLOWED < 90000
- (NSUInteger)application:(UIApplication*)application supportedInterfaceOrientationsForWindow:(UIWindow*)window
#else
- (UIInterfaceOrientationMask)application:(UIApplication*)application supportedInterfaceOrientationsForWindow:(UIWindow*)window
#endif
{
    // iPhone doesn't support upside down by default, while the iPad does.  Override to allow all orientations always, and let the root view controller decide what's allowed (the supported orientations mask gets intersected).
    NSUInteger supportedInterfaceOrientations = (1 << UIInterfaceOrientationPortrait) | (1 << UIInterfaceOrientationLandscapeLeft) | (1 << UIInterfaceOrientationLandscapeRight) | (1 << UIInterfaceOrientationPortraitUpsideDown);

    return supportedInterfaceOrientations;
}

And the corresponding errors were gone.

Here is what remains for me to troubleshoot:

Ld /Users/calebfaruki/Library/Developer/Xcode/DerivedData/Motorino-gpuhtgiqcqpphkerxucftzxhcxeh/Build/Intermediates/Motorino.build/Debug-iphonesimulator/Motorino.build/Objects-normal/i386/Motorino normal i386
    cd /Users/calebfaruki/Documents/Motorino/motorino/platforms/ios
    export IPHONEOS_DEPLOYMENT_TARGET=6.0
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.0.sdk -L/Users/calebfaruki/Library/Developer/Xcode/DerivedData/Motorino-gpuhtgiqcqpphkerxucftzxhcxeh/Build/Products/Debug-iphonesimulator -F/Users/calebfaruki/Library/Developer/Xcode/DerivedData/Motorino-gpuhtgiqcqpphkerxucftzxhcxeh/Build/Products/Debug-iphonesimulator -FMotorino/Plugins/cordova-plugin-webserver -filelist /Users/calebfaruki/Library/Developer/Xcode/DerivedData/Motorino-gpuhtgiqcqpphkerxucftzxhcxeh/Build/Intermediates/Motorino.build/Debug-iphonesimulator/Motorino.build/Objects-normal/i386/Motorino.LinkFileList -mios-simulator-version-min=6.0 -Xlinker -objc_abi_version -Xlinker 2 -weak_framework CoreFoundation -weak_framework UIKit -weak_framework AVFoundation -weak_framework CoreMedia -weak-lSystem -ObjC -fobjc-arc -fobjc-link-runtime -framework AssetsLibrary /Users/calebfaruki/Library/Developer/Xcode/DerivedData/Motorino-gpuhtgiqcqpphkerxucftzxhcxeh/Build/Products/Debug-iphonesimulator/libCordova.a -framework CoreGraphics -framework MobileCoreServices -framework GCDWebServer -lz -framework CFNetwork -framework SystemConfiguration -framework CoreLocation -Xlinker -dependency_info -Xlinker /Users/calebfaruki/Library/Developer/Xcode/DerivedData/Motorino-gpuhtgiqcqpphkerxucftzxhcxeh/Build/Intermediates/Motorino.build/Debug-iphonesimulator/Motorino.build/Objects-normal/i386/Motorino_dependency_info.dat -o /Users/calebfaruki/Library/Developer/Xcode/DerivedData/Motorino-gpuhtgiqcqpphkerxucftzxhcxeh/Build/Intermediates/Motorino.build/Debug-iphonesimulator/Motorino.build/Objects-normal/i386/Motorino

ld: warning: ignoring file /Users/calebfaruki/Library/Developer/Xcode/DerivedData/Motorino-gpuhtgiqcqpphkerxucftzxhcxeh/Build/Products/Debug-iphonesimulator/libCordova.a, file was built for archive which is not the architecture being linked (i386): /Users/calebfaruki/Library/Developer/Xcode/DerivedData/Motorino-gpuhtgiqcqpphkerxucftzxhcxeh/Build/Products/Debug-iphonesimulator/libCordova.a
ld: warning: object file (Motorino/Plugins/cordova-plugin-webserver/GCDWebServer.framework/GCDWebServer(GCDWebServerRequest.o)) was built for newer iOS version (8.3) than being linked (6.0)
ld: warning: object file (Motorino/Plugins/cordova-plugin-webserver/GCDWebServer.framework/GCDWebServer(GCDWebServerURLEncodedFormRequest.o)) was built for newer iOS version (8.3) than being linked (6.0)
ld: warning: object file (Motorino/Plugins/cordova-plugin-webserver/GCDWebServer.framework/GCDWebServer(GCDWebServerDataRequest.o)) was built for newer iOS version (8.3) than being linked (6.0)
ld: warning: object file (Motorino/Plugins/cordova-plugin-webserver/GCDWebServer.framework/GCDWebServer(GCDWebServerMultiPartFormRequest.o)) was built for newer iOS version (8.3) than being linked (6.0)
ld: warning: object file (Motorino/Plugins/cordova-plugin-webserver/GCDWebServer.framework/GCDWebServer(GCDWebServerConnection.o)) was built for newer iOS version (8.3) than being linked (6.0)
ld: warning: object file (Motorino/Plugins/cordova-plugin-webserver/GCDWebServer.framework/GCDWebServer(GCDWebServerFileRequest.o)) was built for newer iOS version (8.3) than being linked (6.0)
ld: warning: object file (Motorino/Plugins/cordova-plugin-webserver/GCDWebServer.framework/GCDWebServer(GCDWebServerResponse.o)) was built for newer iOS version (8.3) than being linked (6.0)
ld: warning: object file (Motorino/Plugins/cordova-plugin-webserver/GCDWebServer.framework/GCDWebServer(GCDWebServerFileResponse.o)) was built for newer iOS version (8.3) than being linked (6.0)
ld: warning: object file (Motorino/Plugins/cordova-plugin-webserver/GCDWebServer.framework/GCDWebServer(GCDWebServerDataResponse.o)) was built for newer iOS version (8.3) than being linked (6.0)
ld: warning: object file (Motorino/Plugins/cordova-plugin-webserver/GCDWebServer.framework/GCDWebServer(GCDWebServer.o)) was built for newer iOS version (8.3) than being linked (6.0)
ld: warning: object file (Motorino/Plugins/cordova-plugin-webserver/GCDWebServer.framework/GCDWebServer(GCDWebServerErrorResponse.o)) was built for newer iOS version (8.3) than being linked (6.0)
ld: warning: object file (Motorino/Plugins/cordova-plugin-webserver/GCDWebServer.framework/GCDWebServer(GCDWebServerStreamedResponse.o)) was built for newer iOS version (8.3) than being linked (6.0)
ld: warning: object file (Motorino/Plugins/cordova-plugin-webserver/GCDWebServer.framework/GCDWebServer(GCDWebServerFunctions.o)) was built for newer iOS version (8.3) than being linked (6.0)
Undefined symbols for architecture i386:
  "_CDVLocalNotification", referenced from:
      -[AppDelegate application:didReceiveLocalNotification:] in AppDelegate.o
  "_CDVPluginHandleOpenURLNotification", referenced from:
      -[AppDelegate application:openURL:sourceApplication:annotation:] in AppDelegate.o
  "_CDVRemoteNotification", referenced from:
      -[AppDelegate application:didRegisterForRemoteNotificationsWithDeviceToken:] in AppDelegate.o
  "_CDVRemoteNotificationError", referenced from:
      -[AppDelegate application:didFailToRegisterForRemoteNotificationsWithError:] in AppDelegate.o
  "_OBJC_CLASS_$_CDVCommandDelegateImpl", referenced from:
      _OBJC_CLASS_$_MainCommandDelegate in MainViewController.o
  "_OBJC_CLASS_$_CDVCommandQueue", referenced from:
      _OBJC_CLASS_$_MainCommandQueue in MainViewController.o
  "_OBJC_CLASS_$_CDVPlugin", referenced from:
      _OBJC_CLASS_$_IonicKeyboard in IonicKeyboard.o
      _OBJC_CLASS_$_CDVGeocoder in CDVGeocoder.o
  "_OBJC_CLASS_$_CDVPluginResult", referenced from:
      objc-class-ref in CDVGeocoder.o
  "_OBJC_CLASS_$_CDVViewController", referenced from:
      _OBJC_CLASS_$_MainViewController in MainViewController.o
  "_OBJC_METACLASS_$_CDVCommandDelegateImpl", referenced from:
      _OBJC_METACLASS_$_MainCommandDelegate in MainViewController.o
  "_OBJC_METACLASS_$_CDVCommandQueue", referenced from:
      _OBJC_METACLASS_$_MainCommandQueue in MainViewController.o
  "_OBJC_METACLASS_$_CDVPlugin", referenced from:
      _OBJC_METACLASS_$_IonicKeyboard in IonicKeyboard.o
      _OBJC_METACLASS_$_CDVGeocoder in CDVGeocoder.o
  "_OBJC_METACLASS_$_CDVViewController", referenced from:
      _OBJC_METACLASS_$_MainViewController in MainViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
#8

Changing the build setting “Enable Bitcode” to “No” like jawache suggested worked great for me.

I gathered his solution and others that I ran into while adding WKWebview to my app and put them in a blog post. Let me know if you have any problem/solutions I missed.

1 Like
#9

thanks, worked for me also.

#10

Mine comes by default No. But still not working.