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

[iOS] Build Fails when Scheme is set to Release #4210

Closed
idibidiart opened this issue Nov 18, 2015 · 15 comments
Closed

[iOS] Build Fails when Scheme is set to Release #4210

idibidiart opened this issue Nov 18, 2015 · 15 comments
Labels
Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.

Comments

@idibidiart
Copy link

@idibidiart idibidiart commented Nov 18, 2015

Just changed the Scheme to Release based o the hint about disabling debug menu:
https://facebook.github.io/react-native/docs/debugging.html#debugging-react-native-apps

I get this error now with 0.14.2

Developer/Library/Frameworks'
Undefined symbols for architecture arm64:
  "_RCTSetLogFunction", referenced from:
      -[rnpocTests testRendersWelcomeScreen] in rnpocTests.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)```
@idibidiart
Copy link
Author

@idibidiart idibidiart commented Nov 19, 2015

Anyone else ran into this?

@stefanopiovesan
Copy link

@stefanopiovesan stefanopiovesan commented Dec 6, 2015

I have the same issue. No errors with Debug, 2 errors in Release schema
Undefined symbols for architecture armv7: "_RCTSetLogFunction", referenced from: -[myrule1Tests testRendersWelcomeScreen] in myrule1Tests.o ld: symbol(s) not found for architecture armv7

@hasen6
Copy link

@hasen6 hasen6 commented Dec 22, 2015

Getting this as well. No errors running in debug mode but have this error on release along with error "linker command failed with exit code 1 (use -v to see invocation)" in React Native 0.17

@hasen6
Copy link

@hasen6 hasen6 commented Dec 22, 2015

Ok I had dead code stripping enabled to solve a previous error. But with this version, disabling it corrects these other errors and it builds successfully.

@Yukaii
Copy link

@Yukaii Yukaii commented Jan 12, 2016

same issue as well...

@mattcollins
Copy link
Contributor

@mattcollins mattcollins commented Jan 15, 2016

I just hit this issue as well. After disabling dead code stripping (per @hasen6's comment), the build completed successfully.

Here's how I disabled it:

  1. Opened XCode and pressed cmd + 1
  2. Clicked on my project in the left panel, my target in the middle panel
  3. Clicked on "Build Settings"
  4. In the "Linking" section, under the "Dead Code Stripping" section, changed the setting for "Release" from "Yes" to "No"

This is just a workaround, but hopefully helpful if you're also hitting this.

@chenyu1520
Copy link

@chenyu1520 chenyu1520 commented Jan 18, 2016

@mattcollins Nice!

@calvinf
Copy link

@calvinf calvinf commented Feb 13, 2016

I ran into the same issue and had to disable dead code stripping, too.

@calvinf
Copy link

@calvinf calvinf commented Feb 13, 2016

I found a solution to the problem in the comments for a previous issue:
#2685 (comment)

I believe this issue can be closed as a duplicate.

@janicduplessis
Copy link
Collaborator

@janicduplessis janicduplessis commented Apr 11, 2016

@facebook-github-bot duplicate #2685

@facebook-github-bot
Copy link
Contributor

@facebook-github-bot facebook-github-bot commented Apr 11, 2016

@janicduplessis tells me this issue is a duplicate of #2685. Let's discuss there, closing this one.

@facebook-github-bot facebook-github-bot added the Ran Commands One of our bots successfully processed a command. label Apr 11, 2016
@MiLeung
Copy link

@MiLeung MiLeung commented Jul 15, 2016

@mattcollins Your solution doesn't seem to work on 0.29.0. I've also noticed that Facebook changed the docs for building app for production.

@longsangstan
Copy link

@longsangstan longsangstan commented Jul 18, 2016

HI,
I have the same problem but
-it says architecture i386 instead of arm64
-it only happens when i choose iphone 5/4s simulators; other version such as 5s/6/6s don't have the problem

I tried the dead code stripping and add libReact.a to TESTS, both of them are not working for me.

Have anyone had the same problem?

@khaire1111
Copy link

@khaire1111 khaire1111 commented Oct 21, 2016

Yes I have same problem

  • I create objective-c custom framework and import to my project it's working 100% for debug mode.
  • But whenever I build for release mode and import to my project it is getting error only for iPhone 4s, iPhone 5 and iPad 2 otherwise it's working for all.
  • Error like this - Undefined symbols for i386 or x86_64.

Please anyone tell me solution..

@patrickeddy
Copy link

@patrickeddy patrickeddy commented Jul 7, 2018

If you're trying to run a release scheme on a device/sim, this can also be fixed by editing your scheme:

  1. Product > Scheme > Edit Scheme
  2. Click Build
  3. Uncheck Run checkbox from Tests

This way the tests aren't run when running for release, as the dead code has been stripped.

@facebook facebook locked as resolved and limited conversation to collaborators Jul 20, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 20, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests