-
Notifications
You must be signed in to change notification settings - Fork 24.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[iOS] Build fails with error duplicate symbols for architecture x86_64 #27840
Comments
I'm having this issue as well! |
This comment has been minimized.
This comment has been minimized.
Have you reached out to Expo yet? |
Hey @hramos, thanks for your response! I did, currently waiting for a response. |
It's been three weeks since we asked for additional information from the author of this issue. As it happens, we don't have enough information to take action. We are going to close this issue, but please do not hesitate to open a new issue if you are still encountering this problem. |
Still having the same issue, this shouldn't be closed! |
Also having this issue |
this helped me
|
@pdorney can you share more information here so we can identify the problem? |
@Priyatham51 thanks! already tried this, but it doesn't work |
@pedro-lb Pedro, any luck? I'm stuck on the same issue and nothing seems to resolve it. Happened after upgrading from 0.61.5 to 0.62.2.... super frustrating. Been stuck on it for 2 days now |
Hey @mstankov ! Fortunately we've been able to solve the issue! 💯 To solve this you're going to need to modify files inside your 1. Identifying conflicted libsFirst, you need to identify which libs are conflicting - you can do this by checking the error details in XCode. In our case, these libs were generating conflicts:
2. Patching errorsNext up you'll need to patch some module files.
packages.each do |package_name, package|
packages.each do |package_name, package|
+
+ # PATCH TO DISABLE CONFLICTING MODULES (duplicate symbols)
+ puts ">> package_name #{package_name}"
+
+ next if %w(
+ react-native-screens
+ @react-native-community/masked-view
+ react-native-safe-area-context
+ # ADD ANY MORE CONFLICTING DEPENDENCIES HERE
+ # OR REMOVE THE DEPS ABOVE IF THEY ARE NOT CONFLICTING
+ ).include(package_name)
+
+ # PATCH END 3. Update dependencies
rm -rf Podfile.lock Pods/
pod install 4. Rebuild the project in XCode
Should build normally! 🚀 5. Improving your experience with patch-packageSince it's necessary to add a change to a file inside We're going to use
yarn add patch-package
In package.json "scripts": {
+ "postinstall": "patch-package"
}
npx patch-package @react-native-community/cli-platform-ios Then commit the patch to your repo. git add .
git commit -m "Patch iOS build" Done! Your build should work normally now in iOS and every developer should be able to build your repo without fiddling with If you have any problems please let me know and we'll sort it out. Cheers! |
@pedro-lb you're a lifesaver, thank you |
No problems! I'll close this for now since it's been resolved. |
These steps worked for me
|
hi @pedro-lb i followed your steps till step 3 where after updating the # PATCH TO DISABLE CONFLICTING MODULES (duplicate symbols)
puts ">> package_name #{package_name}"
next if %w(
react-native-tcp
# ADD ANY MORE CONFLICTING DEPENDENCIES HERE
# OR REMOVE THE DEPS ABOVE IF THEY ARE NOT CONFLICTING
).include(package_name)
# PATCH END the pod install comes with error of ➜ wepico npx pod-install
npx: installed 1 in 1.177s
Scanning for pods...
1.10.0
> pod install
>> package_name @react-native-community/async-storage
[!] Invalid `Podfile` file: undefined method `include' for #<Array:0x00007f90e60a0dd8>
Did you mean? include?.
# from /Users/ravi/study/wepico/ios/Podfile:7
# -------------------------------------------
# target 'wepico' do
> config = use_native_modules!
#
# -------------------------------------------
Aborting run
An unexpected error was encountered. Please report it as a bug:
Error
at CocoaPodsPackageManager._installAsync (/Users/ravi/.npm/_npx/25609/lib/node_modules/pod-install/build/index.js:2:85721)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async CocoaPodsPackageManager.installAsync (/Users/ravi/.npm/_npx/25609/lib/node_modules/pod-install/build/index.js:2:85121)
at async runAsync (/Users/ravi/.npm/_npx/25609/lib/node_modules/pod-install/build/index.js:2:12925)
at async /Users/ravi/.npm/_npx/25609/lib/node_modules/pod-install/build/index.js:2:13011 |
I have same issue with @react-native-community/clipboard. |
hi @samaneh-kamalian actually my project uses react-native-tcp and react-native-udp which are both deprecated and required me to remove the CocoaAsyncSocket from the compile source or basically remove the file
but i dont think this solution will work for you |
Try this, It's working for me
|
Detailed answer |
ExpoKit iOS build error: duplicated symbols for architecture x86_64
🐛 Bug Report
https://github.com/pedro-lb/expokit-duplicated-symbols
Details:
When trying to build the app for iOS on XCode, the following error is thrown:
React Native version:
Target: iOS
Steps To Reproduce
Clone our repo that reproduces the problem:
git clone https://github.com/pedro-lb/expokit-duplicated-symbols
Follow setup guide:
yarn install
.ios
directory and runpod install
:cd ios && pod install
.yarn start --clear
.Build
(or hit⌘ + B
).You should hit the error:
duplicate symbols for architecture x86_64
.Describe what you expected to happen:
The app builds successfully and works.
Snack, code example, screenshot, or link to a repository:
https://github.com/pedro-lb/expokit-duplicated-symbols
Solutions already attempted:
We've tried a few fixes as listed below.
❌ Upgrading to XCode 10's new build system:
Yeah, we're late to the party and still using the old build system. Although when trying to use the new one, the same error still happens and it doesn't build.
❌ Manually removing conflics in
Podfile
:We've tried to manually remove conflicting links on a
post-install hook
in ourPodfile
. The script looks as below.The links were removed but that solution does not work. Same error happens (duplicate symbols for architecture x86_64).
❌ Disabling
autolink
for conflicting dependencies onreact-native.config.js
:By disabling React Native's autolink for the conflicting dependencies in
react-native.config.js
file, the project still does not build, and a new error appears.A new error happens when trying to build:
❌ Removing conflicting dependencies from
package.json
:By removing the conflicting dependencies below from
package.json
and re-installing our modules and pods (by running the commands below).On this repository, the project builds and works correctly! But I guess this happens since we don't really use these dependencies here (they were just installed via
yarn add
). On our project another error happens during build, since we actually import and use these dependencies:❌ Tinkering with XCode build settings:
We've tried to change a few XCode build settings as mentioned in a few Stack Overflow posts, but none of them worked.
-ObjC
flagOther Linker Flags
in XCodeBuild Settings
: It builds! But doesn't work as stated in its topic below.No Common Blocks
toNO
underBuild Settings
.Enable Testability
toNO
underBuild Settings
.Link Binary with Libraries
underBuild Phases
.Compile Sources
underBuild Phases
.Libraries
folder in XCode.❓ Removing
-ObjC
flag inOther Linker Flags
under XCode'sBuild Settings
:By removing
-ObjC
flag fromOther Linker Flags
(located inBuild Settings
) on XCode, the project builds!...but it immediately force-closes after opening 😞. The error below pops up.
When looking at the exception that caused the app to crash with Mac OS
console
:Apparently,
-ObjC
is necessary to correctly build all the dependencies.❌ Add React dependencies to
Podfile
:When seeing the error above, while still without
-ObjC
flag inOther Linker Flags
under XCode'sBuild Settings
, we've tried adding the missing pods as described above (Did you forget to use RCT_EXPORT_MODULE()?
) in ourPodfile
:and we've also tried with:
After running
rm -rf Podfile.lock Pods && pod install
, we've tried to build, but the same error happens.The text was updated successfully, but these errors were encountered: