gpt4 book ai didi

ios - 旧路径在 Xcode 框架构建中仍然存在

转载 作者:行者123 更新时间:2023-11-29 02:16:06 33 4
gpt4 key购买 nike

以下脚本是聚合目标构建阶段的一部分,该阶段应该用于将模拟器和设备目标组合到一个通用框架构建中。该构建源自 this SO answer .

set -e 

FRAMEWORK_NAME="${PROJECT_NAME}"

SIMULATOR_LIBRARY_PATH="${BUILD_DIR}/${CONFIGURATION}-iphonesimulator/${FRAMEWORK_NAME}.framework"

DEVICE_LIBRARY_PATH="${BUILD_DIR}/${CONFIGURATION}-iphoneos/${FRAMEWORK_NAME}.framework"

UNIVERSAL_LIBRARY_DIR="${BUILD_DIR}/${CONFIGURATION}-iphoneuniversal"

FRAMEWORK="${UNIVERSAL_LIBRARY_DIR}/${FRAMEWORK_NAME}.framework"


######################
# Build Frameworks
######################
echo "PROJECT_NAME: ${PROJECT_NAME}"
echo "CONFIGURATION: ${CONFIGURATION}"
echo "BUILD_DIR: ${BUILD_DIR}"
echo "SIMULATOR_LIBRARY_PATH: ${SIMULATOR_LIBRARY_PATH}"
echo "DEVICE_LIBRARY_PATH: ${DEVICE_LIBRARY_PATH}"
echo "UNIVERSAL_LIBRARY_DIR: ${UNIVERSAL_LIBRARY_DIR}"

xcodebuild -project ${PROJECT_NAME}.xcodeproj -sdk iphonesimulator -target ${PROJECT_NAME} -configuration ${CONFIGURATION} clean build CONFIGURATION_BUILD_DIR=${BUILD_DIR}/${CONFIGURATION}-iphonesimulator

这是执行此脚本时遇到的第一个错误:

PROJECT_NAME: My-project_Framework
CONFIGURATION: Debug
BUILD_DIR: /Users/foouser/Library/Developer/Xcode/DerivedData/My-project_Framework-fjaslxiqhnitqxdksjbcxyuugfpk/Build/Products
SIMULATOR_LIBRARY_PATH: /Users/foouser/Library/Developer/Xcode/DerivedData/My-project_Framework-fjaslxiqhnitqxdksjbcxyuugfpk/Build/Products/Debug-iphonesimulator/My-project_Framework.framework
DEVICE_LIBRARY_PATH: /Users/foouser/Library/Developer/Xcode/DerivedData/My-project_Framework-fjaslxiqhnitqxdksjbcxyuugfpk/Build/Products/Debug-iphoneos/My-project_Framework.framework
UNIVERSAL_LIBRARY_DIR: /Users/foouser/Library/Developer/Xcode/DerivedData/My-project_Framework-fjaslxiqhnitqxdksjbcxyuugfpk/Build/Products/Debug-iphoneuniversal
Build settings from command line:
CONFIGURATION_BUILD_DIR = /Users/foouser/Library/Developer/Xcode/DerivedData/My-project_Framework-fjaslxiqhnitqxdksjbcxyuugfpk/Build/Products/Debug-iphonesimulator
SDKROOT = iphonesimulator8.1

=== CLEAN TARGET My-project_Framework OF PROJECT My-project_Framework WITH CONFIGURATION Debug ===

Check dependencies

Create product structure
/bin/mkdir -p /Users/foouser/Library/Developer/Xcode/DerivedData/My-project_Framework-fjaslxiqhnitqxdksjbcxyuugfpk/Build/Products/Debug-iphonesimulator/My-project_iOS.framework

Clean.Remove clean /Volumes/local\ my-project/my-project/ios/Framework/build/My-project_Framework.build/Debug-iphonesimulator/My-project_Framework.build
builtin-rm -rf /Volumes/local\ my-project/my-project/ios/Framework/build/My-project_Framework.build/Debug-iphonesimulator/My-project_Framework.build

Clean.Remove clean /Users/foouser/Library/Developer/Xcode/DerivedData/My-project_Framework-fjaslxiqhnitqxdksjbcxyuugfpk/Build/Products/Debug-iphonesimulator/My-project_iOS.framework
builtin-rm -rf /Users/foouser/Library/Developer/Xcode/DerivedData/My-project_Framework-fjaslxiqhnitqxdksjbcxyuugfpk/Build/Products/Debug-iphonesimulator/My-project_iOS.framework

** CLEAN SUCCEEDED **

=== BUILD TARGET My-project_Framework OF PROJECT My-project_Framework WITH CONFIGURATION Debug ===

Check dependencies
error: Unable to create directory: /Volumes/local my-project/my-project/ios/Framework/build (Permission denied)

问题来了

此挂载点 /Volumes/local my-project(带有空格)已替换/Volumes/localmy-project (没有空格)。然而 Xcode 似乎仍然在某个地方保留着旧的路径。

以下是我尝试将其从 Xcode(版本 6.1.1)中剥离出来的方法:

  1. 向脚本添加了 echo 调用,以显示 xcodebuild 的所有命令行输入。正如您所看到的,该路径不是来自命令行调用。
  2. 已清理所有目标(选择每个目标,“产品”->“清理”)。
  3. 检查了此框架项目中包含的所有文件 - 所有文件都在检查器中将 location 设置为 Relative to Project
  4. 重新启动 Xcode。
  5. 重新启动 Mac。
  6. 检查了 project.pbxproj 以及在项目包内容中找到的所有其他 XML 文件 - 找不到绝对路径。
  7. 检查检查器中的目标 - 它的位置是绝对的(无法更改)并正确指向新路径(/Volumes/localmy-project/...)
  8. 进入管理器并进入“项目”->“我的项目”->“派生数据”->“删除”。

所有这些之后,错误仍然存​​在。那么 - Xcode 从哪里获取这条旧路径?

更新

根据 @Louis Tur,我添加了以下 echo 来显示更多构建环境变量:

BUILT_PRODUCTS_DIR: /Users/foouser/Library/Developer/Xcode/DerivedData/My-Project_Framework-fjaslxiqhnitqxdksjbcxyuugfpk/Build/Products/Debug-iphoneos
CACHE_ROOT: /var/folders/w1/v31fpgnd7sl0yp5ctqjgsxsh0000gn/C/com.apple.DeveloperTools/6.1.1-6A2008a/Xcode
CONFIGURATION_BUILD_DIR: /Users/foouser/Library/Developer/Xcode/DerivedData/My-Project_Framework-fjaslxiqhnitqxdksjbcxyuugfpk/Build/Products/Debug-iphoneos
CONFIGURATION_TEMP_DIR: /Users/foouser/Library/Developer/Xcode/DerivedData/My-Project_Framework-fjaslxiqhnitqxdksjbcxyuugfpk/Build/Intermediates/My-Project_Framework.build/Debug-iphoneos
SYMROOT: /Users/foouser/Library/Developer/Xcode/DerivedData/My-Project_Framework-fjaslxiqhnitqxdksjbcxyuugfpk/Build/Products

更新2 - 现在有更多回声!

DEPLOYMENT_LOCATION: NO
DERIVED_FILE_DIR: /Users/foouser/Library/Developer/Xcode/DerivedData/My-project_Framework-fjaslxiqhnitqxdksjbcxyuugfpk/Build/Intermediates/My-project_Framework.build/Debug-iphoneos/My-project_Framework_Universal.build/DerivedSources
DSTROOT: /tmp/My-project_Framework.dst
INSTALL_DIR: /tmp/My-project_Framework.dst
INSTALL_PATH:
OBJECT_FILE_DIR: /Users/foouser/Library/Developer/Xcode/DerivedData/My-project_Framework-fjaslxiqhnitqxdksjbcxyuugfpk/Build/Intermediates/My-project_Framework.build/Debug-iphoneos/My-project_Framework_Universal.build/Objects
OBJECT_FILE_DIR_normal: /Users/foouser/Library/Developer/Xcode/DerivedData/My-project_Framework-fjaslxiqhnitqxdksjbcxyuugfpk/Build/Intermediates/My-project_Framework.build/Debug-iphoneos/My-project_Framework_Universal.build/Objects-normal
OBJECT_FILE_DIR_debug:
OBJROOT: /Users/foouser/Library/Developer/Xcode/DerivedData/My-project_Framework-fjaslxiqhnitqxdksjbcxyuugfpk/Build/Intermediates
PROJECT_TEMP_DIR: /Users/foouser/Library/Developer/Xcode/DerivedData/My-project_Framework-fjaslxiqhnitqxdksjbcxyuugfpk/Build/Intermediates/My-project_Framework.build
REZ_COLLECTOR_DIR: /Users/foouser/Library/Developer/Xcode/DerivedData/My-project_Framework-fjaslxiqhnitqxdksjbcxyuugfpk/Build/Intermediates/My-project_Framework.build/Debug-iphoneos/My-project_Framework_Universal.build/ResourceManagerResources
REZ_OBJECTS_DIR: /Users/foouser/Library/Developer/Xcode/DerivedData/My-project_Framework-fjaslxiqhnitqxdksjbcxyuugfpk/Build/Intermediates/My-project_Framework.build/Debug-iphoneos/My-project_Framework_Universal.build/ResourceManagerResources/Objects
SHARED_PRECOMPS_DIR: /Users/foouser/Library/Developer/Xcode/DerivedData/My-project_Framework-fjaslxiqhnitqxdksjbcxyuugfpk/Build/Intermediates/PrecompiledHeaders
SRCROOT: /Volumes/localmy-project/my-project/ios/Framework
TARGET_BUILD_DIR: /Users/foouser/Library/Developer/Xcode/DerivedData/My-project_Framework-fjaslxiqhnitqxdksjbcxyuugfpk/Build/Products/Debug-iphoneos
TARGET_TEMP_DIR: /Users/foouser/Library/Developer/Xcode/DerivedData/My-project_Framework-fjaslxiqhnitqxdksjbcxyuugfpk/Build/Intermediates/My-project_Framework.build/Debug-iphoneos/My-project_Framework_Universal.build

这些仍然没有指向旧路径..

最佳答案

我遇到了这个问题,并通过在 Xcode 首选项中重置派生数据文件夹的位置来解决。设置后,我退出 Xcode 并重新启动。它解决了。

关于ios - 旧路径在 Xcode 框架构建中仍然存在,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28733122/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com