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

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

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

  2. Xcode 中打开项目。

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

    $ ionic capacitor open ios

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

  3. Project navigator中,选择项目根目录以打开项目编辑器。在身份部分,验证所设置的包ID是否与打包标识符匹配。

    Xcode 显示 iOS 应用的身份部分,其中包含显示名称、打包标识符、版本和构建字段。

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

    Xcode 显示已启用“自动管理签名”并选择了开发团队的签名部分。

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>