Skip to content
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

Unable To Start iOS App After Install #34

Open
coreyphillips opened this issue Jul 14, 2021 · 6 comments
Open

Unable To Start iOS App After Install #34

coreyphillips opened this issue Jul 14, 2021 · 6 comments

Comments

@coreyphillips
Copy link

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.

@gabidi
Copy link
Contributor

gabidi commented Jul 14, 2021

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:
facebook/react-native#31179 (comment)

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.

@coreyphillips
Copy link
Author

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.

@gabidi
Copy link
Contributor

gabidi commented Jul 17, 2021

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
Copy link
Contributor

gabidi commented Jul 17, 2021

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
Copy link
Contributor

gabidi commented Jul 17, 2021

Created separate issue for these instructions for posterity.
#37

@coreyphillips
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants