我不确定这是否是正确的问题,所以如果我使用了错误的部分,我很抱歉。我们将应用程序提交到iTunes Connect时遇到了麻烦,我们收到的电子邮件说:
Invalid Symlink - Your package contains a symbolic link 'PlugIns/$REDACTED_WATCHKIT_EXTENSION_TARGET_NAME$.appex/$REDACTED_WATCHKIT_EXTENSION_TARGET_NAME$.appex' which resolves to a location '/Users/$REDACTED_USER$/Library/Developer/Xcode/DerivedData/Seta-ctfzptralingvtbxhssdlkkzkclw/Build/Intermediates/ArchiveIntermediates/Seta/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/$REDACTED_WATCHKIT_EXTENSION_TARGET_NAME$.appex' that does not exist or is outside of the package.
我尝试使用与项目相同的设置创建一个空白Xcode项目来重现错误,但我无法从iTunes Connect获得相同的错误。有没有人知道为什么要创建符号链接?我检查了空白的项目.ipa,它在该路径中没有包含那个符号链接,所以这显然是错误的,但我找不到创建符号链接的构建设置/配置。
我检查了xcodebuild输出,我发现了这个:
SymLink build/SetaWatchKitExtension.appex /Users/$REDACTED_USER$/Library/Developer/Xcode/DerivedData/Seta-ctfzptralingvtbxhssdlkkzkclw/Build/Intermediates/ArchiveIntermediates/Seta/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/SetaWatchKitExtension.appex
cd $REDACTED_PROJECT_PATH$
export PATH="/Applications/Xcode-7.1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode-7.1.app/Contents/Developer/usr/bin:$REDACTED_PATH_ENV_VARIABLE$"
/bin/ln -sfh /Users/$REDACTED_USER$/Library/Developer/Xcode/DerivedData/Seta-ctfzptralingvtbxhssdlkkzkclw/Build/Intermediates/ArchiveIntermediates/Seta/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/$REDACTED_WATCHKIT_EXTENSION_TARGET_NAME$.appex /Users/$REDACTED_USER$/Documents/$REDACTED_PATH$/build/$REDACTED_WATCHKIT_EXTENSION_TARGET_NAME$.appex
这似乎很好,但不知何故,符号链接最终在.ipa里面是错误的。这是在创建产品结构之后和在Watchkit扩展构建目标步骤期间CompileSwiftSources之前发生的。
非常感谢任何提示或帮助。我正在使用Xcode 7.1。
答案 0 :(得分:2)
我们必须使用DTS票,我们收到了Apple的以下回复:
Thank you for contacting Apple Developer Technical Support (DTS).
The issue seems to happen when you pass CONFIGURATION_BUILD_DIR=$PWD/build to the xcodebuild command. Instead, try removing CONFIGURATION_BUILD_DIR from the xcodebuild command, and instead, change your build location in your Workspace settings. Follow these steps:
1. In the xcodebuild command, remove CONFIGURATION_BUILD_DIR=$PWD/build
2. Open your Workspace in Xcode
3. Select File > Workspace Settings
4. Click the Advanced button
5. Select Custom > Relative to Workspace
6. Click the Done buttons
This will cause the build products to still go in your build directory, and the symlink in the WatchKit Extension is no longer created.
可行的是,令人遗憾的是,这些设置无法通过命令行工具应用,Xcode正在以下路径中创建文件:
Project.workspace/xcuserdata/$USER.xcuserdatad/WorkspaceSettings.xcsettings
显然,您不想将该路径添加到VCS中,因此我为CI创建了一个小的ruby脚本,以添加正确的设置并避免这种情况:
settingsFilePath = "#{ENV["PWD"]}/Project.xcworkspace/xcuserdata/#{ENV["USER"]}.xcuserdatad"
FileUtils.mkpath(settingsFilePath)
settings = {'BuildLocationStyle' => 'CustomLocation', 'CustomBuildIntermediatesPath' => 'Build/Intermediates', 'CustomBuildLocationType' => 'RelativeToWorkspace', 'CustomBuildProductsPath' => 'Build/Products'}
File.open("#{settingsFilePath}/WorkspaceSettings.xcsettings", 'w') { |file| file.write(settings.to_plist) }
答案 1 :(得分:0)
尝试直接打开你的.xcarchive文件(window-> organizer->选择存档 - >右击 - >在finder中显示)。
找到任何符号链接并尝试理解它们出现在那里的原因。
这可能是与cocoapods相关的问题(如果您使用的是pod)。尝试更新cocoapods。