Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebase react-native iOS build fails with "-fobjc-weak is not supported on the current deployment target"

If I try to run my react-native app from XCode, xcode fails with the message:

-fobjc-weak is not supported on the current deployment target

If I run from a shell react-native run-ios, then I get also an error message:

** BUILD FAILED **

The following build commands failed: CompileC /Users/michel/Development/Androdev/Firebase/Sample/FlightLogIos/ios/build/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/nanopb.build/Objects-normal/x86_64/nanopb-dummy.o Target\ Support\ Files/nanopb/nanopb-dummy.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler

(1 failure)

However, the app still runs. It is annoying though as I think I will have at some point to do some Objective C code for my project. Does anybody know how to resolve this issue?

like image 865
Michel Lesoinne Avatar asked Feb 03 '18 21:02

Michel Lesoinne


2 Answers

I'm using Firebase in a regular, non-react-native Xcode project. I had the same error when building nanopb target. When I checked settings, deployment target for nanopb was set to 4.3. Just updating it to something more recent, like 9.0 fixed this error for me.

like image 90
Vladimir Grigorov Avatar answered Nov 20 '22 08:11

Vladimir Grigorov


i just ran into the same problem. i fixed it for me by increasing the ios deployment target of the nanopb target to iOS 8.0 (its 4.3 per default). Pods Project -> target: nanopb -> iOS Deployment Target: iOS 8.0

like image 31
Shubham Avatar answered Nov 20 '22 06:11

Shubham