NativeScript / nativescript-angular

Integrating NativeScript with Angular
http://docs.nativescript.org/angular/tutorial/ng-chapter-0
Apache License 2.0
1.22k stars 241 forks source link

tns run ios not working after update #2355

Open anoggi opened 3 years ago

anoggi commented 3 years ago

Environment Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):

Describe the bug After updating to the newest nativescript and @nativescript/ios, tns run ios is not working anymore. I get the following error:

error: Unexpected duplicate tasks:
1) Target 'frontendnativescript' (project 'frontendnativescript'): CodeSign /Users/anoki/Downloads/sepm/ss20_sepm_qse_14/frontend_nativescript/platforms/ios/build/Debug-iphonesimulator/frontendnativescript.app/Frameworks/TNSWidgets.framework
2) Target 'frontendnativescript' (project 'frontendnativescript'): CodeSign /Users/anoki/Downloads/sepm/ss20_sepm_qse_14/frontend_nativescript/platforms/ios/build/Debug-iphonesimulator/frontendnativescript.app/Frameworks/TNSWidgets.framework
error: Multiple commands produce '/Users/anoki/Downloads/sepm/ss20_sepm_qse_14/frontend_nativescript/platforms/ios/build/Debug-iphonesimulator/frontendnativescript.app/Frameworks/TNSWidgets.framework/TNSWidgets':
1) Target 'frontendnativescript' has copy command from '/Users/anoki/Downloads/sepm/ss20_sepm_qse_14/frontend_nativescript/node_modules/@nativescript/core/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/TNSWidgets.framework' to '/Users/anoki/Downloads/sepm/ss20_sepm_qse_14/frontend_nativescript/platforms/ios/build/Debug-iphonesimulator/frontendnativescript.app/Frameworks/TNSWidgets.framework'
2) Target 'frontendnativescript' has copy command from '/Users/anoki/Downloads/sepm/ss20_sepm_qse_14/frontend_nativescript/node_modules/tns-core-modules-widgets/platforms/ios/TNSWidgets.framework' to '/Users/anoki/Downloads/sepm/ss20_sepm_qse_14/frontend_nativescript/platforms/ios/build/Debug-iphonesimulator/frontendnativescript.app/Frameworks/TNSWidgets.framework'

error: Multiple commands produce '/Users/anoki/Downloads/sepm/ss20_sepm_qse_14/frontend_nativescript/platforms/ios/build/Debug-iphonesimulator/frontendnativescript.app/Frameworks/TNSWidgets.framework':
1) Target 'frontendnativescript' has copy command from '/Users/anoki/Downloads/sepm/ss20_sepm_qse_14/frontend_nativescript/node_modules/@nativescript/core/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/TNSWidgets.framework' to '/Users/anoki/Downloads/sepm/ss20_sepm_qse_14/frontend_nativescript/platforms/ios/build/Debug-iphonesimulator/frontendnativescript.app/Frameworks/TNSWidgets.framework'
2) Target 'frontendnativescript' has copy command from '/Users/anoki/Downloads/sepm/ss20_sepm_qse_14/frontend_nativescript/node_modules/tns-core-modules-widgets/platforms/ios/TNSWidgets.framework' to '/Users/anoki/Downloads/sepm/ss20_sepm_qse_14/frontend_nativescript/platforms/ios/build/Debug-iphonesimulator/frontendnativescript.app/Frameworks/TNSWidgets.framework'

note: Using new build system
note: Building targets in parallel
note: Using codesigning identity override: 
note: Planning build
note: Constructing build description
warning: duplicate output file '/Users/anoki/Downloads/sepm/ss20_sepm_qse_14/frontend_nativescript/platforms/ios/build/Debug-iphonesimulator/frontendnativescript.app/Frameworks/TNSWidgets.framework' on task: PBXCp /Users/anoki/Downloads/sepm/ss20_sepm_qse_14/frontend_nativescript/node_modules/tns-core-modules-widgets/platforms/ios/TNSWidgets.framework /Users/anoki/Downloads/sepm/ss20_sepm_qse_14/frontend_nativescript/platforms/ios/build/Debug-iphonesimulator/frontendnativescript.app/Frameworks/TNSWidgets.framework (in target 'frontendnativescript' from project 'frontendnativescript')
warning: duplicate output file '/Users/anoki/Downloads/sepm/ss20_sepm_qse_14/frontend_nativescript/platforms/ios/build/Debug-iphonesimulator/frontendnativescript.app/Frameworks/TNSWidgets.framework/TNSWidgets' on task: PBXCp /Users/anoki/Downloads/sepm/ss20_sepm_qse_14/frontend_nativescript/node_modules/tns-core-modules-widgets/platforms/ios/TNSWidgets.framework /Users/anoki/Downloads/sepm/ss20_sepm_qse_14/frontend_nativescript/platforms/ios/build/Debug-iphonesimulator/frontendnativescript.app/Frameworks/TNSWidgets.framework (in target 'frontendnativescript' from project 'frontendnativescript')
warning: duplicate output file '' on task: PBXCp /Users/anoki/Downloads/sepm/ss20_sepm_qse_14/frontend_nativescript/node_modules/tns-core-modules-widgets/platforms/ios/TNSWidgets.framework /Users/anoki/Downloads/sepm/ss20_sepm_qse_14/frontend_nativescript/platforms/ios/build/Debug-iphonesimulator/frontendnativescript.app/Frameworks/TNSWidgets.framework (in target 'frontendnativescript' from project 'frontendnativescript')
warning: Building for iOS Simulator, but the linked and embedded framework 'TNSWidgets.framework' was built for iOS + iOS Simulator. (in target 'frontendnativescript' from project 'frontendnativescript')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.4.99. (in target 'MDFInternationalization' from project 'Pods')
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.4.99. (in target 'BEMCheckBox' from project 'Pods')
** BUILD FAILED **

Unable to apply changes on device: 31FE16F7-4244-4521-AF2F-BFAF9020FC98. Error is: Command xcodebuild failed with exit code 65.

I tried to fix this as suggested in this post: https://github.com/NativeScript/nativescript-cli/issues/4035

In the List of Frameworks, Libraries and Embedded Content I found TNSWidgets.xcframework and TNSWidgets.framework. After deleting one of them (no matter which one) and running tns run ios again, I get another error:

Unable to apply changes on device: 31FE16F7-4244-4521-AF2F-BFAF9020FC98. Error is: Command xcrun with arguments simctl install 31FE16F7-4244-4521-AF2F-BFAF9020FC98 /Users/anoki/Downloads/sepm/ss20_sepm_qse_14/frontend_nativescript/platforms/ios/build/Debug-iphonesimulator/frontendnativescript.app failed with exit code 22. Error output:
 An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=22):
Failed to install the requested application
The bundle identifier of the application could not be determined.
Ensure that the application's Info.plist contains a value for CFBundleIdentifier.

All posts I found regarding this error suggest cleaning the project, which results in the first error again.