nativescript-cli: Cant build since Xcode 10
Did you verify this is a real problem by searching the [NativeScript Forum]
Found a related issue: https://stackoverflow.com/questions/52340033/xcodebuild-failed-exit-code-65-ios
Tell us about the problem
After updating to Xcode 10 (today), my tns run ios --log trace fails on the xcode build step with:
stderr:
spawn: xcodebuild "archive" "-archivePath" "./platforms/ios/build/archive/ourApp.xcarchive" "-configuration" "Debug" "-workspace" "./platforms/ios/ourApp.xcworkspace" "-scheme" "ourApp" "SHARED_PRECOMPS_DIR=./platforms/ios/build/sharedpch" "ARCHS=arm64" "VALID_ARCHS=arm64" "-sdk" "iphoneos" "CONFIGURATION_BUILD_DIR=./platforms/ios/build/device" "-allowProvisioningUpdates"
User defaults from command line:
IDEArchivePathOverride = ./platforms/ios/build/archive/ourApp.xcarchive
Build settings from command line:
ARCHS = arm64
CONFIGURATION_BUILD_DIR = ./platforms/ios/build/device
SDKROOT = iphoneos12.0
SHARED_PRECOMPS_DIR = ./platforms/ios/build/sharedpch
VALID_ARCHS = arm64
note: Using new build system
note: Planning build
note: Constructing build description
Build system information
error: unexpected duplicate task: CodeSign <my-user>/Library/Developer/Xcode/DerivedData/ourApp-axpwxekjlqemgxhcqrekmksxyout/Build/Intermediates.noindex/ArchiveIntermediates/ourApp/InstallationBuildProductsLocation/Applications/ourApp.app/Frameworks/TNSCore.framework (in target 'ourApp')
Build system information
error: unexpected duplicate task: CodeSign <my-user>/Library/Developer/Xcode/DerivedData/ourApp-axpwxekjlqemgxhcqrekmksxyout/Build/Intermediates.noindex/ArchiveIntermediates/ourApp/InstallationBuildProductsLocation/Applications/ourApp.app/Frameworks/TNSCore.framework (in target 'ourApp')
Build system information
error: Multiple commands produce '<my-user>/Library/Developer/Xcode/DerivedData/ourApp-axpwxekjlqemgxhcqrekmksxyout/Build/Intermediates.noindex/ArchiveIntermediates/ourApp/InstallationBuildProductsLocation/Applications/ourApp.app/Frameworks/TNSCore.framework/TNSCore':
1) Target 'ourApp' has copy command from './node_modules/nativescript-ui-core/platforms/ios/TNSCore.framework' to '<my-user>/Library/Developer/Xcode/DerivedData/ourApp-axpwxekjlqemgxhcqrekmksxyout/Build/Intermediates.noindex/ArchiveIntermediates/ourApp/InstallationBuildProductsLocation/Applications/ourApp.app/Frameworks/TNSCore.framework'
2) Target 'ourApp' has copy command from './node_modules/nativescript-ui-listview/node_modules/nativescript-ui-core/platforms/ios/TNSCore.framework' to '<my-user>/Library/Developer/Xcode/DerivedData/ourApp-axpwxekjlqemgxhcqrekmksxyout/Build/Intermediates.noindex/ArchiveIntermediates/ourApp/InstallationBuildProductsLocation/Applications/ourApp.app/Frameworks/TNSCore.framework'
Build system information
error: Multiple commands produce '<my-user>/Library/Developer/Xcode/DerivedData/ourApp-axpwxekjlqemgxhcqrekmksxyout/Build/Intermediates.noindex/ArchiveIntermediates/ourApp/InstallationBuildProductsLocation/Applications/ourApp.app/Frameworks/TNSCore.framework':
1) Target 'ourApp' has copy command from './node_modules/nativescript-ui-core/platforms/ios/TNSCore.framework' to '<my-user>/Library/Developer/Xcode/DerivedData/ourApp-axpwxekjlqemgxhcqrekmksxyout/Build/Intermediates.noindex/ArchiveIntermediates/ourApp/InstallationBuildProductsLocation/Applications/ourApp.app/Frameworks/TNSCore.framework'
2) Target 'ourApp' has copy command from './node_modules/nativescript-ui-listview/node_modules/nativescript-ui-core/platforms/ios/TNSCore.framework' to '<my-user>/Library/Developer/Xcode/DerivedData/ourApp-axpwxekjlqemgxhcqrekmksxyout/Build/Intermediates.noindex/ArchiveIntermediates/ourApp/InstallationBuildProductsLocation/Applications/ourApp.app/Frameworks/TNSCore.framework'
Build system information
warning: duplicate output file '<my-user>/Library/Developer/Xcode/DerivedData/ourApp-axpwxekjlqemgxhcqrekmksxyout/Build/Intermediates.noindex/ArchiveIntermediates/ourApp/InstallationBuildProductsLocation/Applications/ourApp.app/Frameworks/TNSCore.framework' on task: PBXCp ./node_modules/nativescript-ui-listview/node_modules/nativescript-ui-core/platforms/ios/TNSCore.framework <my-user>/Library/Developer/Xcode/DerivedData/ourApp-axpwxekjlqemgxhcqrekmksxyout/Build/Intermediates.noindex/ArchiveIntermediates/ourApp/InstallationBuildProductsLocation/Applications/ourApp.app/Frameworks/TNSCore.framework (in target 'ourApp')
Build system information
warning: duplicate output file '<my-user>/Library/Developer/Xcode/DerivedData/ourApp-axpwxekjlqemgxhcqrekmksxyout/Build/Intermediates.noindex/ArchiveIntermediates/ourApp/InstallationBuildProductsLocation/Applications/ourApp.app/Frameworks/TNSCore.framework/TNSCore' on task: PBXCp ./node_modules/nativescript-ui-listview/node_modules/nativescript-ui-core/platforms/ios/TNSCore.framework <my-user>/Library/Developer/Xcode/DerivedData/ourApp-axpwxekjlqemgxhcqrekmksxyout/Build/Intermediates.noindex/ArchiveIntermediates/ourApp/InstallationBuildProductsLocation/Applications/ourApp.app/Frameworks/TNSCore.framework (in target 'ourApp')
Build system information
warning: duplicate output file '' on task: PBXCp ./node_modules/nativescript-ui-listview/node_modules/nativescript-ui-core/platforms/ios/TNSCore.framework <my-user>/Library/Developer/Xcode/DerivedData/ourApp-axpwxekjlqemgxhcqrekmksxyout/Build/Intermediates.noindex/ArchiveIntermediates/ourApp/InstallationBuildProductsLocation/Applications/ourApp.app/Frameworks/TNSCore.framework (in target 'ourApp')
Command xcodebuild failed with exit code 65
Unable to apply changes on device: a1f50f93c3c6c8473b2ce8a5ceafe1ddbd5cb753. Error is: Command xcodebuild failed with exit code 65.
(I’ve anonymized the output)
I have the entire trace log output if anyone needs it.
Not sure if the error could be related to having the xcode update run in the background, while xcodebuild being used from the commandline. I’ve tried doing a tns update, but it didn’t fix the issue.
Which platform(s) does your issue occur on?
MacOS 10.13.6 (High Sierra)
Please provide the following version numbers that your issue occurs with:
- CLI: 4.2.3
- Cross-platform modules: 4.2.0
- Runtime(s): 4.2.0 & 4.2.0
- Plugin(s):
"dependencies": {
"@angular/animations": "~6.1.0",
"@angular/common": "~6.1.0",
"@angular/compiler": "~6.1.0",
"@angular/core": "~6.1.0",
"@angular/forms": "~6.1.0",
"@angular/http": "~6.1.0",
"@angular/platform-browser": "~6.1.0",
"@angular/platform-browser-dynamic": "~6.1.0",
"@angular/router": "~6.1.0",
"@ngx-translate/core": "^10.0.2",
"nativescript-angular": "^6.1.0",
"nativescript-plugin-firebase": "^6.8.1",
"nativescript-theme-core": "~1.0.4",
"nativescript-ui-listview": "^3.6.1",
"nativescript-ui-sidedrawer": "~4.2.0",
"reflect-metadata": "~0.1.10",
"rxjs": "^6.3.2",
"tns-core-modules": "^4.2.0",
"zone.js": "~0.8.18"
},
"devDependencies": {
"@angular/compiler-cli": "~6.1.0",
"@nativescript/schematics": "~0.2.5",
"@ngtools/webpack": "~6.2.0",
"codelyzer": "~4.3.0",
"nativescript-dev-sass": "~1.6.0",
"nativescript-dev-typescript": "~0.7.0",
"nativescript-dev-webpack": "~0.16.0",
"tns-platform-declarations": "^4.2.0",
"tslint": "~5.11.0",
"typescript": "~2.7.2"
},
Please tell us how to recreate the issue in as much detail as possible.
Not sure how to recreate if it doesn’t fail on a fresh upgrade of xcode 10 in your end.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 6
- Comments: 66 (26 by maintainers)
Yes, that fixes it. I managed to reproduce the error with your versions, and it got fixed after upgrading. It seems that the old build system has tolerated this inconsistency and has silently selected one of the 2 frameworks, while the new one is stricter and treats this as an error.
It seems that I spoke too fast – ListView is already the latest but SideDrawer is not. I suggest you upgrade it as well.
Hi @larssn, looking at this error I can see that there are multiple
TNSCore.frameworks in younode_modulesdirectory:Probably this is due to the fact that you have different major versions for ListView and SideDrawer:
I suppose that upgrading ListView will fix the error.
Do you have a
package-lock.json? It could be forcing NPM to duplicate the module. Simply delete it if it exists.sudo react-native init project working fine with me
Yes.
This is related to another issue that we found with Xcode 10. The fix has already been published in NPM as
nativescript@next. You can upgrade NativeScript CLI and try again.Refs: https://github.com/NativeScript/nativescript-cli/issues/3920
@mbektchiev that was it! Cocoapods version was 1.3.1. After upgrading to 1.5.3 all is back to normal
@peppeg85 Can you send us more information about the crash? Some device logs for example and what kind of crash it is (e.g. Unhandled exception, signal, Access violation). You can refer to this docs section for guidelines how to obtain diagnostic logs from the device if
tns run’s output seems to be incomplete for some reason.@ignaciofuentes We couldn’t reproduce the error that you see. Can you tell us the exact version strings of CocoaPods and Xcode on your machine? You can send us the outputs of
pod --version,xcodebuild -versioncommands. It seems that the cause is the plugin’s CocoaPod reference. With the latest versions (Xcode 10.0 Build version 10A255 and CocoaPods - 1.5.3) there’s no such error.Please reopen the issue @larssnI’m having the same problem described here.
I did execute the following commands:
I’m still facing the issue.I will try switching to the Legacy Build System now.Here’s the (anonymized) build system log:
Dependencies:
EDIT
After switching to the Legacy Build System I was not able to build successfully. I had to execute the erase all contents and settings feature from the iOS Simulator first.
Now I’m able to build using Xcode directly.
tns run iosstill fails with the following (anonymized) output:Here’s my
tns doctoroutput:Solution:
I’ve managed to find the root of all evil:
Fix:
Now everything’s working like a charm. Even with the new build system.
Hey @larssn , Have you tried removing your
platformsdirectory and building your project again (after fixing the package-lock.json issue) ?