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

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'

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 26 (4 by maintainers)

Most upvoted comments

@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 I cannot find libReact.a from 'React' target in 'Pods' project what do i missing?

@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

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

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

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.

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

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.

@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!

i just simply do pod install in my ios/ folder

@superandrew213, You’re the best!

@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

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?