react-native-local-notifications icon indicating copy to clipboard operation
react-native-local-notifications copied to clipboard

App not running when linking react-native-local-notifications v0.60.5

Open ahmadallo1 opened this issue 4 years ago • 8 comments

@wumke I'm using react native v0.60.5 "react native link" is not used anymore to link component, when trying to run it in xcode the following error appears: 'RCTBridgeModule.h' file not found

is there any way to link react-native-local-notifications using cocoapods or how can we fix this issue?

react-native": "0.60.5", "react-native-local-notifications": "2.0.0"

ahmadallo1 avatar Oct 30 '19 16:10 ahmadallo1

hi @ahmadallo1 i had faced same problem at IOs

Binaries: Node: 12.4.0 - /usr/local/bin/node Yarn: 1.17.0 - /usr/local/bin/yarn npm: 6.12.1 - /usr/local/bin/npm Watchman: 4.9.1 - /usr/local/bin/watchman SDKs: iOS SDK: Platforms: iOS 12.4, macOS 10.14, tvOS 12.4, watchOS 5.3 Android SDK: API Levels: 23, 26, 27, 28, 8 Build Tools: 23.0.1, 26.0.3, 27.0.3, 28.0.1, 28.0.2, 28.0.3, 29.0.2 System Images: android-22 | Google APIs Intel x86 Atom, android-23 | Intel x86 Atom_64, android-23 | Google APIs Intel x86 Atom_64, android-28 | Google APIs Intel x86 Atom, android-28 | Google Play Intel x86 Atom IDEs: Android Studio: 3.4 Xcode: 10.3 npmPackages: react: 16.9.0 => 16.9.0 react-native: 0.61.3 => 0.61.3 npmGlobalPackages: create-react-native-app: 1.0.0 react-native-cli: 2.0.1

"react-native": "0.61.3", "react-native-local-notifications": "2.0.0" and i found a workaround like this: i have unlinked and uninstalled react-native-local-notifications

i have installed react-native-local-notifications (like a fresh start) then i have added RNLocalNotifications.podspec file to node_modules/react-native-local-notifications/

my RNLocalNotifications.podspec file is like : https://gist.github.com/mrblgn/f480aa4a0bf515ea373939fdb0788e6f

then i run cd ios && pod install & cd .. command on terminal, like other libraries that have added for RN > 0.60

@wumke should add 'RNLocalNotifications.podspec' file to the project for React Native > 0.60 projects at next release.

mrblgn avatar Nov 13 '19 13:11 mrblgn

Merged PR https://github.com/wumke/react-native-local-notifications/pull/32 Should work now (Use direct repo link npm version not yet updated!)

Since I do not use RN0.60+ yet, can anyone confirm that this issue can be closed?

wumke avatar Nov 20 '19 10:11 wumke

@wumke PR #32 is not enough, this repository has to migrate and use Androidx packages instead of support libraries. please read this section

SaeedZhiany avatar Dec 09 '19 09:12 SaeedZhiany

I've had great success with the Android Studio migration tool, that fixed AndroidX migration of all libraries in a project which I needed to migrate. You can use that as a temporary workaround, and if you like you can check what changed and create a PR (I'm not into RN at the moment... upgrading and refactoring a huge backend)

wumke avatar Dec 09 '19 10:12 wumke

I've had great success with the Android Studio migration tool, that fixed AndroidX migration of all libraries in a project which I needed to migrate.

This could not be used in a build CI and it's needed to migrate the repository itself. I'll submit a PR as soon as I can.

SaeedZhiany avatar Dec 09 '19 10:12 SaeedZhiany

Thank you (in the name of all users of this library)!

Place a reference to this thread when you create the new pull request...

wumke avatar Dec 09 '19 10:12 wumke

@wumke

I have submitted the PR.

@ahmadallo1 since I'm not using RN V60+ yet, I can not test if everything is OK or not, can you test it on your project and give me feedback?

for using the PR on your project change your package.json like below

{
  "react-native-local-notifications": "git://github.com/SaeedZhiany/react-native-local-notifications.git#MigrateToAndroidx"
}

SaeedZhiany avatar Dec 09 '19 11:12 SaeedZhiany

@wumke For linking issue i have fixed by adding these path in to the XCode project file.

try these steps:

  1. Go to Project navigator > Libraries > RNLocalNotifications.xcodeproj
  2. lick on Build Settings and then the first item under "Targets"
  3. Scroll down to 'Search Paths'
  4. Double click to edit the 'Header Search Paths'
  5. Add the following entry (click '+'): ${SRCROOT}/../../../ios/Pods/Headers. Make sure to set it to recursive.
  6. Clean (cmd + shift + K) and re-build (cmd + B)

SugumarParthi avatar Apr 30 '20 15:04 SugumarParthi