react-native-tor icon indicating copy to clipboard operation
react-native-tor copied to clipboard

Unable To Start iOS App After Install

Open coreyphillips opened this issue 3 years ago • 6 comments

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.

coreyphillips avatar Jul 14 '21 03:07 coreyphillips

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.

gabidi avatar Jul 14 '21 10:07 gabidi

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.

coreyphillips avatar Jul 14 '21 13:07 coreyphillips

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:

  1. npx create-react-native-app tor-test .Checking package.json we're using "react-native": "~0.63.4",
  2. yarn ios (runs successfully)
  3. yarn add https://github.com/Sifir-io/react-native-tor.git#feat/hs (latest branch)
  4. cd ios
  5. make sure platform version matches minimum for rn tor:
--- a/ios/Podfile
+++ b/ios/Podfile

-platform :ios, '11.0'
+platform :ios, '11.1'
  1. pod install
  2. yarn ios (Fails with errors)
  3. Open xcode -> Open project of File -> tor-test/ios
  4. Right click on tortest project -> add new file -> swift file and choose to 'create bridging header`
  5. Click on tortest project in left navigation pane, go to build settings and a. search for 'Bitcode' and set Enable bitcode to false b. search for 'Always embed Swift standard libraries` and set to 'Yes'
  6. Clean build folder (shift + command + k) and close xcode
  7. 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..
  8. 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

gabidi avatar Jul 17 '21 12:07 gabidi

Test 2 React 0.64.1 and npm:

  1. npx react-native init tortest2 --template react-native-template-typescript

  2. cat package.json | jq -r '.dependencies["react-native"]' shows 0.64.1

  3. npm i https://github.com/Sifir-io/react-native-tor.git#feat/hs

  4. Repeat steps 5-11 in previous comment (using npm instead of yarn if you wish) 4.npm run ios fails to build with Swift._ArrayBuffer error indicated in issue.

  5. Back to terminal

  6. cd ios

  7. vim Podfile , comment out use_flipper!() line (~ line 24 of Podfile)

  8. in Xcode search for LIBRARY_SEARCH_PATHS and remove the entry $(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)

  9. Clean build folder and close xcode.

  10. Do 11. Clean everything from previous comment.

  11. npm run ios app builds and compiles :)

gabidi avatar Jul 17 '21 16:07 gabidi

Created separate issue for these instructions for posterity. https://github.com/Sifir-io/react-native-tor/issues/37

gabidi avatar Jul 17 '21 18:07 gabidi

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.

coreyphillips avatar Jul 20 '21 03:07 coreyphillips