IOS build errors - Xcode 13 - ios

Below are errors while building in latest xcode 13 & Mac Apple Pro M1 chip
<unknown>:0: error: module map file '/Users/xxxx/Library/Developer/Xcode/DerivedData/xx-cwbykxafbbbrfjbaeyuaxhdrivdp/Build/Products/Debug-iphonesimulator/Stripe/Stripe.modulemap' not found
<unknown>:0: error: module map file '/Users/xxxx/Library/Developer/Xcode/DerivedData/xx-cwbykxafbbbrfjbaeyuaxhdrivdp/Build/Products/Debug-iphonesimulator/YogaKit/YogaKit.modulemap' not found
Command PrecompileSwiftBridgingHeader emitted errors but did not return a nonzero exit code to indicate failure
Most of the answers mentioned to edit pod file & write exclude configuration hence the tried below fix -
installer.aggregate_targets.each do |aggregate_target|
aggregate_target.user_project.native_targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['LIBRARY_SEARCH_PATHS'] = ['$(SDKROOT)/usr/lib/swift', '$(inherited)'] # or it won't build on apple silicon
# without explicitly clearing this out, it flaps between excluding arm64 or not
# Fix some library / linker errors
config.build_settings['ONLY_ACTIVE_ARCH'] = 'YES' # only one at a time
config.build_settings['VALID_ARCHS'] = 'arm64 x86_64' # you need both to work on both CPU archs / release etc
config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
end
end
aggregate_target.user_project.save
end
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
# We support a smaller range of deployment than some libraries, eliminate related noise
# This also avoids a nasty Folly bug about an API not available until ios10+
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '11.0'
end
end
Also couple of answers mentioned to open workspace file which also tried but these errors are not resolving. Requesting if someone can provide right pointers.

I faced a similar issue with Xcode 14 in M1 Mac running macOS Ventura. The following workaround fixed the issue for me.
Right click on Applications -> Xcode
Choose Get Info
Select Open with Rosetta option if it's not selected

Related

Unable to compile React Native Share Extension iOS 12.5

When upgrading to iOS 12.5, I am getting the compile error that: "Application extensions and any libraries they link to must be built with the APPLICATION_EXTENSION_API_ONLY build setting set to YES."
However, I am explicitly setting it to false in my Podfile:
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['APPLICATION_EXTENSION_API_ONLY'] = 'NO'
end
end
end
Because this is required as a work-around for another issue.
If I set config.build_settings['APPLICATION_EXTENSION_API_ONLY'] = 'YES', then I get even more issues.
Does anyone know how to fix this issue?
You don't need to change the 'Podfile' file,just set the "Require Only App-Extension-Safe API" to Yes in Building Settings,it works for me.
This address maybe help you more. https://github.com/facebook/react-native/issues/28405#issuecomment-779382959

Cocoapods frameworks does not support provisioning profiles

I am new in iOS development world.
I am working in a iOS app development. I am using Cocoapods to integrate third party libraries like Alamofire and KeychainSwift.
When I am export my Archive to generate the .ipa file from local, its working fine. But when I am trying to do the same in my CI tool(Jenkins), its giving Export Failed!.
Its giving the error:
exportArchive: KeychainSwift.framework does not support provisioning profiles.
error: exportArchive: Alamofire.framework does not support provisioning profiles.
Its asking me to:
"Remove this item from the "provisioningProfiles" dictionary in your Export Options property list."
But I will not be able to do that because it requires for my main app.
I did all the tricks over the Internet as below. I added the below line in at the end of the Podfile.
post_install do |installer|
installer.pods_project.build_configurations.each do |config|
config.build_settings['PROVISIONING_PROFILE_SPECIFIER'] = ''
config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'
config.build_settings['CODE_SIGNING_REQUIRED'] = 'NO'
end
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['PROVISIONING_PROFILE_SPECIFIER'] = ''
config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'
config.build_settings['CODE_SIGNING_REQUIRED'] = 'NO'
end
end
end
After doing this I have reinstall the pods again, but no luck.
Can anyone please help?
I have had the same problems as you recently.It took me a few days, and then I solved it.
I use the .sh command file to package.
Only xcodebuild archive was modified:
PROVISIONING_PROFILE**_APP**="${provisioningProfile}" PRODUCT_BUNDLE_IDENTIFIER**_APP**="${bundleID}"
Important things repeating 3 times:
(Only added : _APP)
(Only added : _APP)
(Only added : _APP)
It was finally solved.

Error archiving a CocoaPods dependency for release to App Store

I'm using the following library in my mobile app to provide users with an onboarding tutorial: ephread/Instructions.
Everything was working fine until I recently updated XCode to version 10. After updating, I made sure to update all dependencies to using versions that support Swift 4.2
In the case of the library in question, the changes aren't available in a Cocoapods release yet so I used a specific branch as suggested by the library author as follows:
pod 'Instructions', :git => 'https://github.com/ephread/Instructions.git', :branch => 'swift4'
Everything works fine when I compile and run in Debug. However, when I try to an archive build for release, I get the following error (I've only included what I think is relevant here for brevity).
<unknown>:0: error: fatal error encountered while reading from module 'Instructions'; please file a bug report with your project and the crash log
<unknown>:0: note: compiling as Swift 4.1.50, with 'Instructions' built as Swift 4.2.1 (this is supported but may expose additional compiler issues)
*** DESERIALIZATION FAILURE (please include this section in any bug report) ***
could not deserialize type for '_': could not deserialize type for 'windowLevel': declaration is not a nominal type
Cross-reference to module 'UIKit'
... Level
0 swift 0x000000011114159a PrintStackTraceSignalHandler(void*) + 42
1 swift 0x0000000111140d4e SignalHandler(int) + 302
...
3. While deserializing SIL vtable for 'OverlayManager' in module 'Instructions'
error: Abort trap: 6
Is this something that I'm doing wrong or is it a problem with the library that I can't fix?
I had a similar issue with libs that were not updated to Swift4.2
adding this to the Podfile fixed the issue for me
swift4Targets = ['POD NAME']
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
if swift4Targets.include? target.name
config.build_settings['SWIFT_VERSION'] = '4.0'
else
config.build_settings['SWIFT_VERSION'] = '4.2'
end
end
end
end

flutter simple permissions android version compare and iOS path_provider error

I am used Flutter Simple Permissions plugin in my app but I have a some issues with it.
1.) When i run app on android 6 and higher version there is no problem but when i run it on android 5 execution stopped on "SimplePermissions.checkPermission" and only
showing console message "Checking permission: android.permission.WRITE_EXTERNAL_STORAGE" so my question is that how to compare android version in flutter?
2.) how to determine if the user checked “Never ask again”? and ask for open app settings
3.) Error with iOS permissions "BUILD TARGET path_provider OF PROJECT Pods WITH CONFIGURATION Debug"
Console Message: === BUILD TARGET path_provider OF PROJECT Pods WITH CONFIGURATION Debug ===
/Users/home/Library/Android/flutter/.pub-cache/hosted/pub.dartlang.org/simple_permissions-0.1.9/ios/Classes/SimplePermissionsPlugin.m:2:9: fatal error: 'simple_permissions/simple_permissions-Swift.h' file not found
#import
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
I am new with flutter so please help me if any one know about it. Thanks advanced.
please try this edits in Podfile Code needs to be added or edited are marked with "** ...... **"
target 'Runner' do
** use_frameworks! **
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ENABLE_BITCODE'] = 'NO'
** config.build_settings['SWIFT_VERSION'] = '4.0' **
end
end
end
delete your Podfile.lock and try

TesseractOCRiOS | Warning: Multiple build commands for output file

versions:
TesseractOCRiOS 4.0.0
CocoaPods 1.2.1
When i'm building on simulator - everything is fine, but when i'm trying to build on my iPhone xCode gives me next warning:
Warning: Multiple build commands for output file /Users/Username/Library/Developer/Xcode/DerivedData/ProjectName-hjheurpncvhpfbabezufoumrybad/Build/Products/Debug-iphoneos/TesseractOCRiOS/TesseractOCR.framework/PrivateHeaders/config_auto.h
Faced with the same problem recently, definitely not the best, but acceptable workaround - just delete one of the duplicate lines "config_auto.h" with path "./Pods/TesseractOCRiOS/TesseractOCR/include/leptonica/" in "Build Phases"-"Headers"-"Private" settings of TesseractOCRiOS target.
OCR recognition functionality does not affected by this change.
See screenshot for details.
If you're using cocoapods, you can add following script at the end of your pod file:
post_install do |installer|
installer.pods_project.targets.each do |target|
if target.name == 'TesseractOCRiOS'
target.build_configurations.each do |config|
config.build_settings['ENABLE_BITCODE'] = 'NO'
end
header_phase = target.build_phases().select do |phase|
phase.is_a? Xcodeproj::Project::PBXHeadersBuildPhase
end.first
duplicated_header_files = header_phase.files.select do |file|
file.display_name == 'config_auto.h'
end
duplicated_header_files.each do |file|
header_phase.remove_build_file file
end
end
end
end
Just noticed that it's also disabling bitcode. Remove it if that's not what you need. The script removes the duplicate header files since they are under private section only.
I think you have a problem in your project directory. You have a duplicate file of config_auto.h
Go to your Target , Delete config_auto.h under the build phases.
Hope!! This helps you

Resources