apache / cordova-ios

Apache Cordova iOS
https://cordova.apache.org/
Apache License 2.0
2.15k stars 987 forks source link

Cordova replaces .storyboard files in every XCode target #1087

Closed philippmayrth closed 3 years ago

philippmayrth commented 3 years ago

Bug Report

Problem

What is expected to happen?

Cordova only touches *.storyboard files in the build target for iOS which is used by cordova itself

What does actually happen?

Cordova appears to map all *.storyboard files somehow and throw them out of the XCode config file.

Information

We have build an Apple Watch app with SwiftUI but want it to work on watchOS 6 as well so we need to include a storyboard file as entry point for the UI. During the Cordova build process (after the run and build hooks) something throws out the storyboard file of the XCode config file.

Command or Code

This can be reproduced in a fresh Cordova setup.

  1. cordova create .
  2. cordova add ios
  3. cordova run
  4. Store the generated XCode config as a reference
  5. Manually add a watchOS target in XCode (make sure it uses a storyboard file it will if its set to support watchOS 6)
  6. Compare the changes to the config file
  7. Delete the files generated by Cordova
  8. Now add the changes (from 6.) programatically with the hook
  9. cordova run
  10. Open XCode try to run the watchOS target (it will fail because there is no Interface.storyboard anymore it got removed by Cordova)

Environment, Platform, Device

macOS, iOS, not aplicable

Version information

cordova-ios: 6.2.0 XCode: 12.4 (12D4e) macOS: 11.1 (20C69)

Checklist

philippmayrth commented 3 years ago

I figured it out. The bug is not in Cordova its in the dependency its using to modify the XCode config file. I could work around it.