react-native-tor
react-native-tor copied to clipboard
Unable To Start iOS App After Install
Description
Similar to #33, I'm currently unable to start the iOS version of the app after running yarn add react-native-tor && cd ios && pod install
React Native Version: 0.64.2
Steps To Reproduce
react-native init RNTor && cd RNTor && yarn install && yarn add react-native-tor && cd ios && pod install && cd ../ && react-native run-ios
Expected Behavior
The default RN app launches successfully.
Actual Behavior
I receive the following error:
Undefined symbols for architecture x86_64:
"Swift._ArrayBuffer._copyContents(initializing: Swift.UnsafeMutableBufferPointer<A>) -> (Swift.IndexingIterator<Swift._ArrayBuffer<A>>, Swift.Int)", referenced from:
generic specialization <serialized, Swift._ArrayBuffer<Swift.Int8>> of Swift._copyCollectionToContiguousArray<A where A: Swift.Collection>(A) -> Swift.ContiguousArray<A.Element> in libreact-native-tor.a(Tor-b4d6acbd6b5ec7d73fd7b3fc66a4ebc8db24032aa6c0d4e67fb7ae301915ed41.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I also bumped the target version around in the Podfile with no luck.
Hi Corey, What version of Xcode are you on ? I've had a similar issue recently while trying to add RN Tor to a fresh RN 0.64.1 app with Xcode version (12.5.1), i resolved it by following: https://github.com/facebook/react-native/issues/31179#issuecomment-829536845
Steps 3 and onwards are relevant. Note: It's important to reset cache and reinstall everything after making the suggested changes.
However, The example App included with this repo is running RN 0.62.3 and still compiles fine for me for iOS/Android.
Let me know if the above helps.
Hey gabidi, I'm currently running Xcode Version 12.5.1 (12E507).
Thanks for forwarding over the reference link. I ran through the provided steps and unfortunately, still receive the same error.
I'm also able to get react-native-tor to build and work as expected on older RN versions such as v062.3, so it must be something about the latest version (0.64.2) that's causing it to install incorrectly.
Hey Corey, so i just did a fresh step by step react app create and added Rn tor, i got it to compile by using the following steps:
-
npx create-react-native-app tor-test
.Checkingpackage.json
we're using"react-native": "~0.63.4",
-
yarn ios
(runs successfully) -
yarn add https://github.com/Sifir-io/react-native-tor.git#feat/hs
(latest branch) -
cd ios
- make sure platform version matches minimum for rn tor:
--- a/ios/Podfile
+++ b/ios/Podfile
-platform :ios, '11.0'
+platform :ios, '11.1'
-
pod install
-
yarn ios
(Fails with errors) - Open xcode -> Open project of File -> tor-test/ios
- Right click on
tortest
project -> add new file -> swift file and choose to 'create bridging header` - Click on
tortest
project in left navigation pane, go to build settings and a. search for 'Bitcode' and setEnable bitcode
to false b. search for 'Always embed Swift standard libraries` and set to 'Yes' - Clean build folder (shift + command + k) and close xcode
- Go back to terminal and clean everything:
a.
rm -rf node_modules
b.cd ios && rm -rf Pods Podfile.lock
c.cd ..
d.yarn
e.cd ios && pod install
f.cd..
-
yarn ios
App builds and runs :)
System info: Xcode Version 12.5.1 (12E507) MacOs BigSur 11.3 (20E232) react-native ~0.63.4 pod --version -> 1.10.1
Test 2 React 0.64.1 and npm:
-
npx react-native init tortest2 --template react-native-template-typescript
-
cat package.json | jq -r '.dependencies["react-native"]'
shows0.64.1
-
npm i https://github.com/Sifir-io/react-native-tor.git#feat/hs
-
Repeat steps
5-11
in previous comment (usingnpm
instead ofyarn
if you wish) 4.npm run ios
fails to build withSwift._ArrayBuffer
error indicated in issue. -
Back to terminal
-
cd ios
-
vim Podfile
, comment outuse_flipper!()
line (~ line 24 of Podfile) -
in Xcode search for
LIBRARY_SEARCH_PATHS
and remove the entry$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)
-
Clean build folder and close xcode.
-
Do
11. Clean everything
from previous comment. -
npm run ios
app builds and compiles :)
Created separate issue for these instructions for posterity. https://github.com/Sifir-io/react-native-tor/issues/37
Hey gabidi, thank you for the information and steps you used for installation. I went through the instructions a number of times and still receiving the same error as before, unfortunately. It is possible that it's a config issue on my end, but will continue to try and tweak some of the steps as needed.