I am trying to configure OneSignal React Native in a React Native application for push notification purposes.
Environment Setup
- react-native version : 0.60
- npm version 10.5
I followed the steps below from the official documentation of React native one signal for setting it up:
step 1 : npm install -g react-native-cli
,
status : done
step 2 : react-native init OneSignalDemo
,
status : done
Before linking the project I ran my project successfully with the mands below:
react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res
react-native run-android
step 3: While linking my library with react-native link react-native-onesignal
I got an error in my terminal.
Linking oneSignal with my App (As per official documentation),
status : fail
Error:
Package react-native-onesignal has been ignored because it contains invalid configuration.
Reason: Unknown option dependency.platforms.ios.sourceDir with value ""./ios"" was found.
This is either a typing error or a user mistake
One possible solution that I tried was to create new React Native project with version 0.58.0 as per documentation, but I keep getting the same error.
I am trying to configure OneSignal React Native in a React Native application for push notification purposes.
Environment Setup
- react-native version : 0.60
- npm version 10.5
I followed the steps below from the official documentation of React native one signal for setting it up:
step 1 : npm install -g react-native-cli
,
status : done
step 2 : react-native init OneSignalDemo
,
status : done
Before linking the project I ran my project successfully with the mands below:
react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res
react-native run-android
step 3: While linking my library with react-native link react-native-onesignal
I got an error in my terminal.
Linking oneSignal with my App (As per official documentation),
status : fail
Error:
Package react-native-onesignal has been ignored because it contains invalid configuration.
Reason: Unknown option dependency.platforms.ios.sourceDir with value ""./ios"" was found.
This is either a typing error or a user mistake
One possible solution that I tried was to create new React Native project with version 0.58.0 as per documentation, but I keep getting the same error.
Share Improve this question edited Feb 6, 2020 at 19:04 David Buck 3,84439 gold badges50 silver badges69 bronze badges asked Jul 8, 2019 at 10:55 Hardik DesaiHardik Desai 1,22714 silver badges22 bronze badges 5- 1 What do you want to achieve? What did you try already? We cannot help if you don't provide more details.. – SBylemans Commented Jul 8, 2019 at 11:24
- thank you this . i edit my question in details please have a look. – Hardik Desai Commented Jul 8, 2019 at 17:04
-
I don't know much about react, but judging by your error message, you have configured an
ios
directory somewhere, or that directory is present somewhere? – SBylemans Commented Jul 9, 2019 at 7:43 - 1 $ rm -rf package-lock.json node_modules $ npm install these two mands fixed my issue – Basha K Commented Jul 9, 2019 at 9:29
- @SBylemans Thank you for your valuable input,when we perform first two steps it will (React native) automatically create ios and adnroid directory in your project root folder – Hardik Desai Commented Jul 9, 2019 at 16:28
1 Answer
Reset to default 3i got the warn message but simple npm i solved the issue for me
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744747436a4591387.html
评论列表(0条)