Nativescript - setting the target os version (iOS) - nativescript

For a NS project, how do you set the minimum iOS version.
I've got IPHONEOS_DEPLOYMENT_TARGET=8.0; in my build.xcconfig file
but during build I get not-set message.
During the build process, I get:
Pod installation complete! There are 2 dependencies from the Podfile and 2 total pods installed.
[WARNING]: [!] Automatically assigning platform ios with version 8.0 on target publishios because no platform was specified. Please specify a platform for this target in your Podfile. Seehttps://guides.cocoapods.org/syntax/podfile.html#platform.
My iOS/build.xcconfig file has
IPHONEOS_DEPLOYMENT_TARGET = 8.0;

Check this out for some Podfile syntax guidelines
For this specific issue, you just need to edit the platforms/ios/Podfile and set the version like so:
platform :ios, '9.0'

Modifying anything in platforms folder gets overwritten on a build. Try modifying Podfile located in app/App_Resources/iOS with: Create file if not present, it does not have an extension
post_install do |pi|
pi.pods_project.targets.each do |t|
t.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '9.0'
end
end
end

Related

Module 'apple_sign_in' not found on Xcode but app build on Android Studio

When I try to build app on Xcode I get this error:
/Users/user/folder/appName/ios/Runner/GeneratedPluginRegistrant.m:10:9: Module 'apple_sign_in' not found.
But if I use Android Studio the app builds fine.
So far I removed the podfile, podfile.lock, then cleaned up the build folder and then tried again, but nothing changed, the error persists.
Also uncommented the platform :ios, line and set it to different versions, the last I've tried is 13.0
Can anyone help me with this, please?
try uncommenting # platform :ios, '9.0' in podfile and add use_frameworks! line to the podfile.

Project build succeeds but lots of errors appears when previewing

My project builds fine, but when i build as previewing it shows lots of errors. Have already restarted my Mac and used pod install and pod update, but it still persists.
The screenshot that shows an error in the code isthe only error that refers to some code, the other "red" errors don't refer to any fisic code
Edit: FAIL DIAGNOSIS:
umbrella header for module 'GoogleUtilities' does not include header 'GULSwizzler.h' [-Werror,-Wincomplete-umbrella]
SchemeBuildError: Failed to build the scheme "MedicalApp"
umbrella header for module 'GoogleUtilities' does not include header 'GULSwizzler.h' [-Werror,-Wincomplete-umbrella]
Build target FirebaseCoreDiagnostics:
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.1.99. (in target 'FirebaseCoreDiagnostics' from project 'Pods')
I think the correct pod is pod 'FirebaseCore', not pod 'Firebase/Core'. Try changing that pod and see if it works. Some of the "yellow" errors will remain, but the app should still build.
Your problem is here as written :
The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0
Copy and paste this code to your podfile. After go to terminal and make pod update
post_install do |pi|
pi.pods_project.targets.each do |t|
t.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '9.0'
end
end
end

error in xcode after pod install firebase

I am getting this error in the screenshot after trying to pod install firebase
My xcode version is 8.2
this is the content of my podfile
# Uncomment the next line to define a global platform for your project
platform :ios, '8.0'
target 'Forsa' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for Forsa
pod 'Firebase/Core'
pod 'Firebase/Messaging'
end
You need to open the file that cocoapods created: PROJECTNAME.xcworkspace (instead of the PROJECTNAME.xcodeproj file) to get access to the installed frameworks.
Or like they say in their documentation:
Make sure to always open the Xcode workspace instead of the project
file when building your project:
$ open App.xcworkspace

How to use cocoapods to install alamofire into watchOS app

Here's my podfile:
source 'https://github.com/CocoaPods/Specs.git'
# Uncomment the next line to define a global platform for your project
target 'raceQs' do
platform :ios, '11.1'
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for raceQs
pod 'AppCenter'
pod 'Alamofire'
end
target 'raceQs WatchKit Extension' do
platform :watchos, '4.1'
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for raceQs WatchKit Extension
pod 'Alamofire'
end
I'm opening my project's xcworkspace and getting a compile error:
Developer/Xcode/DerivedData/raceQs-cwycjawfwoosfubowtoymeizvfln/Build/Products/Debug-iphoneos/raceQs.app/Frameworks/Alamofire.framework'
/Users/mac/Library/Developer/Xcode/DerivedData/raceQs-cwycjawfwoosfubowtoymeizvfln/Build/Products/Debug-iphoneos/raceQs.app/Frameworks/Alamofire.framework: bundle format unrecognized, invalid, or unsuitable
In my Xcode project Navigator, the Frameworks/ Pods_raceQs_WatchKit_Extension is displayed in red.
Any assistance would be greatly appreciated.

Using Realm Framework in Today extension (CocoaPods)

I am using realm.io as storage for some data. I want to share this data with my Today extension. I am using CocoaPods and I am wondering how I can share that Framework with both targets. My podfile looks like this:
platform :ios, '8.0'
use_frameworks!
pod 'RealmSwift'
pod 'MBProgressHUD'
pod 'Alamofire'
I tried with this and it worked when building to device, but not when building to the iOS simulator. It returned the error 'ld: framework not found Pods':
platform :ios, '8.0'
use_frameworks!
def shared_pods
pod 'RealmSwift'
pod 'Alamofire'
end
target 'App' do
shared_pods
pod 'MBProgressHUD'
end
target 'AppToday' do
shared_pods
end
What am I doing wrong?
Appreciate any help.
Brgds
Your Podfile looks correct and would work on a clean installation. But you found a bug in the user project integration in CocoaPods when migrating between different setups.
Background info
If you don't explicitly specify a target in the Podfile, then CocoaPods will integrate with the first target in your project. This was your app target, which worked correct as long as it was the only one.
But now you're referencing explicitly to the targets. CocoaPods will create separate so called aggregate targets. Those are in the Pods.xcodeproj and named Pods-App and Pods-AppToday. These are static framework targets (from 0.39.beta.5), which are weak linked to your targets to help Xcode finding your dependencies in the Pods project. Because CocoaPods doesn't know anything about the previous Podfile when you run pod install (and it doesn't retain this information in the Podfile.lock), it doesn't remove the old aggregate target, which was named just Pods and it's product reference in your app target.
Resolving the issue
Select your project file in Xcode in the file navigator
Select your app target in the left pane from the targets list
Go to the General tab
Remove Pods.framework from the Linked Frameworks and Libraries pane
Expected state before
How it should look like
platform :ios, '8.0'
use_frameworks!
pod 'RealmSwift'
pod 'MBProgressHUD'
pod 'Alamofire'
Add this line
link_with 'App', 'AppToday'

Resources