0
votes

Background:

  • Xcode version 11.1
  • Project developed in anguar
  • generating build for iOS iPAD only using cordova CLI
  • App will work only on iPad devices

Steps:

run this command on mac terminal instance

sudo cordova build ios

OR

sudo cordova build ios --buildFlag="-UseModernBuildSystem=0"

Getting below error

Actual result i am getting:

Building project: /Users/ac/Downloads/Cordova/projects/TabProject/platforms/ios/TabApp.xcworkspace Configuration: Debug Platform: emulator Build settings from command line: CONFIGURATION_BUILD_DIR = /Users/ac/Downloads/Cordova/projects/TabProject/platforms/ios/build/emulator SDKROOT = iphonesimulator13.1 SHARED_PRECOMPS_DIR = /Users/ac/Downloads/Cordova/projects/InviteTabProject/platforms/ios/build/sharedpch

Build settings from configuration file '/Users/ac/Downloads/Cordova/projects/TabProject/platforms/ios/cordova/build-debug.xcconfig': CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES CODE_SIGN_ENTITLEMENTS = $(PROJECT_DIR)/$(PROJECT_NAME)/Entitlements-$(CONFIGURATION).plist 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)" OTHER_LDFLAGS = -ObjC SWIFT_OBJC_BRIDGING_HEADER = $(PROJECT_DIR)/$(PROJECT_NAME)/Bridging-Header.h

xcodebuild: error: Unable to find a destination matching the provided destination specifier: { platform:iOS Simulator, OS:latest, name:iPhone 11 Pro Max }

Available destinations for the "InviteTabApp" scheme:
    { platform:iOS Simulator, id:60F220FB-8A96-47FC-9151-49424F7ACD16, OS:9.0, name:iPad 2 }
    { platform:iOS Simulator, id:DAD00D9C-6147-4E55-A35C-2B94D36F4DF4, OS:9.0, name:iPad Air }
    { platform:iOS Simulator, id:6C143FB5-9DC5-4DFC-9B2E-0CC7CC6D5EF9, OS:13.1, name:iPad Air (3rd generation) }
    { platform:iOS Simulator, id:000D0612-6879-4A9D-8508-A5932C5E0007, OS:9.0, name:iPad Air 2 }
    { platform:iOS Simulator, id:D3FAE4AF-F472-438F-99CF-D41EB0EE4662, OS:13.1, name:iPad Pro (9.7-inch) }
    { platform:iOS Simulator, id:D3EC08A7-1690-4934-BF49-A788CC67609C, OS:13.1, name:iPad Pro (11-inch) }
    { platform:iOS Simulator, id:989159C3-CF94-40D9-8FDF-EF4E2B096426, OS:13.1, name:iPad Pro (12.9-inch) (3rd generation) }
    { platform:iOS Simulator, id:7F48ADCE-9E3F-4907-AD76-06E726ED93A6, OS:9.0, name:iPad Retina }

Ineligible destinations for the "TabApp" scheme:
    { platform:iOS, id:dvtdevice-DVTiPhonePlaceholder-iphoneos:placeholder, name:Generic iOS Device }
    { platform:iOS Simulator, id:dvtdevice-DVTiOSDeviceSimulatorPlaceholder-iphonesimulator:placeholder, name:Generic iOS Simulator Device }

CordovaError: Promise rejected with non-error: 'Error code 70 for command: xcodebuild with args: -xcconfig,/Users/ac/Downloads/Cordova/projects/InviteTabProject/platforms/ios/cordova/build-debug.xcconfig,-workspace,TabApp.xcworkspace,-scheme,TabApp,-configuration,Debug,-sdk,iphonesimulator,-destination,platform=iOS Simulator,name=iPhone 11 Pro Max,build,CONFIGURATION_BUILD_DIR=/Users/ac/Downloads/Cordova/projects/TabProject/platforms/ios/build/emulator,SHARED_PRECOMPS_DIR=/Users/ac/Downloads/Cordova/projects/TabProject/platforms/ios/build/sharedpch' at cli.catch.err (/usr/local/lib/node_modules/cordova/bin/cordova:30:15) at process.internalTickCallback (internal/process/next_tick.js:77:7)

Actual result:

Build should be generated successfully.

1

1 Answers

0
votes

Check your Cordova version. Try to update your Cordova version higher than 7.1.0, and rewrite your build.json. Cordova Doc iOS build.json