xcode 我的 iOS 8 框架是否需要自己的代码签名才能分发?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/28731267/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 06:43:35  来源:igfitidea点击:

Does my iOS 8 framework need its own code signing for distribution?

iosxcode

提问by brodeo

I am trying to upload my iOS 8 app to the app store for distribution. My app contains a framework created with Xcode 6. I am getting the following provisioning profile error from the uploader tool.

我正在尝试将我的 iOS 8 应用程序上传到应用程序商店进行分发。我的应用程序包含一个使用 Xcode 6 创建的框架。我从上传工具收到以下配置文件错误。

"ERROR ITMS-90161: Invalid Provisioning Profile. The provisioning profile included in the bundle com.auraishere.AuraClient [Payload/hipgroup.app/Frameworks/AuraCore.framework] is invalid. Missing code-signing certificate."

“错误 ITMS-90161:配置文件无效。com.auraishere.AuraClient [Payload/hipgroup.app/Frameworks/AuraCore.framework] 包中包含的配置文件无效。缺少代码签名证书。”

The archiving works fine and I am using a freshly created distribution certificate and profile for both the target and the project. The app id is specific to the bundle name and not a wildcard one.

归档工作正常,我正在为目标和项目使用新创建的分发证书和配置文件。应用程序 ID 特定于包名称,而不是通配符。

The framework compiles in a separate framework project successfully using a different organisation's development certificate. Do I need to compile it using a distribution certificate for that organisation or is that not necessary?

该框架使用不同组织的开发证书在单独的框架项目中成功编译。我是否需要使用该组织的分发证书来编译它,还是没有必要?

I have a script that creates a fat binary using the lipo tool to support multiple architectures and copies the fat binary to my app's project folder. I don't think this is the problem but I have included it in case.

我有一个脚本,它使用 lipo 工具创建一个胖二进制文件以支持多种架构,并将胖二进制文件复制到我的应用程序的项目文件夹中。我不认为这是问题所在,但我已将其包括在内。

# define output folder environment variable
UNIVERSAL_OUTPUTFOLDER=${BUILD_DIR}/${CONFIGURATION}-universal

# Build framework for iPhoneOS
xcodebuild -target AuraCore ONLY_ACTIVE_ARCH=NO -configuration ${CONFIGURATION} -sdk iphoneos  BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}"

# Build framework for iPhoneSimulator
xcodebuild -target AuraCore -configuration ${CONFIGURATION} -sdk iphonesimulator -arch i386 BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}"

mkdir -p "${UNIVERSAL_OUTPUTFOLDER}"

# Build the universal library
lipo -create -output "${UNIVERSAL_OUTPUTFOLDER}/${PROJECT_NAME}" "${BUILD_DIR}/${CONFIGURATION}-iphoneos/${PROJECT_NAME}.framework/${PROJECT_NAME}" "${BUILD_DIR}/${CONFIGURATION}-iphonesimulator/${PROJECT_NAME}.framework/${PROJECT_NAME}"

# Copy the .framework folder of iphoneos
cp -R "${BUILD_DIR}/${CONFIGURATION}-iphoneos/${PROJECT_NAME}.framework" "${UNIVERSAL_OUTPUTFOLDER}/"

# Delete the library for iphoneos
rm "${UNIVERSAL_OUTPUTFOLDER}/${PROJECT_NAME}.framework/${PROJECT_NAME}"

# Move the Universal Library into our framework
mv "${UNIVERSAL_OUTPUTFOLDER}/${PROJECT_NAME}" "${UNIVERSAL_OUTPUTFOLDER}/${PROJECT_NAME}.framework/"

# Copy the framework
cp -R "${UNIVERSAL_OUTPUTFOLDER}/${PROJECT_NAME}.framework" "${PROJECT_DIR}"
rm -Rf "${PROJECT_DIR}/../../aura-ios-demo/{PROJECT_NAME}.framework"
cp -Rf "${UNIVERSAL_OUTPUTFOLDER}/${PROJECT_NAME}.framework" "${PROJECT_DIR}/../../aura-ios-demo"

if [ -d "${PROJECT_DIR}/../../concierge" ]; then
    echo "dir exsits"
# Copy the framework
cp -R "${UNIVERSAL_OUTPUTFOLDER}/${PROJECT_NAME}.framework" "${PROJECT_DIR}"
rm -Rf "${PROJECT_DIR}/../../concierge/{PROJECT_NAME}.framework"
cp -Rf "${UNIVERSAL_OUTPUTFOLDER}/${PROJECT_NAME}.framework" "${PROJECT_DIR}/../../concierge"
fi

Any help would be much appreciated. Thanks.

任何帮助将非常感激。谢谢。

回答by ingaham

Regarding thisdeveloper forum thread: "Frameworks do need to be code signed but Xcode takes care of this for you. They don't need any extra profiles or app ID to run. The only thing you need to do in order to use them is to ensure they are copied properly during the build process with the extra build phase."

关于这个开发者论坛帖子:“框架确实需要代码签名,但 Xcode 会为你处理这个问题。他们不需要任何额外的配置文件或应用程序 ID 来运行。为了使用它们,你唯一需要做的就是以确保在构建过程中使用额外的构建阶段正确复制它们。”

Is the "Code Sign On Copy" box checked in the build phase?

在构建阶段是否选中了“Code Sign On Copy”框?

enter image description here

在此处输入图片说明