Cannot read property 'name' of undefined on ionic build - ios

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

Related

Cordova App - IOS build failed on Appflow, Failed to install 'onesignal-cordova-plugin': Error: pod: Command failed with exit code 31

IOS build keeps failing on Appflow, every other plugin were installed except for firebasex and onesignal, have tried almost all solutions online which include installing phonegap-plugin-push all still not working, i will appreciate if anyone can help with solution error below on appflow:
*Failed to install 'cordova-plugin-firebasex': Error: pod: Command failed with exit code 31 Error output:
Failed to install 'onesignal-cordova-plugin': Error: pod: Command failed with exit code 31
at ChildProcess.whenDone (/Users/ionic/builds/smartacedeveloper/HOR-Cordova/node_modules/cordova-common/src/superspawn.js:136:25)
at ChildProcess.emit (events.js:315:20)
at maybeClose (internal/child_process.js:1048:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
Failed to restore plugin "onesignal-cordova-plugin". You might need to try adding it again. Error: Error: pod: Command failed with exit code 31
also see my Ionic Info,
Ionic:
Ionic CLI : 6.11.8
Ionic Framework : #ionic/angular 5.3.3
#angular-devkit/build-angular : 0.1002.0
#angular-devkit/schematics : 10.0.8
#angular/cli : 10.0.8
#ionic/angular-toolkit : 2.3.3
Cordova:
Cordova CLI : not installed
Cordova Platforms : android 9.0.0, ios 6.2.0
Cordova Plugins : cordova-plugin-ionic-keyboard 2.2.0,
cordova-plugin-ionic-webview 4.2.1, (and 21 other plugins)
Utility:
cordova-res (update available: 0.15.3) : 0.15.1
native-run (update available: 1.3.0) : 1.1.0
System:
Android SDK Tools : 26.1.1 (C:\Users\GOLD AND DIAMOND\AppData\Local\Android\Sdk)
NodeJS : v14.15.3 (C:\Program Files\nodejs\node.exe)
npm : 6.14.10
OS : Windows 10
Try running this:
brew update;
brew upgrade;
pod repo update
Many people fixes the problem just with 'pod repo update'.
If it doesn't work, make sure you do not run pod install as admin and that permissions for all the folders and files in the ionic project (not only iOS folder) are not locked. Right-click on folder, obtain information. In the popup, at the bottom, touch the locker, write your Mac's password, and after that there's a dropdown to the left, select 'Apply to included items' (to apply recursively).
If still doesn't work make sure you're using the last version of each plugin.

ionic build ios error ( ionic cordova build ios )

When i run "ionic cordova build ios" get error below in terminal:
The following build commands failed:
Ld build/emulator/Posify\ Kitchen.app/Posify\ Kitchen normal x86_64
(1 failure)
Error: Error code 65 for command: xcodebuild with args: -xcconfig,/Users/YJD/Mayun_POS/posify-pos-fb-united/platforms/ios/cordova/build-debug.xcconfig,-workspace,Posify Kitchen.xcworkspace,-scheme,Posify Kitchen,-configuration,Debug,-sdk,iphonesimulator,-destination,platform=iOS Simulator,name=iPhone X,build,CONFIGURATION_BUILD_DIR=/Users/YJD/Mayun_POS/posify-pos-fb-united/platforms/ios/build/emulator,SHARED_PRECOMPS_DIR=/Users/YJD/Mayun_POS/posify-pos-fb-united/platforms/ios/build/sharedpch
ionic info:
cli packages: (/Users/YJD/Mayun_POS/posify-pos-fb-united/node_modules)
#ionic/cli-utils : 1.17.0
ionic (Ionic CLI) : 3.17.0
global packages:
cordova (Cordova CLI) : 7.1.0
local packages:
#ionic/app-scripts : 1.3.7
Cordova Platforms : android 6.3.0 ios 4.5.3
Ionic Framework : ionic-angular 3.8.0
System:
ios-deploy : 1.9.2
Node : v6.11.5
npm : 5.5.1
OS : macOS Sierra
Xcode : Xcode 9.0.1 Build version 9A1004
Environment Variables:
ANDROID_HOME : not set
Misc:
backend : pro
I figured it out myself. All of errors seem like "Error: Error code 65 for command: xcodebuild......" are because of certification or Provision profile.I applied the newest provision profile and it fixed.

livereload causes app to stall on splash screen (continuous loading wheel) - Ionic

UPDATE
It stopped working without livereload too - so now it wasn't being cause by livereload - but I still need help with this problem
After the iOS 11 update (I think that is the cause of this because things were fine before), I am not able to use livereload. If I try to use livereload, it hangs on the splash screen - with the loading wheel spinning. Here is some info about my ionic environment:
Eamons-MBP:myapp eamonwhite$ ionic info
cli packages: (/Users/eamonwhite/ionicmane/myApp/node_modules)
#ionic/cli-utils : 1.12.0
ionic (Ionic CLI) : 3.12.0
global packages:
cordova (Cordova CLI) : 7.0.1
local packages:
#ionic/app-scripts : 1.3.12
Cordova Platforms : android 6.2.3 ios 4.4.0
Ionic Framework : ionic-angular 3.5.0
System:
ios-deploy : 1.9.2
ios-sim : 6.1.2
Node : v7.7.3
npm : 4.1.2
OS : macOS High Sierra
Xcode : Xcode 9.0 Build version 9A235
Misc:
backend : legacy
When I run it with xcode, it says this in the xcode console:
2017-10-10 15:49:17.417901-0400 myApp[8476:3520766] Resetting plugins due to page load.
2017-10-10 15:49:38.433127-0400 myApp[8476:3520766] Failed to load webpage with error: The request timed out.
In the ionic console, it stops before the deviceready event:
------ Debug phase ------
Starting debug of 2e5ac6066864be48322a757c4d0ccdfde52cf356 (N51AP, iPhone 5s (GSM), iphoneos, arm64) a.k.a. 'Eamon White’s iPhone' connected through USB...
[ 0%] Looking up developer disk image
[ 90%] Mounting developer disk image
[ 95%] Developer disk image already mounted
[100%] Connecting to remote debug server
-------------------------
(lldb) command source -s 0 '/tmp/2F06F4BB-A7E5-4B97-87EC-A01CBEE5661A/fruitstrap-lldb-prep-cmds-2e5ac6066864be48322a757c4d0ccdfde52cf356'
Executing commands in '/tmp/2F06F4BB-A7E5-4B97-87EC-A01CBEE5661A/fruitstrap-lldb-prep-cmds-2e5ac6066864be48322a757c4d0ccdfde52cf356'.
(lldb) platform select remote-ios --sysroot '/Users/eamonwhite/Library/Developer/Xcode/iOS DeviceSupport/10.3.3 (14G60)/Symbols'
Platform: remote-ios
Connected: no
SDK Path: "/Users/eamonwhite/Library/Developer/Xcode/iOS DeviceSupport/10.3.3 (14G60)/Symbols"
(lldb) target create "/Users/eamonwhite/ionicmane/myapp/platforms/ios/build/device/myApp.app"
Current executable set to '/Users/eamonwhite/ionicmane/myapp/platforms/ios/build/device/myApp.app' (arm64).
(lldb) script fruitstrap_device_app="/private/var/containers/Bundle/Application/5EBCC0EF-FDB9-4DE7-A961-D91B6139AEA0/myApp.app"
(lldb) script fruitstrap_connect_url="connect://127.0.0.1:50188"
(lldb) target modules search-paths add /usr "/Users/eamonwhite/Library/Developer/Xcode/iOS DeviceSupport/10.3.3 (14G60)/Symbols/usr" /System "/Users/eamonwhite/Library/Developer/Xcode/iOS DeviceSupport/10.3.3 (14G60)/Symbols/System" "/private/var/containers/Bundle/Application/5EBCC0EF-FDB9-4DE7-A961-D91B6139AEA0" "/Users/eamonwhite/ionicmane/myapp/platforms/ios/build/device" "/var/containers/Bundle/Application/5EBCC0EF-FDB9-4DE7-A961-D91B6139AEA0" "/Users/eamonwhite/ionicmane/myapp/platforms/ios/build/device" /Developer "/Users/eamonwhite/Library/Developer/Xcode/iOS DeviceSupport/10.3.3 (14G60)/Symbols/Developer"
(lldb) command script import "/tmp/2F06F4BB-A7E5-4B97-87EC-A01CBEE5661A/fruitstrap_2e5ac6066864be48322a757c4d0ccdfde52cf356.py"
(lldb) command script add -f fruitstrap_2e5ac6066864be48322a757c4d0ccdfde52cf356.connect_command connect
(lldb) command script add -s asynchronous -f fruitstrap_2e5ac6066864be48322a757c4d0ccdfde52cf356.run_command run
(lldb) command script add -s asynchronous -f fruitstrap_2e5ac6066864be48322a757c4d0ccdfde52cf356.autoexit_command autoexit
(lldb) command script add -s asynchronous -f fruitstrap_2e5ac6066864be48322a757c4d0ccdfde52cf356.safequit_command safequit
(lldb) connect
(lldb) run
success
(lldb) safequit
Process 7681 detached
Also, I updated my ios-deploy from 1.9.1 to 1.9.2 before this started happening.
Why can't I use livereload? Again, I think this might have something to do with the iOS 11 update. Does anybody know a workaround...I have read something about npm run watch but couldn't get it running.
I have created a blank app to see if that would run with livereload and it doesn't.
The wifi on my phone was off so it wasn't connecting to ionic.

No console logs in terminal with Ionic run

I am trying to ionic cordova run ios -lcs or just -cs on an iphone 5s connected via usb to a mac (OSX 10.11.6).
The app runs on the iPhone but I don't see any JavaScript logs in the terminal. And I don't see the device listed in the Development menu in Safari.
ionic info
[ERROR] Error with
/Users/ludux/Documents/PROJETS/BOINE/dev/ne/www/lib/ionic/version.json
file: FILE_NOT_FOUND
global packages:
#ionic/cli-utils : 1.4.0
Cordova CLI : 7.0.1
Gulp CLI : not installed globally
Ionic CLI : 3.4.0
local packages:
#ionic/cli-plugin-cordova : 1.4.0
#ionic/cli-plugin-gulp : 1.0.1
#ionic/cli-plugin-ionic1 : 2.0.0
Cordova Platforms : ios 4.3.1
Ionic Framework : unknown
System:
Node : v7.2.0
OS : OS X El Capitan
Xcode : Xcode 8.2.1 Build version 8C1002
ios-deploy : 1.9.0
ios-sim : 5.0.8
npm : 3.10.9
End of compilation log in terminal:
------ Debug phase ------
Starting debug of iPhone 5s (Global/CDMA) 'iPhone de Lou' (5910f2d7cc2f113756d5de4b942029559ea0cd38) connected through USB...
[ 0%] Looking up developer disk image
[ 95%] Developer disk image mounted successfully
[100%] Connecting to remote debug server
-------------------------
(lldb) command source -s 0 '/tmp/E6C7DA82-1774-45A2-B4B2-0CD3988AE4BD/fruitstrap-lldb-prep-cmds-5910f2d7cc2f113756d5de4b942029559ea0cd38'
Executing commands in '/tmp/E6C7DA82-1774-45A2-B4B2-0CD3988AE4BD/fruitstrap-lldb-prep-cmds-5910f2d7cc2f113756d5de4b942029559ea0cd38'.
(lldb) platform select remote-ios --sysroot '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/10.2 (14C89)/Symbols'
Platform: remote-ios
Connected: no
SDK Path: "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/10.2 (14C89)/Symbols"
(lldb) target create "/Users/ludovicroux/Documents/PROJETS/BOARDLINE/dev/boardline/platforms/ios/build/device/BoardLine.app"
Current executable set to '/Users/ludovicroux/Documents/PROJETS/BOARDLINE/dev/boardline/platforms/ios/build/device/BoardLine.app' (arm64).
(lldb) script fruitstrap_device_app="/private/var/containers/Bundle/Application/13EA02BB-85A1-4818-ACDB-161AC1DDE62E/BoardLine.app"
(lldb) script fruitstrap_connect_url="connect://127.0.0.1:59590"
(lldb) command script import "/tmp/E6C7DA82-1774-45A2-B4B2-0CD3988AE4BD/fruitstrap_5910f2d7cc2f113756d5de4b942029559ea0cd38.py"
(lldb) command script add -f fruitstrap_5910f2d7cc2f113756d5de4b942029559ea0cd38.connect_command connect
(lldb) command script add -s asynchronous -f fruitstrap_5910f2d7cc2f113756d5de4b942029559ea0cd38.run_command run
(lldb) command script add -s asynchronous -f fruitstrap_5910f2d7cc2f113756d5de4b942029559ea0cd38.autoexit_command autoexit
(lldb) command script add -s asynchronous -f fruitstrap_5910f2d7cc2f113756d5de4b942029559ea0cd38.safequit_command safequit
(lldb) connect
(lldb) run
success
(lldb) safequit
Process 308 detached
(lldb)

Ionic build ios is stuck

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

Resources