'Linking React Native Libraries: "RNNotifications.h" not found
I am trying to use the react-native-notifications library but I am getting a file not found error when I try to import "RNNotifications.h".
I followed the "Linking Libraries Manually" guide on the React Native docs. Play by play, this is what I did:
Step 1:
I opened my project on Xcode, clicked my project's name, opened its "Libraries" folder, then used Finder to add "RNNotifications.xcodeproj" (a file located inside my project's node_modules/react-native-notifications/RNNotifications folder).
Step 2:
Made sure my project was selected, targeted my project's name, then added "libRNNotifications.a" in "Build Phases" under "Link Binary With Libraries".
Step 3: I went under "Build Settings" and added the following path to my "Header Search Paths":
$(SRCROOT)/../node_modules/react-native-notifications/RNNotifications
I did so with the "non-recursive" option because there are no sub-folders inside the RNNotifications folder.
Step 4:
I went inside my project's "AppDelegate.m" and added the following import statement:
#import "RNNotifications.h"
After these four steps, I get a "'RNNotifications.h' file not found" error.
Solution 1:[1]
On step 3 when you search for "Header Search Paths" make sure to select the target which is your projects name, you can do this by looking at the left tab, you should see the Project tab with the xcodeproj file under it and another Targets tab. just select your project under the Targets before searching for "Header Search Paths" then add the path there
$(SRCROOT)/../node_modules/react-native-notifications/RNNotifications
This image shows the TARGETS tab which you must select first
Solution 2:[2]
As I experiences with these issue. I have no idea with this package installment. It's working fine in Android, but not in iOS.
But I have solved it by re-create RNNotifications.h and RNNotifications.m into directory of the main project instead.
Because Main project it's connected with Firebase Library directed. But if we call from RNNotifications project, you will got error by 'RNNotifications.h' file not found
Here is my structure and edition sample for you, hope it will be help you for some idea:
Solution 3:[3]
I had the same problem, so what I did is steps 1, 2, and 3 you have listed above, but before I did step 4, close Xcode and open it which will re index the project or workspace, then type your import statement and it should work, thats what worked for me. If you don't restart xcode or close and open your por
Solution 4:[4]
Use pod install and this will install required library
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Andrei Calazans |
| Solution 2 | Seyha |
| Solution 3 | adam |
| Solution 4 | tiwari |


