Nativescript: Error Building for iOS Simulator - xcode

I have followed the complete install guide for nativescript on a Mac (Big Sur). Also when running tns doctor everything seems fine. However, when i'am running tns build ios or tns run ios i get the following error:
error: Building for iOS Simulator, but the linked and embedded framework 'TNSWidgets.framework' was built for iOS + iOS Simulator. (in target 'projectapp' from project 'projectapp').
Could someone please tell me how to fix this. I installed nativescript 7.0.11 and
x-code 12.3

Yesterday with the Xcode update (12.3) I've got the same error, after seeing a lot of posts about this error the solution from Niko Dovidija IS THE CORRECT ONE.
My environment:
Xcode 12.3
iOS platform 6.5.3
Nativescript 6.7.8
In order to build the application in CLI update build.xconfig in iOS platform and add this line:
VALIDATE_WORKSPACE = YES
Posts about "similar" errors and didn't work for me.
Building for iOS simulator
Building for iOS simulator 'AFNetworking.framework'

So I just updated Xcode to 12.3 today, using nativescript 7.0.11 in my project and I got a simular issue. What worked for me was:
Open the platforms/ios folder using Xcode
Select "yourprojectname.xcodeproj" from the list
Select yourprojectname from the Targets
Expand Build Options and find Validate Workspace
Change to Yes
Rebuild the project
After that, I got a successful build.

Please note that I also needed to run ns platform clean ios command in order to make the build work after updating my Xcode to 12.3

Related

Flutter - Getting an error archiving with Xcode

I finished up my small flutter app, where I am using a webview (webview_flutter: ^0.3.5+3). All works great on simulator.
I have run flutter build iOS --release, selected runner from targets and set it to generic iOS device.
Now I want to archive it in Xcode but I keep getting this error about "Library not found for -lwebview_flutter"
I can't seem to find a solution and would really appreciate some help
If you're using Flutter plugins that installed Pods in the iOS build, make sure that you've opened the Xcode project with .xcworkspace
If that still didn't work, you can try regenerating the iOS build folder by deleting the /ios folder and run flutter create --platforms=ios to generate project files for the iOS build.

Cordova Build causing xcodeBuild to quit unexpectedly

I've got a basic react app running in Cordova, when I run a
cordova build ios
Things seem to work OK but then after a short delay I get the following:
If I run a
cordova run ios
I get the following
No target specified for emulator. Deploying to iPhone-X, 12.1
simulator
/Users/Liam/code/ProjectName/app-src/platforms/ios/build/emulator/ProjectName/Info.plist
file not found.
I've done the usual, clean, remove platform, re-add platform but same issues. Any ideas what causes this or how to debug further?
I can run the Cordova App from XCode

Missinig provisoning profile error when building an ios ionic app using xcode 10

I updated my version of xcode yesterday, and now when I build an ionic app that worked perfectly before I get the following error when validating the ipa:
Unable to process application at this time due to the following error: Missing Provisioning Profile - Apps must contain a provisioning profile in a file named embedded.mobileprovision..
How can I get the embedded.mobileprovision to be generated/ included?
Thanks,
Yuval
Currently the best workaround is to opt-out of the new build system:
If you're building on the command-line, you can specify --buildFlag="-UseModernBuildSystem=0":
Cordova CLI
cordova run ios --buildFlag='-UseModernBuildSystem=0'
cordova build ios --buildFlag='-UseModernBuildSystem=0'
Ionic CLI
ionic cordova run ios -- --buildFlag="-UseModernBuildSystem=0"
ionic cordova build ios -- --buildFlag="-UseModernBuildSystem=0"
If you're building with a build.json config file, you can add the following under the iOS release or debug config:
"buildFlag": [
"-UseModernBuildSystem=0"
]
If you are opening the project in the Xcode IDE, you need to change the build system in Workspace Settings to "Legacy Build System"
Solution from here
Worked For Me. Cheers.
https://github.com/apache/cordova-ios/issues/407 has an answer,
\just build with the --buildFlag="-UseModernBuildSystem=0" and adjust project settings to build using legacy mode.
It seems like this issue has been resolved with the release of cordova ios 5.0.0 ( https://cordova.apache.org/announcements/2019/02/09/cordova-ios-release-5.0.0.html ) - they added compatibility with the modern build system

XCode 6 GM: linker error when building for device (Metal not found)

I'm trying to build my project in XCode 6 GM for device (base SDK version is 7.1), and I get linker error:
ld: framework not found Metal for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
The same project builds perfectly in XCode 5 without any changes in project settings. (Also, build in XCode 6 for simulator succeeds.)
I'm building with SDK 7.1, why is XCode 6 trying to link to Metal anyway?
Having the same problem. I am able to build the app fine in Xcode 6 pointed to the simulator or a phone, but when archiving I get this error. I am using the iOS 7.1 SDK.
I am using cocoapods and found that I can fix the problem by either setting the 'Link Frameworks Automatically' to NO for the pods project, or by archiving while there is a device plugged in and the scheme is targeted to a device not just 'iOS Device.'
This is a problem caused by Xcode 6's default project build settings.
Edit: Here is another explanation of this solution: http://www.appsee.com/blog/dev/xcode-new-link-frameworks-automatically-fix-framework-not-found-metal-for-architecture-armv7
I had the same problem in a code base building fine iOS 8.0 SDK (Xcode 6.0.1) and having this issue with iOS 7.1 SDK (though in Xcode 5.1.1). There seem to be a lot of different project having this problem. See here for more details.
What fixed the issue for me was going to my targets 'Build Phase'-settings, 'Link Binary with Libraries' and there removing and re-adding the CoreVideo.framework, 'Product > Clean', a finally the 'Product > Run'.
Using the iOS 7.1 SDK with Xcode 6 is not a supported configuration. The linker is behaving correctly here. The 7.1 SDK doesn't contain Metal.framework to link against, and you have requested to link against Metal.framework. You need to use the iOS 8.0 SDK or later to use Metal.framework.

Phonegap/Cordova Build error - Apple Mach-O Linker Error: no such file or directory: libCordova.a

I am getting an error after creating a new Cordova 2.1.0 project and updating the www folder with some code from a previous PhoneGap application.
clang: error: no such file or directory: '/Users/peterbanjo/Library/Developer/Xcode/DerivedData/OpuzMobile-bhwawiqfaptmxvfosawfabudgbkj/Build/Products/Debug-iphoneos/libCordova.a'
The error only occurs when I try and run the application on a device - in the simulator it works fine.
I am running Xcode 4.5 and iOS6 on the target iPad. I have tried a clean build and libCordova.a appears in the Build Phases > Link Library With Libraries tab but it is in red.
What I found confusing with PhoneGap/Cordova 2.1.0 by upgrading from 1.4 is that there are TWO projects in my application. There is MyApplication.xcodeproj and CordovaLib.xcodeproj. The changes to resolve this issue need to be applied to the CordovaLib project.
Change "Build Active Architecture Only" to "YES"
Update the text file project.pbxproj to these values
Toggle between the build schema for the simulator and the device (Use the select menu next to the stop button. Somehow this seems to cause the changes to be detected).
Did this work for you? Did I miss something?
PS: For a better understanding of the problem take a look at this Google Forum thread
I'm using Cordova/Phonegap 2.9 and this solved my issue. Didn't touch any of the arch stuff. Everything is set to armv7 armv7s on mine.
Follow these steps to fix this problem:
Go to project settings and Build Tab.
Search for "Other Linker Flags"
Double click on the linker flags for Release and Change ${TARGET_BUILD_DIR}/libCordova.a to ${BUILT_PRODUCTS_DIR}/libCordova.a
Do the same for Debug Clean and build archive again
I had the same error and fixed it by reverting to an older version of cordova ios.
Steps to fix the issue:
Uninstall cordova-ios first, with npm uninstall cordova-ios
Install old version of cordova-ios with npm install cordova-ios#4.4.0
Remove existing ios platform with ionic cordova platform rm ios or ionic platform rm ios
After that we should add platform with ionic cordova platform add ios#4.4.0 or ionic platform add ios#4.4.0
Run ionic cordova build ios.
Instructions came from here.
Only need to remove armv6 from both YourProject and CordovaLib:
The consequences of doing this? Apparently, it's still working on iPhone 3GS, but not the previous versions..
To make it work I downloaded from http://connect.apple.com stand alone Xcode 4.4.1. With this version I can build my phonegap Application with armv6 :)
Yes, in this case you need to have two Xcode on your computer.
Look at this https://groups.google.com/forum/?fromgroups=#!topic/phonegap/ywoc9wNydZ8
works for me
--
OS X 10.8.2
XCode 4.5
iOS 6.0
PhoneGap 2.1.0
DO NOT assume that having Standard (armv7,armv7s) - $(ARCHS_STANDARD_32_BIT)
is the same as the fix above.
Manually change this value to only armv7 and that fixed it for me.
I was very frustrated.
If you did everything here and it is still not working and you have separate configuration aside from Release and Debug - for this example is Production. Make sure that 'Production' Build Configuration exists in Cordova project. Build the Cordova Project and Build + Archive your main project again.

Resources