我不知道这是否是正确的地方要问,所以我很抱歉,如果我使用错误的部分.我们有麻烦将我们的应用程序提交给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,并且它不包含该路径中的符号链接,因此这是obviosly错误,但我找不到正在创建符号链接的构建设置/配置.
我检查了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.
解决方法
我们不得不使用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中,因此我创建了一个小型的ruby脚本,以便我们的CI添加正确的设置并避免这样做:
- 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) }