Project build succeeds but lots of errors appears when previewing - xcode

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

Related

I have just set up the working environment for react native for iOS dev on mac but getting this error, while trying to build my first basic app

" Class AMSupportURLConnectionDelegate is implemented in both /usr/lib/libauthinstall.dylib (0x1f93a5160) and /System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x113f5c2b8). One of the two will be used "
As mentioned by Class AMSupportURLConnectionDelegate is implemented in both I used --verbose and the detailed error message was like "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.5.99. (in target 'YogaKit' from project 'Pods')
".
This was for Xcode version 12. To resolve this, at the end of the pod file we can add below code(screenshot attached):
post_install do |pi|
pi.pods_project.targets.each do |t|
t.build_configurations.each do |bc|
if bc.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] == '8.0'
bc.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.4'
end
end
end
end
And then go to project_name/ios directory and run "pod update" after that "cd .." to go back to project_name directory and run the react-native commands "npx react-native start" and after that preferably in a new terminal window run "npx react-native run-ios". This shall resolve the issue.

Nativescript issue with iOS14 and Xcode12

Using the CLI as always but after updating my iPhone to iOS14 I have got this error:
** EXPORT SUCCEEDED **
Project successfully built.
Unable to apply changes on device: XXXXXXXXX. Error is: No .ipa found in /Users/XXXXXXXX/XXXXXXXX/platforms/ios/build/Debug-iphoneos directory..
But the file is located there. Also using Xcode 12 doesn't help...Even the LaunchScreen is black...
Would anyone suggest if it can be fixed any how? Or it is a Nativescript bug and we have to wait when they will update it?
Also there is a warning on:
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.0.99. (in target 'MDFInternationalization' from project 'Pods')
Your Error:
Unable to apply changes on device: XXXXXXXXX. Error is: No .ipa found in /Users/XXXXXXXX/XXXXXXXX/platforms/ios/build/Debug-iphoneos directory..
comes from a wrong configured Info.plist. You should check the line
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
If you don't have ${PRODUCT_NAME} as the value, change it to this. That helped me.
Hey just to add to what Moritz said. I also had to upgrade nativescript-localize to 4.2.2 (thread: iOS14 and nativescript)
After that ${PRODUCT_NAME} stopped being replaced by the plugin and the .ipa then had the correct name.
To fix the warning around IPHONEOS_DEPLOYMENT_TARGET you may need to add this to your Podfile in app/App_Resources/iOS/Podfile.
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'
config.build_settings['CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER'] = 'NO'
end
end
end
https://timleland.com/how-to-fix-nativescript-issue-with-ios14-and-xcode-12/
Try Removing and adding back
tns platform add ios
This will update the ios package below
"#nativescript/ios": "8.2.1",
This worked for me.

Nativescript - setting the target os version (iOS)

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

Working with Cocoapods + WatchOS 2 target

I have an iOS project with a lot of pods, around twenty. I want to integrate a watchOS 2 app in, but CocoaPods requires that the podspec contain support for watchOS (as seen here: http://blog.cocoapods.org/CocoaPods-0.38/)
At first, I thought I could fork all of the pods that aren't updated, point my podfile to those forked repos, and bob's your uncle. The problem is that some of the pods that I'm using are closed/not-public. Is there a way for me to not build the main application's pods for the watchOS target? Like using target isolation like so?:
target "Watch" do
end
I can't seem to get that ^ potential solution to build, as it still tries to build the pods. I've also tried this repo, no luck: https://github.com/orta/cocoapods-expert-difficulty
There are two way to integrate pods using podfile with WathOS.
1) Add Required pods directly to watch extension as below.
target '<your watch Extension Name>' do
platform :watchos, '2.0'
pod 'RealmSwift'
pod 'Alamofire'
pod 'MMWormhole', '~> 2.0.0'
end
2) Create Shared pods and add to both watch extension and iOS target both.
def sharedPods
pod 'RealmSwift'
pod 'Alamofire'
end
target '<your watch Extension Name>' do
platform :watchos, '2.0'
sharedPods
end
target '<your iOSApp Name>' do
platform :ios, '8.0'
sharedPods
end
Add only watchOS and iOS supported pods in sharedPods,
Do not add pods in sharedPods which does not support watchOS.
e.g.
def sharedPods
pod 'RealmSwift'
pod 'Alamofire'
pod 'otherWatchOS&iOS supported Pod1'
pod 'otherWatchOS&iOS supported Pod2'
end
Add only iOS supported pods in target '<your iOSApp Name>'
e.g.
target '<your iOSApp Name>' do
platform :ios, '8.0'
sharedPods
pod 'otherOnlyiOS supported Pod1'
pod 'otherOnlyiOS supported Pod2'
end
So, this way you can add required pods for required targets.
I've found my problem! I was using Swift for my Watch code, but my parent app is in Obj-c. Thought it wouldn't be a problem except the watch target attempts to compile the Swift bridging header that I use in my main app, which is what was leading to those pods building unnecessarily. So, the solution is either specify a different bridging header for your Watch target or using Obj-c!

Use of private header from outside its module error in CPTBorderedLayer.m of CorePlot

I upgraded to a new laptop with El Capitan, XCode 7.1, and Cocoapods 0.39.0. When I check out an existing project that uses the CorePlot framework, run pod install, and build the project, I get the following error messages in the CPTBorderedLayer.m file of CorePlot:
Use of private header from outside its module: '_CPTBorderLayer.h'
Use of private header from outside its module: '_CPTMaskLayer.h'
Below is a snippet of my podfile:
platform :ios, '9.0'
use_frameworks!
inhibit_all_warnings!
target 'my_project' do
...
pod 'CorePlot', :git => 'https://github.com/core-plot/core-plot.git'
This project was compiling fine using Xcode 7.0 and cocoapods 0.37.2, but I'd really rather not downgrade everything unless there are no other options.
This error has something to do with the way CocoaPods sets up the framework project. A temporary fix is to remove the use_frameworks! line from the pod file to let it build the dependencies as a static library.
Please report the problem on the Core Plot issue tracker and we'll see if this can be fixed.

Resources