Error Compiling IOS and React Native Causing Swift Error - ios

I have a problem running my react native app in IOS. The following build commands failed: SwiftCompile normal x86_64 Compiling\ STPAPIClient+ApplePay.swift,\ STPAPIClient+PaymentsCore.swift,\ STPApplePayContext.swift / ........
I just updated my xcode to the latest version
Full Error
/Users/joe/Documents/play/test_app/ios/TestApp.xcodeproj: warning: Multiple targets match implicit dependency for linker flag '-lOGReactNativeWaveform'. Consider adding an explicit dependency on the intended target to resolve this ambiguity. (in target 'TestApp' from project 'TestApp')
note: Target 'OGReactNativeWaveform' (in project 'Pods')
note: Target 'OGReactNativeWaveform' (in project 'OGReactNativeWaveform')
warning: Run script build phase 'Bundle React Native code and images' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'TestApp' from project 'TestApp')
warning: Run script build phase 'Run Script' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'TestApp' from project 'TestApp')
warning: Run script build phase 'Start Packager' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'TestApp' from project 'TestApp')
warning: Run script build phase '[CP-User] [RNFB] Core Configuration' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'TestApp' from project 'TestApp')
warning: Run script build phase '[CP-User] [RNFB] Crashlytics Configuration' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'TestApp' from project 'TestApp')
The following build commands failed:
SwiftCompile normal x86_64 Compiling\ STPAPIClient+ApplePay.swift,\ STPAPIClient+PaymentsCore.swift,\ STPApplePayContext.swift /Users/joe/Documents/play/test_app/ios/Pods/StripeApplePay/StripeApplePay/StripeApplePay/Source/ApplePayContext/STPAPIClient+ApplePay.swift /Users/joe/Documents/play/test_app/ios/Pods/StripeApplePay/StripeApplePay/StripeApplePay/Source/PaymentsCore/Categories/STPAPIClient+PaymentsCore.swift /Users/joe/Documents/play/test_app/ios/Pods/StripeApplePay/StripeApplePay/StripeApplePay/Source/ApplePayContext/STPApplePayContext.swift (in target 'StripeApplePay' from project 'Pods')
CompileSwift normal x86_64 /Users/joe/Documents/play/test_app/ios/Pods/StripeApplePay/StripeApplePay/StripeApplePay/Source/ApplePayContext/STPApplePayContext.swift (in target 'StripeApplePay' from project 'Pods')
(2 failures)

Related

Swift Compiler Error (Xcode): Using bridging headers with module interfaces is unsupported

So after I ran:
flutter build ipa
I got the output like this in visual studio code:
đź’Ş Building with sound null safety đź’Ş
Archiving com.ehealth.EMSdailysurvey...
Automatically signing iOS for device deployment using specified development team in Xcode project: 54GG7M63R4
Running pod install... 786ms
Running Xcode build...
└─Compiling, linking and signing... 5.4s
Xcode archive done. 39.1s
Failed to build iOS app
Error output from Xcode build:
↳
error: using bridging headers with module interfaces is unsupported
** ARCHIVE FAILED **
Xcode's output:
↳
Writing result bundle at path:
/var/folders/9p/bw8m2_ns5kx4hppr37mzz1zr0000gn/T/flutter_tools.9yTkx8/flutter_ios_build_temp_dir6Hgplm/temporary_xcresult_bundle
error: Using bridging headers with module interfaces is unsupported (in target 'Runner' from project 'Runner')
Command SwiftDriver emitted errors but did not return a nonzero exit code to indicate failure
note: Building targets in dependency order
warning: Run script build phase '[CP-User] Config codegen' will be run during every build because it does not specify any outputs. To address this
warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the
script phase. (in target 'flutter_config' from project 'Pods')
warning: no rule to process file '/Users/wendasai/opt/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_config-2.0.0/ios/Classes/BuildDotenvConfig.rb'
of type 'text.script.ruby' for architecture 'arm64' (in target 'flutter_config' from project 'Pods')
warning: no rule to process file '/Users/wendasai/opt/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_config-2.0.0/ios/Classes/BuildXCConfig.rb' of
type 'text.script.ruby' for architecture 'arm64' (in target 'flutter_config' from project 'Pods')
warning: no rule to process file '/Users/wendasai/opt/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_config-2.0.0/ios/Classes/ReadDotEnv.rb' of type
'text.script.ruby' for architecture 'arm64' (in target 'flutter_config' from project 'Pods')
note: Run script build phase 'Run Script' will be run during every build because the option to run the script phase "Based on dependency analysis" is
unchecked. (in target 'Runner' from project 'Runner')
note: Run script build phase 'Thin Binary' will be run during every build because the option to run the script phase "Based on dependency analysis" is
unchecked. (in target 'Runner' from project 'Runner')
Result bundle written to path:
/var/folders/9p/bw8m2_ns5kx4hppr37mzz1zr0000gn/T/flutter_tools.9yTkx8/flutter_ios_build_temp_dir6Hgplm/temporary_xcresult_bundle
Swift Compiler Error (Xcode): Using bridging headers with module interfaces is unsupported
Uncategorized (Xcode): Command SwiftDriver emitted errors but did not return a nonzero exit code to indicate failure
Encountered error while archiving for device.
The application can be built properly using IOS simulator. So I was expecting it to be built properly as a ipa as weel. But now I really start to get very confuse about why it does not allow me to build the ipa file. Any one have any idea why this is happening? I am trying to compile the ipa for a IOS program I wrote but I have been stuck on this bug for a week... I do not know how to solve this. I googled online and it seems there are no similar solutions... Can anyone help me please! Thank you in advance!
Regards

The build is failing for IOS in flutter

/Users/avinashkasukurthi/Developer/Flutter Projects/zopnote/consumer-app/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 9.0, but the range of supported deployment target versions is 11.0 to 16.1.99. (in target 'gRPC-C++' from project 'Pods')
warning: Run script build phase 'Create Symlinks to Header Folders' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'gRPC-C++' from project 'Pods')
warning: Run script build phase 'Run Script' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'Runner' from project 'Runner')
warning: Run script build phase 'Thin Binary' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'Runner' from project 'Runner')
Result bundle written to path:
/var/folders/vv/l96pnk5d49z96x0w400w0r0m0000gn/T/flutter_tools.jlRzPP/flutter_ios_build_temp_dira4jNaQ/temporary_xcresult_bundle
Could not build the application for the simulator.
Error launching application on iPhone 13.
Please goto Podfile inside that check for this line platform :ios, '9.0'
and change that 9.0 to 11.0 or 12.0 if its commented line then uncomment it.
like this
EDIT
scroll down to end of Podfile and you find something like this
Add this line :
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.0'
Replace all
IPHONEOS_DEPLOYMENT_TARGET = 8.0
or
IPHONEOS_DEPLOYMENT_TARGET = 9.0
with
IPHONEOS_DEPLOYMENT_TARGET = 11.0

Multiple commands produce FirebaseAnalytics.framework build error in React Native

After upgrading to the latest version of React Native (0.70.3) and updating all npm packages including the Firebase dependencies to version 16.1.1, my iOS app fails to build with the below error. Others who experienced similar errors said to look at the Copy Bundle Resources section in Xcode and remove any duplicates from there, but my list doesn't have any duplicates so I'm at a loss as to how to fix this...
note: Building targets in dependency order
error: Multiple commands produce '/Users/justintoth/Library/Developer/Xcode/DerivedData/Marriage365-cvaqfonbgyahhfgjedajduowtwdf/Build/Products/Debug-iphonesimulator/XCFrameworkIntermediates/FirebaseAnalytics/AdIdSupport/FirebaseAnalytics.framework'
note: That command depends on command in Target 'FirebaseAnalytics' (project 'Pods'): script phase “[CP] Copy XCFrameworks”
note: That command depends on command in Target 'FirebaseAnalytics.default-WithoutAdIdSupport' (project 'Pods'): script phase “[CP] Copy XCFrameworks”
warning: duplicate output file '/Users/justintoth/Library/Developer/Xcode/DerivedData/Marriage365-cvaqfonbgyahhfgjedajduowtwdf/Build/Products/Debug-iphonesimulator/XCFrameworkIntermediates/FirebaseAnalytics/AdIdSupport/FirebaseAnalytics.framework' on task: PhaseScriptExecution [CP] Copy XCFrameworks /Users/justintoth/Library/Developer/Xcode/DerivedData/Marriage365-cvaqfonbgyahhfgjedajduowtwdf/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/FirebaseAnalytics.default-WithoutAdIdSupport.build/Script-46EB2E00033070.sh (in target 'FirebaseAnalytics.default-WithoutAdIdSupport' from project 'Pods')
I had the same problem and resolved it with these steps :
Choose whether you want to use Firebase with ou without Support
In my case, I didn't this support, so I've modified the podfile with
Replace the line pod 'Firebase/Analytics' with pod 'Firebase/AnalyticsWithoutAdIdSupport'
Add this line before in your podfile : $RNFirebaseAnalyticsWithoutAdIdSupport = true
build with pod install
It fixed my problem

ios build error: Multiple commands produce on "flutter run" from command line [duplicate]

Flutter iOS build fails after upgrading to Xcode 10.0 version in mac.
Nagendras-MacBook-Pro:uaenumber nagendra$ flutter run
Launching lib/main.dart on iPhone X in debug mode...
Starting Xcode build...
Xcode build done. 1.4s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
error: Multiple commands produce '/Users/dev/Documents/projects/Personal/uaenumber/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/Flutter.framework':
1) Target 'Runner' has copy command from '/Users/dev/Documents/projects/Personal/uaenumber/ios/Flutter/Flutter.framework' to '/Users/dev/Documents/projects/Personal/uaenumber/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/Flutter.framework'
2) That command depends on command in Target 'Runner': script phase “[CP] Embed Pods Frameworks”
warning: The use of Swift 3 #objc inference in Swift 4 mode is deprecated. Please address deprecated #objc inference warnings, test your code with “Use of deprecated Swift 3 #objcinference” logging enabled, and then disable inference by changing the "Swift 3 #objc Inference" build setting to "Default" for the "Runner" target. (in target 'Runner')
warning: ignoring duplicated output file: '/Users/nagendra/Documents/projects/Personal/uaedialer/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/Flutter.framework' (in target 'Runner')
note: Using new build systemnote: Planning buildnote: Constructing build description
Could not build the application for the simulator.
Error launching application on iPhone X.
Xcode Version - 10.0 (10A255)
I tried to recreate the project and copied all the source files to the new project folder but it does not resolve the issue.
This solution worked for me.
Open ios/Runner.xcworkspace Select the Runner project in the project
navigator sidebar.
In the main view, select the Runner target, then select the Build Phases tab.
Expand the Embed Frameworks phase and select Flutter.framework from the
embedded frameworks list.
Click - to remove Flutter.framework from the list (be sure to keep
App.framework).
It's a known issue. Here is the explanation and some workarounds:
https://github.com/flutter/flutter/issues/20685#issuecomment-421511890
Affected projects
This issue affects all Flutter projects built using Xcode 10 that have
a dependency on CocoaPods -- typically this means those that rely on
plugins. Workarounds
There are two workarounds:
Option 1: Use the legacy build system . As noted by #gi097, open ios/Runner.xcworkspace, and change the build system to Legacy Build
System.
Option 2: Use the new Xcode 10 build system.
Open ios/Runner.xcworkspace
Select the Runner project in the project navigator sidebar.
In the main view, select the Runner target, then select the Build Phases tab.
Expand the Embed Frameworks phase and select Flutter.framework from the embedded frameworks list.
Click - to remove Flutter.framework from the list (be sure to keep App.framework).
Root cause
When plugins are in use, there are two competing build actions that
copy Flutter.framework into the build application Frameworks
directory:
The Embed Frameworks build phase for the Runner project
The [CP] Embed Pods Frameworks build phase that pod install creates in the project.
Item (1) is there to ensure the framework is copied into the built app
in the case where there are no plugins (and therefore no CocoaPods
integration in the Xcode project). Item (2) is there because Flutter's
podspec declares Flutter.framework as a vended_framework, and
CocoaPods automatically adds a copy step for each such
vended_framework in the transitive closure of CocoaPods dependencies.
If you have tried everything and still cannot build the Archive successfully, then you look like my case.
It took me 3 business days to fix this. My problem happened after adding the Notification Services target to the project. But it looks like it will apply to many other cases as well:
The problem is caused by the library inside 2 target multiple commands produce. In my case, for example, in the project target and notification extension target, both GoogleUtilities had this causing them to conflict or duplicated the commands produce. The solution is to make that dependency explicit, at the top level.
The pod file will look like this:
platform :ios, '10.0'
use_frameworks!
inhibit_all_warnings!
pod 'GoogleUtilities' // Add this line is very important.
target 'MyProject' do
pod 'Firebase/Analytics'
pod 'Firebase/Crashlytics'
pod 'Firebase/Messaging'
# Other pods
end
target 'NotificationService' do
pod 'Firebase/Messaging'
end
After run:
pod deintegrate
pod install
This issue was fixed by opening the Runner workspace project in Xcode 10. Then navigate to File, Workspace Settings and change the build system to Legacy Build System.
Edit: The latest stable version of Flutter will migrate your Xcode project to the new build system (step one below) and avoid the multiple embedded frameworks warning altogether. If it doesn't, follow the instructions at https://flutter.dev/docs/development/ios-project-migration. You no longer need to edit your Podfile (step two below).
See https://github.com/flutter/flutter/issues/20685#issuecomment-622126064
Previous answer
Open ios/Runner.xcworkspace in Xcode. File > Workspace Settings... > Build System, change dropdown to New Build System (Default)
In your Podfile, add the line
install! 'cocoapods', :disable_input_output_paths => true
3. In your Flutter app, build again to trigger a pod install, which will automatically clean up the build phase
flutter build ios
See:
https://github.com/flutter/flutter/issues/20685#issuecomment-509731873
https://github.com/flutter/flutter/issues/20685#issuecomment-510162863
Warning:
Do not revert to the Xcode deprecated legacy build system to fix this issue as suggested in the other answers.
I faced this problem today and nothing fixed it. Then i check my xcode project and i found that insider runner folder i found another runner show red which was not there before. So i delete that and rerun my project and it fixed my problem.
I try the above method but it didn,t fix my problem. But you can try both to see which one work for you.
Try this:
flutter clean
rm -Rf ios/Pods
rm -Rf ios/.symlinks
rm -Rf ios/Flutter/Flutter.framework
rm -Rf ios/Flutter/Flutter.podspec
rm ios/Podfile
flutter run

#error when compiling flutter app from codemagic

When I am going to compile flutter project to ios from CodeMagic, then build failed with this error.
Xcode's output:
↳
error: Multiple commands produce '/Users/builder/clone/build/ios/Debug-iphoneos/Runner.app/Frameworks/Flutter.framework':
1) Target 'Runner' (project 'Runner') has copy command from '/Users/builder/clone/ios/Flutter/Flutter.framework' to '/Users/builder/clone/build/ios/Debug-iphoneos/Runner.app/Frameworks/Flutter.framework'
2) That command depends on command in Target 'Runner' (project 'Runner'): script phase “[CP] Embed Pods Frameworks”
Please help me to fix this issue.

Resources