Reputation: 917
I get a problem to build release react native ios, I try to look for many examples, but fail all.
This is the error message :
Undefined symbols for architecture armv7:
"_RCTDefaultLogFunction", referenced from:
-[momsindonesiaTests testRendersWelcomeScreen] in momsindonesiaTests.o
"_RCTSharedApplication", referenced from:
-[momsindonesiaTests testRendersWelcomeScreen] in momsindonesiaTests.o
"_RCTSetLogFunction", referenced from:
-[momsindonesiaTests testRendersWelcomeScreen] in momsindonesiaTests.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I don't know how to solve this error again, please help me to solve this problem.
Thanks.
Upvotes: 5
Views: 4846
Reputation: 13758
armv7
architecture is stopped supporting by iOS devices from iPhone 5s and today you might not support it as well but the latest iOS SDK still can compile armv7
for backward compatibility.
To exclude armv7
from your compilation process you can set ONLY_ACTIVE_ARCH
to YES
for all your and React Native targets. This settings enables compiling arm64
arch for devices and x86_64
arch for simulators only. For instance, you can add next code to your Podfile to set this settings automatically on pod install
:
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ONLY_ACTIVE_ARCH'] = 'YES'
end
end
end
Upvotes: 0
Reputation: 145
I had the same issue with Xcode 10.1 and react native 0.61.5. To fix try this.
Hope this solution works for you as well.
Upvotes: 1