1
votes

i am using ionic 3 to build my app. However i am facing an error when i try to build the ios on Mac. Here is the error massage:

CompileC /Users/myPC/Library/Developer/Xcode/DerivedData/MyApp-hddsubveawhvtmayjrerdpieryqd/Build/Intermediates/MyApp.build/Debug-iphonesimulator/MyApp.build/Objects-normal/x86_64/GCDWebServerDataRequest.o MyApp/Plugins/cordova-plugin-ionic-webview/GCDWebServerDataRequest.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler cd /Users/myPC/Desktop/Gary/ionic/myNewTest/platforms/ios export LANG=en_US.US-ASCII export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Users/myPC/Desktop/Gary/ionic/myNewTest/node_modules/.bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin" /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c -arch x86_64 -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -std=c99 -fobjc-arc -fmodules -gmodules -fmodules-cache-path=/Users/myPC/Library/Developer/Xcode/DerivedData/ModuleCache -fmodules-prune-interval=86400 -fmodules-prune-after=345600 -fbuild-session-file=/Users/myPC/Library/Developer/Xcode/DerivedData/ModuleCache/Session.modulevalidation -fmodules-validate-once-per-build-session -Wno-trigraphs -fpascal-strings -O0 -Wno-missing-field-initializers -Wno-missing-prototypes -Wno-implicit-atomic-properties -Wno-arc-repeated-use-of-weak -Wduplicate-method-match -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wuninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wshorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wundeclared-selector -Wno-deprecated-implementations -DDEBUG=1 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.1.sdk -fasm-blocks -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -mios-simulator-version-min=9.0 -g -fvisibility=hidden -Wno-sign-conversion -fobjc-abi-version=2 -fobjc-legacy-dispatch -iquote /Users/myPC/Library/Developer/Xcode/DerivedData/MyApp-hddsubveawhvtmayjrerdpieryqd/Build/Intermediates/MyApp.build/Debug-iphonesimulator/MyApp.build/MyApp-generated-files.hmap -I/Users/myPC/Library/Developer/Xcode/DerivedData/MyApp-hddsubveawhvtmayjrerdpieryqd/Build/Intermediates/MyApp.build/Debug-iphonesimulator/MyApp.build/MyApp-own-target-headers.hmap -I/Users/myPC/Library/Developer/Xcode/DerivedData/MyApp-hddsubveawhvtmayjrerdpieryqd/Build/Intermediates/MyApp.build/Debug-iphonesimulator/MyApp.build/MyApp-all-target-headers.hmap -iquote /Users/myPC/Library/Developer/Xcode/DerivedData/MyApp-hddsubveawhvtmayjrerdpieryqd/Build/Intermediates/MyApp.build/Debug-iphonesimulator/MyApp.build/MyApp-project-headers.hmap -I/Users/myPC/Desktop/Gary/ionic/myNewTest/platforms/ios/build/emulator/include -I/Users/myPC/Desktop/Gary/ionic/myNewTest/platforms/ios/build/emulator/usr/local/lib/include -I/Users/myPC/Library/Developer/Xcode/DerivedData/MyApp-hddsubveawhvtmayjrerdpieryqd/Build/Intermediates/UninstalledProducts/include -I/Users/myPC/Library/Developer/Xcode/DerivedData/MyApp-hddsubveawhvtmayjrerdpieryqd/Build/Intermediates/UninstalledProducts/iphonesimulator/include -I/Users/myPC/Desktop/Gary/ionic/myNewTest/platforms/ios/build/emulator -I/Users/myPC/Library/Developer/Xcode/DerivedData/MyApp-hddsubveawhvtmayjrerdpieryqd/Build/Intermediates/MyApp.build/Debug-iphonesimulator/MyApp.build/DerivedSources/x86_64 -I/Users/myPC/Library/Developer/Xcode/DerivedData/MyApp-hddsubveawhvtmayjrerdpieryqd/Build/Intermediates/MyApp.build/Debug-iphonesimulator/MyApp.build/DerivedSources -F/Users/myPC/Desktop/Gary/ionic/myNewTest/platforms/ios/build/emulator -include /Users/myPC/Desktop/Gary/ionic/myNewTest/platforms/ios/build/sharedpch/MyApp-Prefix-ecbvllkeqtjuzsgpgfagkkqzoohs/MyApp-Prefix.pch -MMD -MT dependencies -MF /Users/myPC/Library/Developer/Xcode/DerivedData/MyApp-hddsubveawhvtmayjrerdpieryqd/Build/Intermediates/MyApp.build/Debug-iphonesimulator/MyApp.build/Objects-normal/x86_64/GCDWebServerDataRequest.d --serialize-diagnostics /Users/myPC/Library/Developer/Xcode/DerivedData/MyApp-hddsubveawhvtmayjrerdpieryqd/Build/Intermediates/MyApp.build/Debug-iphonesimulator/MyApp.build/Objects-normal/x86_64/GCDWebServerDataRequest.dia -c /Users/myPC/Desktop/Gary/ionic/myNewTest/platforms/ios/MyApp/Plugins/cordova-plugin-ionic-webview/GCDWebServerDataRequest.m -o /Users/myPC/Library/Developer/Xcode/DerivedData/MyApp-hddsubveawhvtmayjrerdpieryqd/Build/Intermediates/MyApp.build/Debug-iphonesimulator/MyApp.build/Objects-normal/x86_64/GCDWebServerDataRequest.o /Users/myPC/Desktop/Gary/ionic/myNewTest/platforms/ios/MyApp/Plugins/cordova-plugin-ionic-webview/GCDWebServerDataRequest.m:59:10: error: no visible @interface for 'NSData' declares the selector 'appendData:' [_data appendData:data]; ~~~~~ ^~~~~~~~~~ 1 error generated.

** BUILD FAILED **

The following build commands failed: CompileC /Users/myPC/Library/Developer/Xcode/DerivedData/MyApp-hddsubveawhvtmayjrerdpieryqd/Build/Intermediates/MyApp.build/Debug-iphonesimulator/MyApp.build/Objects-normal/x86_64/GCDWebServerDataRequest.o MyApp/Plugins/cordova-plugin-ionic-webview/GCDWebServerDataRequest.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler (1 failure) Error: Error code 65 for command: xcodebuild with args: -xcconfig,/Users/myPC/Desktop/Gary/ionic/myNewTest/platforms/ios/cordova/build-debug.xcconfig,-workspace,MyApp.xcworkspace,-scheme,MyApp,-configuration,Debug,-sdk,iphonesimulator,-destination,platform=iOS Simulator,name=iPhone 6s Plus,build,CONFIGURATION_BUILD_DIR=/Users/myPC/Desktop/Gary/ionic/myNewTest/platforms/ios/build/emulator,SHARED_PRECOMPS_DIR=/Users/myPC/Desktop/Gary/ionic/myNewTest/platforms/ios/build/sharedpch [ERROR] An error occurred while running cordova build ios (exit code 1).

i also facing this problem when i try to build a new fresh project, i am not sure what is the problem. As it is working on building Android with Window System.

Also it is working to build ionic 1 project on this mac but facing problem after i update all the environment to ionic 3 so i am not sure is that any problem with xcode version Here is the info of the ionic

cli packages: (/usr/local/lib/node_modules)

@ionic/cli-utils  : 1.19.0
ionic (Ionic CLI) : 3.19.0

global packages:

cordova (Cordova CLI) : 7.1.0 

local packages:

@ionic/app-scripts : 3.1.5
Cordova Platforms  : ios 4.5.4
Ionic Framework    : ionic-angular 3.9.2

System:

Node  : v8.9.3
npm   : 5.5.1 
OS    : OS X El Capitan
Xcode : Xcode 7.1.1 Build version 7B1005 

Environment Variables:

ANDROID_HOME : not set

Misc:

backend : pro
2

2 Answers

1
votes

Cordova Platforms : ios 4.5.4

You are using the latest cordova-ios (currently 4.5.4) platform in your app. The minimum Xcode version supported is Xcode 8. Check here.

NOTE: Xcode 8 is required. Currently, to submit to the Apple App Store, you should use the latest shipped version of the iOS SDK, which is iOS 10 and this is included only with Xcode 8.

You need to upgrade Xcode from 7.1.1 to 8 atleast or even 9.

0
votes

Make sure you use sudo especially when making/overwriting files.