contfedorov opened a new issue, #1371:
URL: https://github.com/apache/cordova-ios/issues/1371
# Bug Report
Using CLI command `cordova run ios --target=iPhone-X` causes build failure.
Without `--target` specified it builds correctly, but I can't deploy it to
arbitrary device. Same happens if I use `emulate` command instead of `run`.
## Problem
After update to `cordova-ios` v7.0.1 (Cordova CLI 12.0.0), I faced the
mentioned issue.
Steps to reproduce are the following.
1. Create sample app:
`cordova create MyApp`
2. Add iOS platform:
`cd MyApp`
`cordova platform add ios`
3. Run app specifying target device:
`cordova run ios --target=iPhone-X`
I have 'iPhone-X' simulator in my devices list returned by `cordova run ios
--list`:
<details>
```
Available iOS Devices:
Available iOS Simulators:
iPhone-X, 14.0
iPhone-XR, 14.0
iPad--7th-generation-, 14.0
iPhone-SE-3rd-generation, 15.5
iPhone-SE-3rd-generation, 16.4
iPhone-14, 16.4
iPhone-14-Plus, 16.4
iPhone-14-Pro, 16.4
iPhone-14-Pro-Max, 16.4
iPad-Air-5th-generation, 15.5
iPad-Air-5th-generation, 16.4
iPad-10th-generation, 16.4
iPad-mini-6th-generation, 15.5
iPad-mini-6th-generation, 16.4
iPad-Pro-11-inch-4th-generation-8GB, 16.4
iPad-Pro-12-9-inch-6th-generation-8GB, 16.4
iPhone-8, 15.5
iPhone-8-Plus, 15.5
iPhone-11, 15.5
iPhone-11-Pro, 15.5
iPhone-11-Pro-Max, 15.5
iPhone-12-mini, 15.5
iPhone-12, 15.5
iPhone-12-Pro, 15.5
iPhone-12-Pro-Max, 15.5
iPhone-13-Pro, 15.5
iPhone-13-Pro-Max, 15.5
iPhone-13-mini, 15.5
iPhone-13, 15.5
iPod-touch--7th-generation-, 15.5
iPad-Pro--9-7-inch-, 15.5
iPad-9th-generation, 15.5
iPad-Pro-11-inch-3rd-generation, 15.5
iPad-Pro-12-9-inch-5th-generation, 15.5
```
</details>
### What is expected to happen?
App runs on specified iOS simulator
### What does actually happen?
Build fails with the following log (stripped out most of the log, preserved
just errors):
```
...
In file included from <project-dir>/platforms/ios/HelloCordova/main.m:21:
<project-dir>/platforms/ios/HelloCordova/AppDelegate.h:20:9: fatal error:
'Cordova/CDVAppDelegate.h' file not found
#import <Cordova/CDVAppDelegate.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
...
In file included from
<project-dir>/platforms/ios/HelloCordova/MainViewController.m:20:
<project-dir>/platforms/ios/HelloCordova/MainViewController.h:20:9: fatal
error: 'Cordova/CDVViewController.h' file not found
#import <Cordova/CDVViewController.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
...
** BUILD FAILED **
The following build commands failed:
CompileC
<user-dir>/Library/Developer/Xcode/DerivedData/HelloCordova-atsaeonuoeboblfhydhryugxirkl/Build/Intermediates.noindex/HelloCordova.build/Debug-maccatalyst/HelloCordova.build/Objects-normal/x86_64/MainViewController.o
<project-dir>/platforms/ios/HelloCordova/MainViewController.m normal x86_64
objective-c com.apple.compilers.llvm.clang.1_0.compiler (in target
'HelloCordova' from project 'HelloCordova')
CompileC
<user-dir>/Library/Developer/Xcode/DerivedData/HelloCordova-atsaeonuoeboblfhydhryugxirkl/Build/Intermediates.noindex/HelloCordova.build/Debug-maccatalyst/HelloCordova.build/Objects-normal/x86_64/main.o
<project-dir>/platforms/ios/HelloCordova/main.m normal x86_64 objective-c
com.apple.compilers.llvm.clang.1_0.compiler (in target 'HelloCordova' from
project 'HelloCordova')
CompileC
<user-dir>/Library/Developer/Xcode/DerivedData/HelloCordova-atsaeonuoeboblfhydhryugxirkl/Build/Intermediates.noindex/HelloCordova.build/Debug-maccatalyst/HelloCordova.build/Objects-normal/x86_64/AppDelegate.o
<project-dir>/platforms/ios/HelloCordova/AppDelegate.m normal x86_64
objective-c com.apple.compilers.llvm.clang.1_0.compiler (in target
'HelloCordova' from project 'HelloCordova')
(3 failures)
Command failed with exit code 65: xcodebuild -workspace
HelloCordova.xcworkspace -scheme HelloCordova -configuration Debug -sdk
iphonesimulator -destination platform=iOS Simulator,name=iPhone X build
SYMROOT=<project-dir>/platforms/ios/build
```
At the same time, building an app via XCode (opened
`HelloCordova.xcworkspace`) works correctly, but contains 35 warnings:
<details>
```
Stale file
'<project-dir>/platforms/ios/build/Debug-iphonesimulator/include/Cordova' is
located outside of the allowed root paths.
Stale file
'<project-dir>/platforms/ios/build/Debug-iphonesimulator/include/Cordova/CDV.h'
is located outside of the allowed root paths.
Stale file
'<project-dir>/platforms/ios/build/Debug-iphonesimulator/include/Cordova/CDVAllowList.h'
is located outside of the allowed root paths.
Stale file
'<project-dir>/platforms/ios/build/Debug-iphonesimulator/include/Cordova/CDVAppDelegate.h'
is located outside of the allowed root paths.
Stale file
'<project-dir>/platforms/ios/build/Debug-iphonesimulator/include/Cordova/CDVAvailability.h'
is located outside of the allowed root paths.
Stale file
'<project-dir>/platforms/ios/build/Debug-iphonesimulator/include/Cordova/CDVAvailabilityDeprecated.h'
is located outside of the allowed root paths.
Stale file
'<project-dir>/platforms/ios/build/Debug-iphonesimulator/include/Cordova/CDVCommandDelegate.h'
is located outside of the allowed root paths.
Stale file
'<project-dir>/platforms/ios/build/Debug-iphonesimulator/include/Cordova/CDVCommandQueue.h'
is located outside of the allowed root paths.
Stale file
'<project-dir>/platforms/ios/build/Debug-iphonesimulator/include/Cordova/CDVConfigParser.h'
is located outside of the allowed root paths.
Stale file
'<project-dir>/platforms/ios/build/Debug-iphonesimulator/include/Cordova/CDVInvokedUrlCommand.h'
is located outside of the allowed root paths.
Stale file
'<project-dir>/platforms/ios/build/Debug-iphonesimulator/include/Cordova/CDVPlugin+Resources.h'
is located outside of the allowed root paths.
Stale file
'<project-dir>/platforms/ios/build/Debug-iphonesimulator/include/Cordova/CDVPlugin.h'
is located outside of the allowed root paths.
Stale file
'<project-dir>/platforms/ios/build/Debug-iphonesimulator/include/Cordova/CDVPluginResult.h'
is located outside of the allowed root paths.
Stale file
'<project-dir>/platforms/ios/build/Debug-iphonesimulator/include/Cordova/CDVScreenOrientationDelegate.h'
is located outside of the allowed root paths.
Stale file
'<project-dir>/platforms/ios/build/Debug-iphonesimulator/include/Cordova/CDVTimer.h'
is located outside of the allowed root paths.
Stale file
'<project-dir>/platforms/ios/build/Debug-iphonesimulator/include/Cordova/CDVURLSchemeHandler.h'
is located outside of the allowed root paths.
Stale file
'<project-dir>/platforms/ios/build/Debug-iphonesimulator/include/Cordova/CDVViewController.h'
is located outside of the allowed root paths.
Stale file
'<project-dir>/platforms/ios/build/Debug-iphonesimulator/include/Cordova/CDVWebViewEngineProtocol.h'
is located outside of the allowed root paths.
Stale file
'<project-dir>/platforms/ios/build/Debug-iphonesimulator/include/Cordova/CDVWebViewProcessPoolFactory.h'
is located outside of the allowed root paths.
Stale file
'<project-dir>/platforms/ios/build/Debug-iphonesimulator/include/Cordova/NSDictionary+CordovaPreferences.h'
is located outside of the allowed root paths.
Stale file
'<project-dir>/platforms/ios/build/Debug-iphonesimulator/include/Cordova/NSMutableArray+QueueAdditions.h'
is located outside of the allowed root paths.
Stale file
'<project-dir>/platforms/ios/build/Debug-iphonesimulator/libCordova.a' is
located outside of the allowed root paths.
Stale file
'<project-dir>/platforms/ios/build/Debug-iphonesimulator/HelloCordova.app' is
located outside of the allowed root paths.
Stale file
'<project-dir>/platforms/ios/build/Debug-iphonesimulator/HelloCordova.app.dSYM/Contents/Resources/DWARF/HelloCordova'
is located outside of the allowed root paths.
Stale file
'<project-dir>/platforms/ios/build/Debug-iphonesimulator/HelloCordova.app/Assets.car'
is located outside of the allowed root paths.
Stale file
'<project-dir>/platforms/ios/build/Debug-iphonesimulator/HelloCordova.app/CDVLaunchScreen.storyboardc'
is located outside of the allowed root paths.
Stale file
'<project-dir>/platforms/ios/build/Debug-iphonesimulator/HelloCordova.app/HelloCordova'
is located outside of the allowed root paths.
Stale file
'<project-dir>/platforms/ios/build/Debug-iphonesimulator/HelloCordova.app/Info.plist'
is located outside of the allowed root paths.
Stale file
'<project-dir>/platforms/ios/build/Debug-iphonesimulator/HelloCordova.app/MainViewController.nib'
is located outside of the allowed root paths.
Stale file
'<project-dir>/platforms/ios/build/Debug-iphonesimulator/HelloCordova.app/MainViewController~ipad.nib'
is located outside of the allowed root paths.
Stale file
'<project-dir>/platforms/ios/build/Debug-iphonesimulator/HelloCordova.app/MainViewController~iphone.nib'
is located outside of the allowed root paths.
Stale file
'<project-dir>/platforms/ios/build/Debug-iphonesimulator/HelloCordova.app/PkgInfo'
is located outside of the allowed root paths.
Stale file
'<project-dir>/platforms/ios/build/Debug-iphonesimulator/HelloCordova.app/_CodeSignature'
is located outside of the allowed root paths.
Stale file
'<project-dir>/platforms/ios/build/Debug-iphonesimulator/HelloCordova.app/config.xml'
is located outside of the allowed root paths.
Stale file
'<project-dir>/platforms/ios/build/Debug-iphonesimulator/HelloCordova.app/www'
is located outside of the allowed root paths.
```
</details>
## Information
<!-- Include all relevant information that might help understand and
reproduce the problem -->
First, I've checked via my current project (not using sample one). In this
case, it cannot find some other Obj-C files, like `Cordova/CDV.h`, actually
required by some plugins installed. Warnings in XCode were similar.
### Command or Code
<!-- What command or code is needed to reproduce the problem? -->
`cordova run ios --target=iPhone-X`, using `--target` is essential here
### Environment, Platform, Device
<!-- In what environment, on what platform or on which device are you
experiencing the issue? -->
macOS Ventura, Version 13.4.1 (22F82)
iOS simulators tested:
- iPhone X, iOS 14.0
- iPhone 13, iOS 15.5
### Version information
<!--
What are relevant versions you are using?
For example:
Cordova: Cordova CLI, Cordova Platforms, Cordova Plugins
Other Frameworks: Ionic Framework and CLI version
Operating System, Android Studio, Xcode etc.
-->
```
cordova -v
12.0.0 ([email protected])
```
```
cordova platform list
Installed platforms:
ios 7.0.1
Available platforms:
android
browser
electron
```
```
cordova plugin list
No plugins added. Use `cordova plugin add <plugin>`.
```
XCode Version 14.3.1 (14E300c)
## Checklist
<!-- Please check the boxes by putting an x in the [ ] like so: [x] -->
- [x] I searched for existing GitHub issues
- [x] I updated all Cordova tooling to most recent version
- [x] I included all the necessary information above
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]