Closed dpolivy closed 9 months ago
Ugh, this is what happens when you let Xcode touch project files 😩
I see most things with path
, a few with name
, and even some with both path
and name
. I think it makes sense to convert those few top-level files (by hand!) to use path
for consistency.
Awesome, thanks for the prompt response to this! On the surface your fix looks good to me. What's the path to release for this? Is there a point release of cordova-ios
scheduled anytime soon?
Bug Report
Problem
I have an
after_prepare
hook that adds a new build phase to the Xcode project file. This worked fine oncordova-ios
up to v6.3.0 but now fails on 7.0.0. While this may be a bug incordova-node-xcode
, it is exposed by changes to the project file incordova-ios
. I'm not sure if the project template structure can be adjusted to resolve this? It seems that some elements (e.g.Assets.xcassets
) are now missing apath
variable which is causing an exception in theaddBuildPhase
function.What is expected to happen?
After adding the hook and running
cordova prepare ios
, the build phase should get added to the project file.What does actually happen?
Information
The issue is related to two assets in the project file:
Assets.xcassets
andCDVLaunchScreen.storyboard
are missing apath
parameter incordova-ios@7
:For example, this line: https://github.com/apache/cordova-ios/blob/master/templates/project/__PROJECT_NAME__.xcodeproj/project.pbxproj#L61
Should be modified to include a path variable like so: 0207DA571B56EA530066E2B4 / Assets.xcassets / = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Project/Assets.xcassets; sourceTree = ""; };
Command or Code
cordova create . com.test.app Test
afterprepare.js
:Add the following to
config.xml
:<hook type="after_prepare" src="afterprepare.js" />
Add the ios platform:
cordova platform add ios
Environment, Platform, Device
cordova-ios@7
Version information
Cordova CLI 12 cordova-ios 7
Checklist