When I run the command ionic cordova build ios I am getting the below error:
Running app-scripts build: --platform ios --target cordova
[12:54:28] build dev started ...
[12:54:29] clean started ...
[12:54:29] clean finished in 7 ms
[12:54:29] copy started ...
Config file "/Users/<user_name>/Documents/Working Folder/<project_name>/config/copy.config.js" not found. Using defaults instead.
[12:54:30] deeplinks started ...
[12:54:33] deeplinks finished in 3.10 s
[12:54:33] transpile started ...
[12:54:52] typescript: node_modules/ng2-pdf-viewer/src/app/pdf-viewer/pdf-viewer.component.d.ts, line: 41
Type 'CustomEvent' is not generic.
L40: onError: EventEmitter<any>;
L41: onProgress: EventEmitter<PDFProgressData>;
L42: pageChange: EventEmitter<number>;
[12:54:52] typescript: node_modules/ng2-pdf-viewer/src/app/pdf-viewer/pdf-viewer.component.d.ts, line: 42
Type 'CustomEvent' is not generic.
L41: onProgress: EventEmitter<PDFProgressData>;
L42: pageChange: EventEmitter<number>;
L43: src: string | Uint8Array | PDFSource;
Error: Failed to transpile program
at new BuildError (/Users/<user_name>/Documents/Working Folder/<project_name>/node_modules/#ionic/app-scripts/dist/util/errors.js:16:28)
at /Users/<user_name>/Documents/Working Folder/<project_name>/node_modules/#ionic/app-scripts/dist/transpile.js:159:20
at new Promise (<anonymous>)
at transpileWorker (/Users/<user_name>/Documents/Working Folder/<project_name>/node_modules/#ionic/app-scripts/dist/transpile.js:107:12)
at Object.transpile (/Users/<user_name>/Documents/Working Folder/<project_name>/node_modules/#ionic/app-scripts/dist/transpile.js:64:12)
at /Users/<user_name>/Documents/Working Folder/<project_name>/node_modules/#ionic/app-scripts/dist/build.js:109:82
[12:54:52] copy finished in 23.56 s
Before building, I had
Removed node_modules, added again with npm i.
Removed and added ios platform using ionic cordova platform remove ios and ionic cordova platform add ios.
Upgraded cordova-ios from 4.4 to 5.1.0
My ionic info:
cli packages: (/usr/local/lib/node_modules)
#ionic/cli-utils : 1.19.0
ionic (Ionic CLI) : 3.19.0
global packages:
cordova (Cordova CLI) : 8.0.0
local packages:
#ionic/app-scripts : 3.1.9
Cordova Platforms : ios 5.1.0
Ionic Framework : ionic-angular 3.9.2
System:
ios-deploy : 1.9.2
ios-sim : 8.0.2
Node : v10.0.0
npm : 5.6.0
OS : macOS
Xcode : Xcode 13.1 Build version 13A1030d
Environment Variables:
ANDROID_HOME : not set
Misc:
backend : pro
Its my first time building an ionic app build via a Mac and its showing me flames. I have followed steps on the ionic page to do setup and build but for some reason I am having issues.
When I run ionic Cordova build iOS --prod --release
This is the error below:
Wrote out iOS Bundle Version "1.3.8" to /Users/admin/Development/App/platforms/iOS/App/App-Info.plist
Set IPHONEOS_DEPLOYMENT_TARGET to "11.0".
iOS Product Name has not changed (still "App")
Updating icons at platforms/iOS/App/Images.xcassets/AppIcon.appiconset/
Updating launch storyboard images at platforms/iOS/App/Images.xcassets/LaunchStoryboard.imageset/
Updating Storyboard image set contents.json
Updating Background Color color set Contents.json
This app does not have additional resource files defined
Prepared iOS project successfully
Executing script found in plugin cordova-plugin-add-swift-support for hook "after_prepare": plugins/cordova-plugin-add-swift-support/src/add-swift-support.js
No scripts found for hook "before_compile".
Running command: xcodebuild -version
Command finished with error code 0: xcodebuild -version
Running command: ioreg -p IOUSB -l
Command finished with error code 0: ioreg -p,IOUSB,-l
Running command: xcrun simctl list --json
Command finished with error code 0: xcrun simctl,list,--json
Running command: xcrun simctl list --json
Command finished with error code 0: xcrun simctl,list,--json
Cannot read property 'name' of undefined
TypeError: Cannot read property 'name' of undefined
at /Users/admin/Development/App/platforms/ios/cordova/lib/build.js:145:60
at _fulfilled (/Users/admin/Development/App/node_modules/q/q.js:854:54)
at /Users/admin/Development/App/node_modules/q/q.js:883:30
at Promise.promise.promiseDispatch (/Users/admin/Development/App/node_modules/q/q.js:816:13)
at /Users/admin/Development/App/node_modules/q/q.js:624:44
at runSingle (/Users/admin/Development/App/node_modules/q/q.js:137:13)
at flush (/Users/admin/Development/App/node_modules/q/q.js:125:13)
at processTicksAndRejections (internal/process/task_queues.js:75:11)
[ERROR] An error occurred while running subprocess cordova.
cordova build ios --release --verbose exited with exit code 1.
Re-running this command with the --verbose flag may provide more information.
ionic:utils-process onBeforeExit handler: 'process.exit' received +0ms
ionic:utils-process onBeforeExit handler: running 2 functions +0ms
ionic:utils-process processExit: exiting (exit code: 1) +42ms
I have tried to do a build on a new project and samething happened. I did a build for android and its working fine on a windows machine I was doing dev on for the project.
Here is my ionic info data
Ionic:
Ionic CLI : 6.12.4 (/usr/local/lib/node_modules/#ionic/cli)
Ionic Framework : #ionic/angular 5.5.3
#angular-devkit/build-angular : 0.1100.7
#angular-devkit/schematics : 11.0.7
#angular/cli : 11.0.7
#ionic/angular-toolkit : 3.0.0
Cordova:
Cordova CLI : 10.0.0
Cordova Platforms : ios 6.1.1
Cordova Plugins : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 5.0.0, (and 15 other plugins)
Utility:
cordova-res : not installed
native-run : 1.3.0
System:
ios-deploy : 1.11.3
ios-sim : 8.0.2
NodeJS : v14.15.4 (/usr/local/bin/node)
npm : 6.14.10
OS : macOS Big Sur
Xcode : Xcode 12.3 Build version 12C33
Thanks
I'm developing a Hybrid app using ionic 3 but when I build the app in IOS I'm getting below error.
Error
at cli.catch.err (/usr/local/lib/node_modules/cordova/bin/cordova:30:15)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:169:7)
[ERROR] An error occurred while running Cordova build iOS (exit code 1).
My ionic environment info
cli packages: (/usr/local/lib/node_modules)
#ionic/cli-utils : 1.19.2
ionic (Ionic CLI) : 3.20.0
global packages:
cordova (Cordova CLI) : 8.1.2 (cordova-lib#8.1.1)
local packages:
#ionic/app-scripts : 3.2.1
Cordova Platforms : ios 4.5.5
Ionic Framework : ionic-angular 3.9.2
System:
ios-deploy : 1.9.4
Node : v8.1.4
npm : 5.0.3
OS : macOS High Sierra
Xcode : Xcode 9.2 Build version 9C40b
Environment Variables:
ANDROID_HOME : not set
Misc:
backend : pro
When i am trying to create IOS build getting error like below.
Error: Metadata version mismatch for module /Users/newuser/WebstormProjects/myproject/node_modules/#ionic-native/network/index.d.ts, found version 4, expected 3
at StaticSymbolResolver.getModuleMetadata (/Users/newuser/myproject/node_modules/#angular/compiler/bundles/compiler.umd.js:24474:34)
at StaticSymbolResolver._createSymbolsOf (/Users/newuser/myproject/node_modules/#angular/compiler/bundles/compiler.umd.js:24260:46)
at StaticSymbolResolver.getSymbolsOf (/Users/newuser/myproject/node_modules/#angular/compiler/bundles/compiler.umd.js:24241:14)
at /Users/newuser/myproject/node_modules/#angular/compiler/bundles/compiler.umd.js:23023:30
at Array.forEach (native)
at extractProgramSymbols (/Users/newuser/myproject/node_modules/#angular/compiler/bundles/compiler.umd.js:23022:79)
at AotCompiler.compileAll (/Users/newuser/myproject/node_modules/#angular/compiler/bundles/compiler.umd.js:22720:47)
at CodeGenerator.codegen (/Users/newuser/myproject/node_modules/#angular/compiler-cli/src/codegen.js:30:14)
at Function.NgTools_InternalApi_NG_2.codeGen (/Users/newuser/myproject/node_modules/#angular/compiler-cli/src/ngtools_api.js:61:30)
at Object.doCodegen (/Users/newuser/myproject/node_modules/#ionic/app-scripts/dist/aot/codegen.js:6:51)
cli packages:
#ionic/cli-utils : 1.16.0
ionic (Ionic CLI) : 3.16.0
global packages:
cordova (Cordova CLI) : 7.0.1
local packages:
#ionic/app-scripts : 2.1.3
Cordova Platforms : android 6.3.0 browser 4.1.0 ios 4.4.0
Ionic Framework : ionic-angular 3.6.0
System:
Node : v6.11.1
npm : 3.10.10
OS : macOS Sierra
Xcode : Xcode 8.3.3 Build version 8E3004b
Environment Variables:
ANDROID_HOME : not set
Misc:
backend : legacy
I have trouble making a build in IOS, when I do a build in android not show any problema.No shows no mistake is only hung with the following message:
ionic build ios
Running command: /Users/kaos/Documents/Proyectos/Ionic/voxMonitor/hooks/after_prepare/010_add_platform_class.js /Users/kaos/Documents/Proyectos/Ionic/voxMonitor
add to body class: platform-ios
Building project: /Users/kaos/Documents/Proyectos/Ionic/voxMonitor/platforms/ios/voxMonitor.xcodeproj
Configuration: Debug
Platform: emulator
2016-09-14 00:57:11.666 xcodebuild[81377:2780361] [MT] PluginLoading: Required plug-in compatibility UUID 8A66E736-A720-4B3C-92F1-33D9962C69DF for plug-in at path '~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/XcodeColors.xcplugin' not present in DVTPlugInCompatibilityUUIDs
2016-09-14 00:57:11.668 xcodebuild[81377:2780361] [MT] PluginLoading: Required plug-in compatibility UUID 8A66E736-A720-4B3C-92F1-33D9962C69DF for plug-in at path '~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/OMQuickHelp.xcplugin' not present in DVTPlugInCompatibilityUUIDs
2016-09-14 00:57:11.669 xcodebuild[81377:2780361] [MT] PluginLoading: Required plug-in compatibility UUID 8A66E736-A720-4B3C-92F1-33D9962C69DF for plug-in at path '~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/Alcatraz.xcplugin' not present in DVTPlugInCompatibilityUUIDs
Build settings from command line:
CONFIGURATION_BUILD_DIR = /Users/kaos/Documents/Proyectos/Ionic/voxMonitor/platforms/ios/build/emulator
SDKROOT = iphonesimulator10.0
SHARED_PRECOMPS_DIR = /Users/kaos/Documents/Proyectos/Ionic/voxMonitor/platforms/ios/build/sharedpch
Build settings from configuration file '/Users/kaos/Documents/Proyectos/Ionic/voxMonitor/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
when I try to open the file xcodeproj, xcode does not start and waits indefinitely until the force exit.
My ionic info :
Your system information:
Cordova CLI: 6.3.1
Ionic Framework Version: 1.3.1
Ionic CLI Version: 2.0.0-beta.37
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: v6.5.0
Xcode version: Xcode 8.0 Build version 8A218a
worth mentioning that I am currently using MacOS Sierra GM and Xcode 8 gm.
Edit : when creating a new project and replace the www directory with the version in my project, I can build ios, but once you modify any file no longer compile I can, being hung on the screen above.
The origin of the problem is the project folder is inside the Documents directory which in turn is synchronized to iCloud, so when you move the project to another directory that is not Documents or Desktop, you can build without problems. In this thread on github shows other users who managed to fix it this way.
https://github.com/driftyco/ionic-cli/issues/1401#issuecomment-254989260
Follow these steps(And Before following these steps make sure you have installed IOS SDK on your system)
Remove Hooks with command $ionic hooks remove
Remove Platform with command $ionic platform remove ios
Now Add Hooks with command $ionic hooks add
Now add platform with command $ionic platform ios
Now create build with command $ionic build ios
Now Run your application with command $ionic run ios
My case was the build would hang/stuck when running $ ionic cordova build ios. OS is MacOS Mojave.
My solution was to update ionic and cordova environment. Worth doing ionic cordova build ios --verbose to see what is happening during the build process.
$ brew link --overwrite ios-deploy
$ npm update -g native-run
$ npm install -g cordova ionic
$ npm install -g ionic-angular#latest
Config before update:
Ionic:
Ionic CLI : 5.2.1 (/usr/local/lib/node_modules/ionic)
Ionic Framework : #ionic/angular 4.6.0
#angular-devkit/build-angular : 0.13.9
#angular-devkit/schematics : 7.2.4
#angular/cli : 7.2.4
#ionic/angular-toolkit : 1.3.0
Cordova:
Cordova CLI : 9.0.0 (cordova-lib#9.0.1)
Cordova Platforms : android 8.1.0, ios 5.1.1
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 4.1.1, (and 23 other plugins)
Utility:
cordova-res : 0.9.0
native-run : 0.2.7 (update available: 0.3.0)
System:
Android SDK Tools : 26.1.1 (/Users/haule/Library/Android/sdk)
ios-deploy : 1.10.0
ios-sim : 8.0.2
NodeJS : v10.19.0 (/usr/local/Cellar/node#10/10.19.0/bin/node)
npm : 6.13.4
OS : macOS Mojave
Xcode : Xcode 11.3.1 Build version 11C504
Config after update:
Ionic:
Ionic CLI : 5.4.16 (/usr/local/lib/node_modules/ionic)
Ionic Framework : #ionic/angular 4.6.0
#angular-devkit/build-angular : 0.13.9
#angular-devkit/schematics : 7.2.4
#angular/cli : 7.2.4
#ionic/angular-toolkit : 1.3.0
Cordova:
Cordova CLI : 9.0.0 (cordova-lib#9.0.1)
Cordova Platforms : android 8.1.0, ios 5.1.1
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 4.1.1, (and 23 other plugins)
Utility:
cordova-res : 0.9.0
native-run : 0.3.0
System:
Android SDK Tools : 26.1.1 (/Users/haule/Library/Android/sdk)
ios-deploy : 1.10.0
ios-sim : 8.0.2
NodeJS : v10.19.0 (/usr/local/Cellar/node#10/10.19.0/bin/node)
npm : 6.13.4
OS : macOS Mojave
Xcode : Xcode 11.3.1 Build version 11C504