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

clang: error: no such file or directory libRNCPushNotificationIOS.a #17

Closed
ghost opened this issue Jul 29, 2019 · 48 comments · Fixed by #19
Closed

clang: error: no such file or directory libRNCPushNotificationIOS.a #17

ghost opened this issue Jul 29, 2019 · 48 comments · Fixed by #19

Comments

@ghost
Copy link

ghost commented Jul 29, 2019

Bug

When you try to make a build or archive in Xcode 10.2

Environment info

RN : 0.59.10
Xcode: 10.2.1
React native info output:

clang: error: no such file or directory: '/Users/xxx/Library/Developer/Xcode/DerivedData/xxx-ewerqswkditpomciyhywhltemfhd/Build/Products/Release-iphoneos/libRNCPushNotificationIOS.a'
Command Ld failed with a nonzero exit code

Library version: Latest

Steps To Reproduce

  1. Add libRNCNotificationPush.a to Link Binary
  2. Build the project
    ...

Describe what you expected to happen:

1.Succes

@AbdoHema2016
Copy link

I faced this Problem and after few hours heres what worked for me,

  1. remove the PushNotificationIOS.xcodeproj from my project
    2.cleaned and build the project
    3.added the PushNotificationIOS.xcodeproj , libRNCNotificationPush.a and made sure that the iOS header search path on build settings is set to the right path with recursive "$(SRCROOT)/../node_modules/@react-native-community/push-notification-ios/ios"
    4.build the project and again and thats it

@LuisBonsembiante
Copy link

Same problem and not work for me your solution @AbdoHema2016

@LuisBonsembiante
Copy link

For sure the problem is in this library.. Im back with not community version and all working fine..!!!!!!

@LeoMoonStar
Copy link

@LuisBonsembiante what u mean but not community version?

@LuisBonsembiante
Copy link

@LeoMoonStar I mean the React version...

@cuimin0609
Copy link

Please set the iOS deployment Target of PushNotificationIOS project same wit the deployment target of your app.

They set it to iOS 12.1, my app deployment target was iOS 9.0 and I set deployment Target of PushNotificationIOS project to iOS 9.0 in build settings.

That fixed my issue.

@LuisBonsembiante
Copy link

Guys I appreciate if you give some help about the local notification in background iOS mode.... It si posible?

@AnechaS
Copy link

AnechaS commented Aug 6, 2019

not work run release have a problem

@cuimin0609
Copy link

not work run release have a problem

Yes, debug (react-native run-ios) has no problem.

Only Release build has this issue. You have to set the deployment target of PushNotificationIOS project same with your app's.

@LeoMoonStar
Copy link

@LeoMoonStar I mean the React version...

so you choose one lower version of react native?

@LuisBonsembiante
Copy link

LuisBonsembiante commented Aug 7, 2019

@LeoMoonStar is not a lower version is the version that yoy have in react-native/Librarries/push-notification-ios.. I dont know if this version is in mantaining..but work.. of course not in background

@spacewaffle
Copy link

@cuimin0609 your solution worked for me, thanks!

@varungupta85
Copy link
Contributor

I am also observing this error. I have verified that the iOS Deployment Target is set correctly for the project. I have also tried cleaning and building again a couple of times. After the build finishes, I see all the .a files in the Release-iphoneos directory except libRNCPushNotificationIOS.a. Please let us know how to fix this problem.

@Estebank94
Copy link

I am having the same issue and all my deployment targets are set to 9.0

@Nghi-NV
Copy link

Nghi-NV commented Aug 11, 2019

I am having the same issue and all my deployment targets are set to 9.0

same issues. I had set all targets to 9.0

@Estebank94
Copy link

Still no fix for this? I cannot release the app because of this.

@anterodev
Copy link

anterodev commented Aug 12, 2019

Same here, i cannot release the app because of this.

EDIT
I have changed to react native module and everything is ok!
https://facebook.github.io/react-native/docs/pushnotificationios.html

@Estebank94
Copy link

Same here, i cannot release the app because of this.

EDIT
I have changed to react native module and everything is ok!
https://facebook.github.io/react-native/docs/pushnotificationios.html

When I try to use PushNotificationIOS I get native module cannot be null even though I link the library manually

@calintamas
Copy link
Contributor

calintamas commented Aug 13, 2019

make sure the deployment target for the RNCPushNotificationIOS target (not project) is set to 9.0 (or the same version as your app)

Screenshot 2019-08-13 15 44 15

@Estebank94
Copy link

make sure the deployment target for the RNCPushNotificationIOS target (not project) is set to 9.0 (or the same version as your app)

Screenshot 2019-08-13 15 44 15

In my case it was solved by cloning the project to a different directory and making sure the deployment target was set to 9.0

@iAmHarmon
Copy link

I faced this Problem and after few hours heres what worked for me,

  1. remove the PushNotificationIOS.xcodeproj from my project
    2.cleaned and build the project
    3.added the PushNotificationIOS.xcodeproj , libRNCNotificationPush.a and made sure that the iOS header search path on build settings is set to the right path with recursive "$(SRCROOT)/../node_modules/@react-native-community/push-notification-ios/ios"
    4.build the project and again and thats it

This worked for me!

@maamounapprise
Copy link

maamounapprise commented Aug 16, 2019

Nothing above worked for me. Using the latest react native 0.60.4. Tried manual linking ( Which we shouldn't need since auto-linking is now enabled ) Then still the same seeing this error Native module cannot be null

@BaderSerhan
Copy link

@maamounapprise check that you have PushNotificationIOS.xcodeproj added under Libraries, and libRNCPushNotificationIOS.a added under Linked Frameworks and Libraries.

@maamounapprise
Copy link

@BaderSerhan Under the workspace or pods?

@BaderSerhan
Copy link

@maamounapprise workspace. I follow this manual linking technique for all of my libraries. Saves me the headaches of react-native link and CocoaPods

@maamounapprise
Copy link

@BaderSerhan I tried it and didn't work, what version of react native are you running on. Mine is 0.60.5

@jeremyscatigna
Copy link

Got the same error: "clang: error: no such file or directory libRNCPushNotificationIOS.a" on 60.5, does someone have a fix? I have tried everything above

@BaderSerhan
Copy link

@maamounapprise same 0.60.5
@jeremyscatigna for me it was working yesterday on both debug and release, today it is failing with the same error on release
I decided to return to PushNotificationIOS library found in react-native while the issues here are solved :/

@jeremyscatigna
Copy link

@BaderSerhan Does it work using the PushNotificationIOS library found in react-native ? I have a Native Module cannot be null using it

@BaderSerhan
Copy link

@jeremyscatigna yes switching back to react-native/PushNotificationsIOS as a temporary workaround should do. Note that you should add RCTPushNotification.xcodeproj to your Libraries folder in XCode from node_modules/react-native/Libraries.

@iAmHarmon
Copy link

iAmHarmon commented Aug 27, 2019

I got the same error when trying to build the release version of my app. After readding the library I got this error:
undefined symbols for architecture armv7: "_objc_class_$_rncpushnotificationios",

Also tried changing the target version of the app to match my app as well. That didn't work.

@Moseqi
Copy link

Moseqi commented Sep 5, 2019

I did everything mentioned above. Nothing worked for version 0.60.5. Did anyone find a solution?

@orta orta closed this as completed in #19 Sep 19, 2019
@jerodb
Copy link

jerodb commented Oct 7, 2019

Please set the iOS deployment Target of PushNotificationIOS project same wit the deployment target of your app.

They set it to iOS 12.1, my app deployment target was iOS 9.0 and I set deployment Target of PushNotificationIOS project to iOS 9.0 in build settings.

That fixed my issue.

This worked for for me.
I'm using React Native 0.60 and followed this steps:

  1. Product > Clean

Screen Shot 2019-10-07 at 13 45 45

  1. Product > Clean build folder (You'll see this option in XCode by holding the Atl key)

Screen Shot 2019-10-07 at 13 47 25

  1. Make sure the deployment target for RNCPushNotificationIOS (not project) is the same as the projects deployment target, in this case iOS 9.0.

Screen Shot 2019-10-10 at 12 11 09

  1. Build again.

@AndreasAnderssonBluedeer

make sure the deployment target for the RNCPushNotificationIOS target (not project) is set to 9.0 (or the same version as your app)
Screenshot 2019-08-13 15 44 15

Setting Deployment version worked for me!

@timothee2
Copy link

timothee2 commented Oct 15, 2019

My problem was that the file "libRNCPushNotificationIOS.a" was empty, to see that I pressed on the buttons "open as" "hex" in Xcode, if nothing shows up, you have the same problem. I fixed this problem by replacing the "PushNotificationIOS.xcodeproj" file in my project by the one available on GitHub.

@GregoryBabonaux
Copy link

I got the same error when trying to build the release version of my app. After readding the library I got this error:
undefined symbols for architecture armv7: "_objc_class_$_rncpushnotificationios",

Also tried changing the target version of the app to match my app as well. That didn't work.

Did you find any solution ?

@obana1990
Copy link

My problem was that the file "libRNCPushNotificationIOS.a" was empty, to see that I pressed on the buttons "open as" "hex" in Xcode, if nothing shows up, you have the same problem. I fixed this problem by replacing the "PushNotificationIOS.xcodeproj" file in my project by the one available on GitHub.

Can you explain what do you mean by replacing the PushNotificationIOS.xcodeproj file?
I'm having the same problem as you and struggled for days....

@timothee2
Copy link

timothee2 commented Oct 22, 2019

I downloaded the file on Github, and I copied paste the PushNotificationIOS.xcodeproj from download to "(project)/node_modules/@react-native-community/push-notification-ios/iOS".

@lgogs
Copy link

lgogs commented Oct 30, 2019

Please set the iOS deployment Target of PushNotificationIOS project same wit the deployment target of your app.

They set it to iOS 12.1, my app deployment target was iOS 9.0 and I set deployment Target of PushNotificationIOS project to iOS 9.0 in build settings.

That fixed my issue.

That worked for me too !!

@obana1990
Copy link

For some reason even after i changed my deployment target to 9.0 that doesn't fix my problem but after removing the library and add it back and changing the deployment target it worked.
Hope this may help some other people.

@schumannd
Copy link

why is this closed? I am still experienceing this issue. Autolinking seems to not work

using ract-native: 61.4

@l3ikrant
Copy link

My issue has been solved after importing the libRNCPushNotificationIOS.a file listed under pods directory.
Screen Shot 2019-12-16 at 7 16 36 PM

@gbmahili
Copy link

gbmahili commented Mar 5, 2020

"libRNCPushNotificationIOS.a"

That file is still empty even after cloning from https://github.com/react-native-community/react-native-push-notification-ios.git and copying the whole PushNotificationIOS.xcodeproj in my project.
@obana1990 Is there another place where I can download that file other than their GitHub? Apparently, this issue was closed when they changed the target from 12.1 to 9.0 but some of us are still having the same error.

@obana1990
Copy link

Here's the file I found on my local machine if that's what you looking for.
https://drive.google.com/file/d/1rgDMP2U2nW1PyrX53eBLZ0AJGw2MOtwe/view?usp=sharing

@gbmahili
Copy link

gbmahili commented Mar 5, 2020

Here's the file I found on my local machine if that's what you looking for.
https://drive.google.com/file/d/1rgDMP2U2nW1PyrX53eBLZ0AJGw2MOtwe/view?usp=sharing

Thanks...that's what I needed but it does not fix my issue. Can you upload the entire folder PushNotificationIOS.xcodeproj instead? Thanks

@obana1990
Copy link

I figure that won't help too.
Try cleaning the build and then change the deploy target to 9.0 see if that helps?

I spent a lot of time on this too but changing the build target did the trick.

@gbmahili
Copy link

gbmahili commented Mar 5, 2020 via email

@tranmin287
Copy link

tranmin287 commented May 21, 2020

I hope this link can help #38 (comment)

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

Successfully merging a pull request may close this issue.