Nativescript 无法在设备上应用更改(xcodebuild 失败,退出代码为 65)

Nativescript Unable to apply changes on device (xcodebuild failed with exit code 65)

我正在开发一个 NS8/Angular11 应用程序,我得到了一个新的 iPhone 11,我想对其进行测试。但是,我 运行 陷入 ARCHIVE FAILED 错误并且不知道如何解决它。我可以在模拟器上工作没问题,但现在在我的 iPhone 上。当我插入我的电脑时,我确定它没有被锁定。

我尝试了一些解决方案,例如删除我的 ios 平台并重新安装它,但没有任何效果。

我还确保在 Apple Developer 帐户上创建了一个移动配置文件,并将其下载到我的计算机上。然后我点击了它,Xcode 它自己打开了。

XCODE 版本:12.15.1

iOS 版本:14.6

我不断收到以下错误。

2021-07-28 18:21:41.419 xcodebuild[9792:271798] CFURLRequestSetHTTPCookieStorageAcceptPolicy_block_invoke: no longer implemented and should not be called
2021-07-28 18:21:41.785 xcodebuild[9792:271798]  DVTPortal: Service '<DVTPortalViewDeveloperService: 0x7f94de516f50; action='viewDeveloper'>' encountered an unexpected result code from the portal ('1100')
2021-07-28 18:21:41.785 xcodebuild[9792:271798]  DVTPortal: Error:
Error Domain=DVTPortalServiceErrorDomain Code=1100 "Your session has expired. Please log in." UserInfo={payload={
    creationTimestamp = "2021-07-29T01:21:41Z";
    httpCode = 200;
    protocolVersion = XXXXXX;
    requestUrl = "https://developerservices2.apple.com/services/XXXXXX/viewDeveloper.action";
    responseId = "4e32c964-e200-4667-b776-d33a143ee9a1";
    resultCode = 1100;
    resultString = "Your session has expired. Please log in.";
    userLocale = "en_US";
    userString = "Your session has expired. Please log in.";
}, NSLocalizedDescription=Your session has expired. Please log in.}
2021-07-28 18:21:42.415 xcodebuild[9792:271666]  DVTPortal: Service '<DVTPortalViewDeveloperService: 0x7f94ddd26d80; action='viewDeveloper'>' encountered an unexpected result code from the portal ('1100')
2021-07-28 18:21:42.415 xcodebuild[9792:271666]  DVTPortal: Error:
Error Domain=DVTPortalServiceErrorDomain Code=1100 "Your session has expired. Please log in." UserInfo={payload={
    creationTimestamp = "2021-07-29T01:21:42Z";
    httpCode = 200;
    protocolVersion = XXXXXX;
    requestUrl = "https://developerservices2.apple.com/services/XXXXXX/viewDeveloper.action";
    responseId = "2c1ea44f-fdf4-4fe7-bf08-2bf199a88aeb";
    resultCode = 1100;
    resultString = "Your session has expired. Please log in.";
    userLocale = "en_US";
    userString = "Your session has expired. Please log in.";
}, NSLocalizedDescription=Your session has expired. Please log in.}
2021-07-28 18:21:42.676 xcodebuild[9792:271829]  DVTPortal: Service '<DVTPortalViewDeveloperService: 0x7f94df0a1a30; action='viewDeveloper'>' encountered an unexpected result code from the portal ('1100')
2021-07-28 18:21:42.677 xcodebuild[9792:271829]  DVTPortal: Error:
Error Domain=DVTPortalServiceErrorDomain Code=1100 "Your session has expired. Please log in." UserInfo={payload={
    creationTimestamp = "2021-07-29T01:21:42Z";
    httpCode = 200;
    protocolVersion = QH65B2;
    requestUrl = "https://developerservices2.apple.com/services/XXXXXX/viewDeveloper.action";
    responseId = "d7a65c3d-ef9c-4eba-b6e2-3aef97954652";
    resultCode = 1100;
    resultString = "Your session has expired. Please log in.";
    userLocale = "en_US";
    userString = "Your session has expired. Please log in.";
}, NSLocalizedDescription=Your session has expired. Please log in.}
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Analyzing workspace
note: Constructing build description
note: Build preparation complete
.../platforms/ios/Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.5.99. (in target 'FirebaseRemoteConfig' from project 'Pods')

...

** ARCHIVE FAILED **

Unable to apply changes on device: 00008030-001E60393AD1402E. Error is: Command xcodebuild failed with exit code 65.

下面是我的package.json

"dependencies": {
    "@angular/animations": "~11.2.7",
    "@angular/cdk": "~11.2.7",
    "@angular/common": "~11.2.7",
    "@angular/compiler": "~11.2.7",
    "@angular/core": "~11.2.7",
    "@angular/forms": "~11.2.7",
    "@angular/material": "~11.2.7",
    "@angular/platform-browser": "~11.2.7",
    "@angular/platform-browser-dynamic": "~11.2.7",
    "@angular/router": "~11.2.7",
    "@bradmartin/nativescript-urlhandler": "^2.0.1",
    "@mhtghn/nativescript-highcharts": "^1.0.2",
    "@nativescript-community/ble": "^3.0.25",
    "@nativescript-community/insomnia": "^2.0.2",
    "@nativescript-community/ui-chart": "^1.1.38",
    "@nativescript-community/ui-drawer": "0.0.28",
    "@nativescript/angular": "~11.8.0",
    "@nativescript/core": "^8.0.8",
    "@nativescript/firebase": "^11.1.3",
    "@nativescript/theme": "~3.0.1",
    "@sentry/node": "6.8.0",
    "@triniwiz/nativescript-toasty": "~4.1.3",
    "bluebird": "3.5.5",
    "crypto-es": "^1.2.7",
    "nativescript-purchase": "^2.0.14",
    "nativescript-sentry": "^2.0.1",
    "nativescript-ui-chart": "^8.0.2",
    "nativescript-ui-gauge": "^7.0.2",
    "nativescript-ui-sidedrawer": "~9.0.3",
    "npm-check-updates": "^11.8.3",
    "reflect-metadata": "^0.1.13",
    "rxjs": "~6.6.7",
    "zone.js": "~0.11.4"
  },
  "devDependencies": {
    "@angular/compiler-cli": "~11.2.7",
    "@nativescript/android": "8.0.0",
    "@nativescript/ios": "8.0.0",
    "@nativescript/types": "~8.0.0",
    "@nativescript/webpack": "~5.0.0-beta.0",
    "@ngtools/webpack": "^11.2.14",
    "sass": "~1.35.1",
    "ts-node": "~10.0.0",
    "typescript": "~4.0.0"
  },

下面是我的 tns 医生的输出

✔ Your ANDROID_HOME environment variable is set and points to correct directory.
✔ Your adb from the Android SDK is correctly installed.
✔ The Android SDK is installed.
✔ A compatible Android SDK for compilation is found.
✔ Javac is installed and is configured properly.
✔ The Java Development Kit (JDK) is installed and is configured properly.
✔ Xcode is installed and is configured properly.
✔ xcodeproj is installed and is configured properly.
✔ CocoaPods are installed.
✔ CocoaPods update is not required.
✔ CocoaPods are configured properly.
✔ Your current CocoaPods version is newer than 1.0.0.
✔ Python installed and configured correctly.
✔ The Python 'six' package is found.
✔ Xcode version 12.5.1 satisfies minimum required version 10.
✔ Getting NativeScript components versions information...
✔ Component nativescript has 8.0.2 version and is up to date.
✔ Component @nativescript/core has 8.0.8 version and is up to date.
✔ Component @nativescript/ios has 8.0.0 version and is up to date.
✔ Component @nativescript/android has 8.0.0 version and is up to date.

所以最终的工作是删除我拥有的制作不佳的 .entitlements 文件。在那个权利文件中,我有

<key>com.apple.keystore.access-keychain-keys</key>
<true/>
<key>com.apple.keystore.device</key>
<true/>

我可能用错误的名称创建了授权文件。我删除了这个文件,运行 ns cleantns build ios,然后 运行 通过 Xcode 应用程序并且它工作了。

此线程中也提到了此解决方案: https://github.com/EddyVerbruggen/nativescript-plugin-firebase/issues/1542

这是帮助我的东西

  • XCODE 13.3.1
  • NativeScript 8.0.2 客户端
  • 平台IOS“6.5.2”

第 1 步(build.xcconfig)

// xcode 13
EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64=arm64 arm64e armv7 armv7s armv6 armv8
EXCLUDED_ARCHS=$(inherited)
$(EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_$(EFFECTIVE_PLATFORM_SUFFIX)__NATIVE_ARCH_64_BIT_$(NATIVE_ARCH_64_BIT))

IPHONEOS_DEPLOYMENT_TARGET = 12.0

第 2 步(播客文件)

pod 'CocoaAsyncSocket'

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'
      config.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = 'arm64'
      config.build_settings['CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER'] ='NO'
      config.build_settings['ONLY_ACTIVE_ARCH'] = 'YES'
    end
  end
end

IPHONEOS_DEPLOYMENT_TARGET = 12.0