Symbol(s) not found for architecture arm64 - XCode
For react-native 0.67+: After a lot of research, I found the next solution from Vegaro:
SOLUTION LINK
First step is to upgrade the react-native-purchases by Revenuecat package to the latest version.
Clean your pods:
REFERENCE LINK TO PROPERLY CLEAN PODS
Declare a pods post install process:
Add the next to your Podfile:
post_install do |installer|
react_native_post_install(installer)
fix_library_search_paths(installer)
end
end
def fix_library_search_paths(installer)
def fix_config(config)
lib_search_paths = config.build_settings["LIBRARY_SEARCH_PATHS"]
if lib_search_paths
if lib_search_paths.include?("$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)") || lib_search_paths.include?("\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)\"")
# $(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME) causes problem with Xcode 12.5 + arm64 (Apple M1)
# since the libraries there are only built for x86_64 and i386.
lib_search_paths.delete("$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)")
lib_search_paths.delete("\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)\"")
if !(lib_search_paths.include?("$(SDKROOT)/usr/lib/swift") || lib_search_paths.include?("\"$(SDKROOT)/usr/lib/swift\""))
# however, $(SDKROOT)/usr/lib/swift is required, at least if user is not running CocoaPods 1.11
lib_search_paths.insert(0, "$(SDKROOT)/usr/lib/swift")
end
end
end
end
projects = installer.aggregate_targets
.map{ |t| t.user_project }
.uniq{ |p| p.path }
.push(installer.pods_project)
projects.each do |project|
project.build_configurations.each do |config|
fix_config(config)
end
project.native_targets.each do |target|
target.build_configurations.each do |config|
fix_config(config)
end
end
project.save()
end
end
React Native on Apple Silicon M1 - The linked library 'libPods-ProjectName.a' is missing one or more architectures required by this target: x86_64
I had the same issue and finally, I fixed it. There are 2 main reasons for the errors:
arm64
architecture support & and Xcode 12 compatible version have not been provided by many popular third party libraries yet (like Firebase, AFNetworking, etc). Xcode 11 used to automatically translate building for arm64 for the simulator into building forx86_64
, but now thatarm64
is a valid simulator architecture (it’s the Apple Silicon architecture), that translation no longer occurs.Because the Valid Architectures build setting has been removed from Xcode 12, the Project file, opened in Xcode 12, will auto-generate a
VALID_ARCHS
macro in User-Defines, and this macro will make the build fail.
I follow all steps in this post: https://medium.com/@khushwanttanwar/xcode-12-compilation-errors-while-running-with-ios-14-simulators-5731c91326e9
Final step was updating all pods by running below command inside the project folder:
pod deintegrate
pod update
Then I exclude the arm64
for the Simulator architecture, both from main project and the Pod project.
Clean the project (⇧ + ⌘ + k) then run.
Widget Extension UnitTest Error: Undefined Symbol: nominal type descriptor for [...].
I've found a solution, which feels like a workaround, but does the job:
- Define
MyStruct
as well in the main app target with target membershipMyApp
- In the UnitTest use
@testable import MyApp
in order to be able to useMyStruct
from the app target
Now the compiler does not complain anymore.
The linked framework 'Pods_Runner.framework' is missing one or more architectures required by this target: x86_64
I had the same issue on my M1 Mac and here is what I did to fix this:
sudo arch -x86_64 gem install ffi
- add this code at the end of the pod file which is inside ios folder:
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings["ONLY_ACTIVE_ARCH"] = "NO"
end
end
end
cd ios/ && arch -x86_64 pod install
.run Xcode with Rosetta.
.
You can install Rosetta by running:softwareupdate --install-rosetta
exclude architecture arm64.
clean build - open xcode then press Command + Shift + K
- If you're using
nvm
try to replaceNODE_BINARY=node
with the actual result of thewhich node
command, which in my case looks something like this:
Shoutout to these answers:
one two three
Remove all div tags from string php regex?
No. You do NOT ever parse/manipulate HTML with regexes.
Regexes cannot be bargained with. They can't be reasoned with. They don't understand html, they don't grok xml. And they absolute will NOT stop until your DOM tree is dead.
You use htmlpurifier and/or DOM to manipulate the tree.
How can I get the name of the listbox that a stackpanel is in?
Updated (working) answer
You need to walk up the visual tree with VisualTreeHelper.GetParent
on the StackPanel
, and if necessary recurse over further parents, until you find the ListBox
(use the as
or is
operator to detect that you have found it).
For added convenience, or if you need to traverse the tree in other directions (which is a bit more involved), you can use a wrapper that exposes the traversal in a LINQy format such as this one.
All this said, you might also want to take a look at How can I find WPF controls by name or type?.
Related Topics
What Is the Impact of the "Requires Full Screen" Option in Xcode for an Iphone-Only App
Getting a Thumbnail of a *.Mov Video iOS
Share Video on Twitter with Fabric API Without Composer iOS
Alphabetical Sections in Table Table View in Swift
Custom View Which Looks Like Uialertview
Xcode: How to Change Layout of Views Between Landscape and Portrait Mode
Using Cocoapods in an App Extension Using a Framework
Uiscrollview Not Scrolling Regardless of Large Contentsize
Latitude and Longitude Points from Mkpolyline
Import Framework in Swift Project, Xcode
Sqlite Database on Phonegap/iOS - More Than 5Mb Possible
Orienting iOS Splash Image to Landscape/Portrait According to Launch Orientation
Opening Testflight App from Another App and Deep Link to Specific App
iOS - Uisplitviewcontroller with Storyboard - Multiple Master Views and Multiple Detail Views
How to Increase Width of Textfield According to Typed Text