Xcode build fails for react-native AwesomeProject - xcode

I'm running Xcode 4.6.3 on OS X 10.7.5. I've set the iOS Deployment Target to 6.1 in Xcode and selected the iPhone 6.1 simulator. When I hit Run the React Packager appears and says it is ready.
Xcode then fails to build with four parse errors related to RCTImageDownloader.m and there are also nine Target Integrity warnings:
/Users/SM/AwesomeProject/node_modules/react-native/Libraries/AdSupport/RCTAdSupport.xcodeproj
iOS Deployment Target 7.0 is newer than SDK iOS 6.1 in target
RCTAdSupport
What are my options for resolving this problem?

The tools do not support building for a newer deployment target than the SDK supports. You need to lower the deployment target from 7.0 to 6.1 or use newer tools (which will require a newer version of OSX as well).

Related

Swift Compiler Error (Xcode): Compiling for iOS 11.0, but module 'amplify_core' has a minimum deployment target of iOS 13.0

I'm setting up my Flutter build environment on my new M2 MacBook Air. I'm trying to build our company app, which builds fine on my i7 MacBook Pro. I'm getting the error below:
Swift Compiler Error (Xcode): Compiling for iOS 11.0, but module 'amplify_core' has a minimum deployment target of iOS 13.0:
/source/code/path/build/ios/Debug-dev-iphonesimulator/amplify_core/amplify_core.framework/Modules/amplify_core.swiftmodule/x86_64-apple-ios-simulator.swiftmodule
~/flutter/.pub-cache/hosted/pub.dartlang.org/amplify_analytics_pinpoint_ios-0.5.1/ios/Classes/FlutterAnalytics.swift:22:7
Could not build the application for the simulator.
Error launching application on iPhone SE (3rd generation).
The above error says its building for the x86_64 simulator on my M2? Am I missing a setting somewhere?
EDIT
I can run open ios/Runner.xcworkspace and change the Minimum deployment version of amplify_core to 11.0, but I need a real solution.

Nativescript: Error Building for iOS Simulator

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

Alamofire with iOS 7

I need to support iOS 7. I have Alamofire in my podspec file since it's an internal library for a separate I'm building. When I run pod lib lint, I get the following error:
The platform of the target `Pods` (iOS 7.0) is not compatible with `Alamofire (1.1.4)` which has a minimum requirement of iOS 8.0 - OS X 10.9.
When I try add the library to a regular Podfile of a project that supports iOS 7, I get the same error. Anyone know the issue?
Dynamic Frameworks won't work in iOS 7. Drag the file in manually.
Quote from AlamoFire's README:
Embedded frameworks require a minimum deployment target of iOS 8 or OS X Mavericks.
To use Alamofire with a project targeting iOS 7, you must include the Alamofire.swift source file directly in your project. See the 'Source File' section for instructions.
For Swift 1.2 using the Xcode 6.3 Beta, use the xcode-6.3 branch.

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.

upgraded Xcode to 4.5.2 from 4.3.2 and install Simulator 5.0 or 5.1

I upgraded Xcode to 4.5.2 from 4.3.2 and install Simulator 5.0 or 5.1 but it tips
"Failed to mount file://localhost/Users/admin/Library/Caches/com.apple.dt.Xcode/Downloads/Xcode.SDK.iPhoneSimulator.5.1-5.1.dmg at file://localhost/var/folders/sw/qht9m6ln7353v5mbfyvhtmf00000gn/T/attached-image-6fdc393a2528f4e65d994f841bfb0d76b998b7e3/: not recognized", how can I do,thanks.
I found a work around for this. I am currently using Xcode 4.5 so I am sure it works for 4.5.2 as well.
I found the URL's for downloads in the .dvtdownloadabelindex file located in
Users/<user>/Library/Caches/com.apple.dt.Xcode/Downloads/
I copied the file to my Desktop and renamed it to .plist. Looking through some of the I found two URLs to download the simulators (Root/downloadables/Item 9/ for iPhoneSimulator 5.0 and Root/downloadables/Item 17/ for iPhoneSimulator 5.1). Not sure if I am allowed to post the direct URLs due to Apple TOS and whatnot.
I downloaded the two simulators, installed what was in the .dmg. It made a folder in the root of my drive called Platforms. I then copied
/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk
to
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk
Restart Xcode (or in my case, MonoTouch), go into Xcode preferences and to the tab you would normally download them from, click install and this will get rid of the "iOS Simulator could not find the SDK. The SDK may need to be reinstalled." error that you would normally get.
You now have access to the iPhone/iPad iOS 5.0 Simulators. I have only done this for the 5.0 simulator not 5.1, but I am sure it will work the same.
This works for me:
Delete *.dvtdownloadableindex file
Restart Xcode
Install simulators

Resources