Skip to main content

原生错误

代码签名错误

¥Code Signing errors

Code Signing Error: Failed to create provisioning profile. The app ID "com.csform.ionic.yellow" cannot be registered to your development team. Change your bundle identifier to a unique string to try again. Code Signing Error: No profiles for 'com.csform.ionic.yellow' were found: Xcode couldn't find any iOS App Development provisioning profiles matching 'com.csform.ionic.yellow'. Code Signing Error: Code signing is required for product type 'Application' in SDK 'iOS 11.1'

在 iOS 设备上运行应用需要配置文件。如果尚未创建配置文件,请按照以下说明操作:

¥Running an app on an iOS device requires a provisioning profile. If a provisioning profile has not been created yet follow these directions:

  1. 设置 封装 ID

    ¥Set the Package ID.

    对于 Capacitor,打开 capacitor.config.json 文件并修改 appId 属性。

    ¥For Capacitor, open the capacitor.config.json file and modify the appId property.

    对于 Cordova,打开 config.xml 文件并修改根元素 <widget>id 属性。请参阅 Cordova 文档 了解更多信息。

    ¥For Cordova, open the config.xml file and modify the id attribute of the root element, <widget>. See the Cordova documentation for more information.

  1. Xcode 中打开项目。

    ¥Open the project in Xcode.

    对于 Capacitor,运行以下命令在 Xcode 中打开应用:

    ¥For Capacitor, run the following to open the app in Xcode:

    $ ionic capacitor open ios

    对于 Cordova,打开 Xcode。使用文件»打开并找到该应用。打开应用的 platforms/ios 目录。

    ¥For Cordova, open Xcode. Use File » Open and locate the app. Open the app's platforms/ios directory.

  1. 项目导航器中,选择项目根以打开项目编辑器。在“身份”部分下,验证设置的包 ID 是否与打包包标识符匹配。

    ¥In Project navigator, select the project root to open the project editor. Under the Identity section, verify that the Package ID that was set matches the Bundle Identifier.

Xcode showing the Identity section for an iOS app with fields for Display Name, Bundle Identifier, Version, and Build.

  1. 在同一项目编辑器的签名部分下,确保启用自动管理签名然后,选择一个开发团队。给定一个开发团队,Xcode 将尝试自动准备配置和签名。

    ¥In the same project editor, under the Signing section, ensure Automatically manage signing is enabled. Then, select a Development Team. Given a Development Team, Xcode will attempt to automatically prepare provisioning and signing.

Xcode showing the Signing section with &#39;Automatically manage signing&#39; enabled and a Development Team selected.

Xcode 构建错误 65

¥Xcode build error 65

Error: Error code 65 for command: xcodebuild with args: -xcconfig,/Users/ionitron/projects/my-project/platforms/ios/cordova/build-debug.xcconfig,-workspace,SC project.xcworkspace,-scheme,SC project,-configuration,Debug,-sdk,iphonesimulator,-destination,platform=iOS Simulator,name=iPhone X,build,CONFIGURATION_BUILD_DIR=/Users/ionitron/projects/my-project/platforms/ios/build/emulator,SHARED_PRECOMPS_DIR=/Users/ionitron/projects/my-project/platforms/ios/build/sharedpch

此错误是来自 Xcode 的错误代码,可能是由配置问题或过时的 cordova 依赖引起的。要修复此错误,请首先确保已使用上述说明生成配置文件,然后尝试 从 Xcode 运行应用

¥This error is an error code from Xcode that can be caused by provisioning issues or outdated cordova dependencies. To fix this error first make sure a provisioning profile has been generated using the above instructions and then try to run the app from Xcode.

如果这不能修复错误,则运行以下命令:

¥If this does not fix the error then run the following commands:

rm -rf node_modules
rm -rf platform
npm i
ionic cordova platform add ios
ionic cordova prepare ios
ionic cordova build ios --prod

一旦运行这些命令,就可以完成新的构建。

¥Once these commands have been ran a fresh build can be done.

Google Play 服务版本冲突

¥Clashing Google Play Services versions

Error: more than one library with package name com.google.android.gms

此错误是由两个单独的插件尝试使用不同版本的 Google Play Services。要解决此问题,请确保你运行的是 cordova 版本 7.1.0 或更高版本以及 cordova-android 6.3.0 或更高版本。要安装最新的 cordova,请运行:

¥This error is caused by two separate plugins trying to use different versions of the Google Play Services. To fix this issue make sure you are running cordova version 7.1.0 or higher and cordova-android 6.3.0 or higher. To install latest cordova run:

npm install cordova@latest

并更新 cordova-android 运行:

¥and to update cordova-android run:

cordova platform update android

依赖于 Google Play Services 的插件现在可以更新为使用相同的版本。例如,如果 pluginA 使用版本 11.0,pluginB 使用版本 15.0,则可以将它们更新为使用相同版本,并在 config.xml 文件中添加以下代码片段:

¥Plugins that depend on Google Play Services can now be updated to use the same version. For example, if pluginA uses version 11.0 and pluginB uses version 15.0 they can be updated to use the same version with the following snippet in the config.xml file:

<plugin name="pluginA" spec="npm">
<variable name="PLAY_SERVICES_VERSION" value="15.0.0"/>
</plugin>
<plugin name="pluginB" spec="npm">
<variable name="PLAY_SERVICES_VERSION" value="15.0.0" />
</plugin>