React-native-image-crop-picker: Build failed, no such file libReact.a

Created on 13 Jul 2016  路  26Comments  路  Source: ivpusic/react-native-image-crop-picker

Hi @ivpusic , I have a problem when using this package in IOS. Pod install is successful, no warnings. But when I run my project(.xcworkspace) in xcode, an error shows:

clang: error: no such file or directory: '/Users/kw/Library/Developer/Xcode/DerivedData/test-fohpnlfelwvgtiaczpjponpxpgyd/Build/Products/Debug-iphonesimulator/libReact.a'

Most helpful comment

@chrise86 got the error again and this fixed it properly.

Go to your build phases and remove libReact.a from the linked libraries. Then add libReact.a but select this one:

libReact.a from 'React' target in 'Pods' project

All 26 comments

@kiliwalk how did you fix it?

@superandrew213 I did nothing essential and useful about this. It's weird.
But I could tell you what I did before working:

  • Close xcode
  • Open .xcproject, and goto menu File->Project Setting to see the Derived Data setting. (Nothing changed here)
  • Open .xcworkspace

Hope these can help you

I had to add -lc++ to Other Linker Flags for my MyProjectTest target and everything worked again. This flag was already set to MyProject target out of the box.

Deleting derived data in File->Project Setting and restarting Xcode seems to do the trick

I'm still getting this issue even after removing derived data, adding that linker flag and removing the workspace file and re-installing pods. Any ideas? 馃槙

After removing the derived data (and cleaning, both methods) I get the following:

clang: error: no such file or directory: '/Users/chrisedwards/Library/Developer/Xcode/DerivedData/MyProject-dkunkoutwayvdrfwaifiyxrygrch/Build/Products/Debug-iphoneos/libReact.a'
clang: error: no such file or directory: '/Users/chrisedwards/Library/Developer/Xcode/DerivedData/MyProject-dkunkoutwayvdrfwaifiyxrygrch/Build/Products/Debug-iphoneos/libRCTActionSheet.a'
clang: error: no such file or directory: '/Users/chrisedwards/Library/Developer/Xcode/DerivedData/MyProject-dkunkoutwayvdrfwaifiyxrygrch/Build/Products/Debug-iphoneos/libRCTGeolocation.a'
clang: error: no such file or directory: '/Users/chrisedwards/Library/Developer/Xcode/DerivedData/MyProject-dkunkoutwayvdrfwaifiyxrygrch/Build/Products/Debug-iphoneos/libRCTImage.a'
clang: error: no such file or directory: '/Users/chrisedwards/Library/Developer/Xcode/DerivedData/MyProject-dkunkoutwayvdrfwaifiyxrygrch/Build/Products/Debug-iphoneos/libRCTLinking.a'
clang: error: no such file or directory: '/Users/chrisedwards/Library/Developer/Xcode/DerivedData/MyProject-dkunkoutwayvdrfwaifiyxrygrch/Build/Products/Debug-iphoneos/libRCTNetwork.a'
clang: error: no such file or directory: '/Users/chrisedwards/Library/Developer/Xcode/DerivedData/MyProject-dkunkoutwayvdrfwaifiyxrygrch/Build/Products/Debug-iphoneos/libRCTSettings.a'
clang: error: no such file or directory: '/Users/chrisedwards/Library/Developer/Xcode/DerivedData/MyProject-dkunkoutwayvdrfwaifiyxrygrch/Build/Products/Debug-iphoneos/libRCTText.a'
clang: error: no such file or directory: '/Users/chrisedwards/Library/Developer/Xcode/DerivedData/MyProject-dkunkoutwayvdrfwaifiyxrygrch/Build/Products/Debug-iphoneos/libRCTVibration.a'
clang: error: no such file or directory: '/Users/chrisedwards/Library/Developer/Xcode/DerivedData/MyProject-dkunkoutwayvdrfwaifiyxrygrch/Build/Products/Debug-iphoneos/libRCTWebSocket.a'

After clearing derived data as mentioned above, then setting Build -> Architectures -> Build Active Architecture Only to Yes it clears the 20 errors above but I'm straight back to the initial:

clang: error: no such file or directory: '/Users/chrisedwards/Library/Developer/Xcode/DerivedData/MyProject-dkunkoutwayvdrfwaifiyxrygrch/Build/Products/Debug-iphoneos/libReact.a'

I've noticed that the file exists, but is in fact in

/Users/chrisedwards/Library/Developer/Xcode/DerivedData/MyProject-dkunkoutwayvdrfwaifiyxrygrch/Build/Products/Debug-iphoneos/React/libReact.a

How do I get this to run with the correct location?

So I just reset all changes (via git), cleaned and tried again and it started working... no idea why.

@chrise86 did you restart Xcode? After cleaning everything, restarting Xcode made it work for me.

I can reproduce this problem in my project now:

  1. See project name RNTest, open RNTest. xcworkspace, and select the target device to a simulator(say iPhone 6)
  2. Edit the RNTest scheme(press CMD+SHIFT+< or Product->Scheme->Edit Scheme), change Build Configuration to Release
  3. Build the project(from Product->Build), the error occurs!

After change the Build Configuration to Debug and rebuild, it's ok.

And after I check more cases(Build Configuration and target devices), only simulator with Release build configuration will cause this problem. I'm confused with that.

@superandrew213 I restarted Xcode multiple, multiple times - it's THE go-to solution with Xcode 馃槈, but in this case it didn't work. I edited a load of stuff in Xcode to try and make it work, none of which did, then reset all the changes I'd made, cleaned (again) and it magically worked. Very strange

@chrise86 got the error again and this fixed it properly.

Go to your build phases and remove libReact.a from the linked libraries. Then add libReact.a but select this one:

libReact.a from 'React' target in 'Pods' project

@superandrew213, You're the best!

Cheers @superandrew213 ! Resolved that error, now onto the next :)

After updating libReact.a in the linked libraries as per @superandrew213, I had to re-run pod install in my particular situation. Seems like these types of errors can result from various & sundry moving parts, usually involving a change to or addition of a native library.

@superandrew213
I cannot find libReact.a from 'React' target in 'Pods' project
what do i missing?

I was facing the same issue as I had space one of the folder name. Once I deleted the space it started working for me.

@giangqaz Did you manage to find a solution?

@ @giangqaz did you find a solution?

@superandrew213 Spasibo, bratan :)

after trying many previous answers, this is the answer that solved the problem for me:

  1. Select Target project
  2. Under Build Phases
  3. Select Target Dependencies
  4. Add the missing library and compile
    and it worked for me. This answer was given by Ken Van

Hope it help someone

after trying many previous answers, this is the answer that solved the problem for me:

  1. Select Target project
  2. Under Build Phases
  3. Select Target Dependencies
  4. Add the missing library and compile
    and it worked for me. This answer was given by Ken Van

Hope it help someone

perfect solution it works, thank you

i just simply do pod install in my ios/ folder

@chrise86 got the error again and this fixed it properly.

Go to your build phases and remove libReact.a from the linked libraries. Then add libReact.a but select this one:

libReact.a from 'React' target in 'Pods' project

Thanksssss!

Despu茅s de probar muchas respuestas anteriores, esta es la respuesta que resolvi贸 el problema para m铆:

  1. Seleccionar proyecto de destino
  2. Bajo fases de construcci贸n
  3. Seleccionar dependencias objetivo
  4. Agregue la biblioteca que falta y compile
    y funcion贸 para m铆. Esta respuesta fue dada por Ken Van

Espero que ayude a alguien

Thanks...

I can reproduce this problem in my project now:

  1. See project name RNTest, open RNTest. xcworkspace, and select the target device to a simulator(say iPhone 6)
  2. Edit the RNTest scheme(press CMD+SHIFT+< or Product->Scheme->Edit Scheme), change Build Configuration to Release
  3. Build the project(from Product->Build), the error occurs!

After change the Build Configuration to Debug and rebuild, it's ok.

And after I check more cases(Build Configuration and target devices), only simulator with Release build configuration will cause this problem. I'm confused with that.

Same case, no error in debug but in the release, what is the solution?

after trying many previous answers, this is the answer that solved the problem for me:

  1. Select Target project
  2. Under Build Phases
  3. Select Target Dependencies
  4. Add the missing library and compile
    and it worked for me. This answer was given by Ken Van

Hope it help someone

This solved it for me, thanks man, after more than a week of debugging

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sergiulucaci picture sergiulucaci  路  3Comments

victorwpbastos picture victorwpbastos  路  3Comments

leelandclay picture leelandclay  路  3Comments

cwRichardKim picture cwRichardKim  路  3Comments

xuchao321 picture xuchao321  路  3Comments