react-native app not working in ios - ios

Hi I have downloaded this sample app https://github.com/iZaL/my-appointment . when i am runing this getting error .can you help me on this issue
my-appointment-master/src/containers/Category/Category.js: Unable to find this module in its module map or any of the node_modules directories under /Users/node_modules/react-native-alphabetlistview and its parent directories
This might be related to https://github.com/facebook/react-native/issues/4968
To resolve try the following:
1. Clear watchman watches: watchman watch-del-all.
2. Delete the node_modules folder: rm -rf node_modules && npm install.
3. Reset packager cache: rm -fr $TMPDIR/react-* or npm start -- --reset-cache.
i have tried to reset this all but getting same issue

It looks like the project package.json is missing the dependency
react-native-alphabetlistview.
You can install it via
npm install react-native-alphabetlistview --save

Related

No bundle URL present make sure you have running a packager server

i try to compile a projet on reactnative on my new mission
I really try a lot of thing to resolve this error search everywhere but no solution worked for me
i launch
react-native start
from the root project i also tried npm start -- --reset-cache, i tried before to clean and delete cache like this
watchman watch-del-all
rm -rf node_modules
npm install
rm -rf /tmp/haste-map-react-native-packager-*
i'm getting this error on device ios and on simulator like the image show :
No bundle URL present make sure you have running a packager server or have included a .jsbundle file in your application bundle
also i'm noticing that file main.jsbundle is not present anywhere on folder and it's on red on xcode
same problem with npm start react-native run-ios
Any help is greatly appreciated

Create react native module and use it in application

I want to create react-native module for iOS and Android and use it in an application.
I want to use it like a local module, not uploaded to npm.
When i follow the steps described in the official documentation i always have those error on the import of my module into App.js file :
import MyModule from 'react-test-module';
Could not find a declaration file for module 'react-test-module'. '/Users/dbellerose/Path/to/My/Module/react-test-module/index.js' implicitly has an 'any' type.
Try npm install #types/react-test-modulet if it exists or add a new declaration (.d.ts) file containing `declare module 'react-test-module';
When i run the iOS application :
Unable to resolve module react-test-module from /Users/Path/To/My/App/App.js: Module react-test-module does not exist in the Haste module map.
The message give me some tips to solve the problem, but it does not work.
To resolve try the following:
1. Clear watchman watches: watchman watch-del-all.
2. Delete the node_modules folder: rm -rf node_modules && npm install.
3. Reset Metro Bundler cache: rm -rf /tmp/metro-bundler-cache-* or npm start -- --reset-cache.
4. Remove haste cache: rm -rf /tmp/haste-map-react-native-packager-*.
So what do you know what is the good process to create a module and use it in application without uploading the package to npm ?
Best regards,
David
Here's some steps I could share with you as a checklist:
yarn global add create-react-native-module
create-react-native-module MyLibrary
Cd to MyLibrary folder, run yarn install
Work on your module
To link to your project, you will need to add the following to your package.json (the path should be wherever your module is sitting at)
"react-native-test-module": "file:../",
"react-native-my-library": "file:../../react-native-my-library/"
** Do keep in mind, if you have new methods appended in module. You will need to:
Remove node_modules and Pods from your project
Re-execute yarn/npm install & pod install
Hope it helps.

"config.h" file not found in iOS project of React native

In X-Code project of react native, getting error
config.h file not found.
Here is version detail :
react-native-cli: 2.0.1
react-native: 0.51.0
How to solve it?
Close Xcode.
Open Terminal, go to your project's root folder and run:
cd node_modules/react-native/third-party/glog-0.3.4/
Run the configure script:
./configure
Open Xcode and try to run your app.
I had the same issue, using this steps solves for me:
Running into the same issue here after upgrading from 0.44. None of the above solutions or clearing caches did the trick for me. Here's what I did to get things working again:
In the Terminal, navigate to the react-native/third-party/glog folder inside node_modules (for me, this was cd node_modules/react-native/third-party/glog-0.3.4)
Once actively in this folder, run sh ../../scripts/ios-configure-glog.sh
Glog is configured and the required config.h header file is created for Xcode to find
Run your iOS BUILD
Regards!
When project files get messed up for me. I typically follow these steps.
rm -rf node_modules
npm install
react-native upgrade (Only changing affected files, so IOS for you)
react-native link
npm start --reset-cache
(In another terminal)
react-native run-ios
These steps worked for me:
rm -rf ~/.rncache
rm -rf node_modules/
npm install
npm start
You need to change to the legacy build system in Xcode 10 and install third party scripts manually.
1:
File -> Project/Workspace settings
Build System: dropdown -> change to Legacy Build system
2: Follow this to manually install third party scripts for RN:
Clean RN cache
$ rm -rf ~/.rncache
Re-install the deps
$ cd your_project_path
$ rm -rf node_modules/ && npm install
Then install the third-party
$ cd node_modules/react-native/scripts
$ ./ios-install-third-party.sh
Run the commands below if glog installation failed.
$ cd ../third-party/glog-0.3.x
$ ./configure
It works for me, I hope it helps for you.
If above all answers don't work,
Please check that there is no space in any directory name of the full path and not only the project directory name.
While in terminal, it accepts throgh My Disk as My\ Disk but xcode do not recognize that.
If its in My Disk directory, try after moving it to Desktop or any other directory which doesn't have space in their name.
configure: error: unsafe absolute working directory name Issue:
-Open Terminal, go to your project's root folder and run:
cd node_modules/react-native/third-party/glog-0.3.5/
Run the configure script:
./configure
got error: configure: error: unsafe absolute working directory name
try to created app in desktop and from there run ./configure command.
Please note with XCOXE 10, and Mojave MAC OS , I had same issue, ./configure was showing some permission issue, I had set permission "777" to project folder enclosing with inner folders
This is the linking issue in xcode. You just need to re-link the files.
Please follow the below steps:
Open you peoject's root directory then open node-module -> react-native -> React.
Open React.xcodeproj file in xcode.
You will see missing (showing red in color) files under the third-party folder
Just run the React.xcodeproj project.
After completion close this project & open you project file.
Delete Drive data & Clean the project & run.
If after running the project you are getting linking issue then please make sure you have added all the (ios) products () come under the Libraries -> React.xcodeproj -> Products in your Build Phases -> Link Binary With Libraries.
If everyone has tried solving the issue by this
Open Terminal, go to your project's root folder and run:
cd node_modules/react-native/third-party/glog-0.3.4/
Run the configure script:
./configure
But still not got the solution then,
Go to your Xcode and check if there any library is missing. Add that library and then perform this above step.
Although the already mentioned answers are correct but still few guys are struggling, as only configuring the glog doesn't sometimes resolve the error.
Here I have written a detailed solution to the problem.
Solution: config.h file not found mutex.h During Archive.
The steps are the following:
Remove node_modules directory
Clear Cache
Install packages again with Yarn
Install third party
Configure Glog
Make & Make install glog
For all these above steps the I have shared commands in the above mentioned article, so not going to write again. I hope it will solve problem for guys who are still struggling.

xcode 'boost/config/user.hpp' file not found

I'm using Xcode 9, everything was fine. but after I upgrade my React-native version to 0.46, and upgrade my React to 16.0.0 alpha12. and re-run my project, Xcode gives me an error 'boost/config/user.hpp' file not found, I use brew install boost to install boost. but it doest work.
It seems like something wrong with react-native, because I can use Xcode to create a new iOS project and works fine, but when I use 'react-native init newProject', It gives me the same error.
Just remove the cache and the third_party folder in react-native in node modules
rm -r ~/.rncache
rm -r <your-project>/node_modules/react-native/third_party
For those who are using react-native version > 0.57
rm -r ~/Library/Caches/com.facebook.ReactNativeBuild
rm -r <your-project>/node_modules/react-native/third_party
I just run the command : npm install and fixed the issue..
for me it was key to remove the ios/Podfile.lock file after removing the ios/Pods/ folder
Hope this also helpful
Deleting the Podfile for boost, and running pod install again

React-native#0.26.3 requires a peer of react#15.0.2 but none was installed

I am trying to set up for the react native. but whenever I update files it gives m error
enoent ENOENT: no such file or directory, open 'React Native/package.json'
npm WARN react-native#0.26.3 requires a peer of react#15.0.2 but none was installed.
npm WARN React Native No description
npm WARN React Native No repository field.
npm WARN React Native No README data
npm WARN React Native No license field.
MacBook-Pro:React Native$ npm info react dist-tags.latest
Please let me know how can I fix.
Installing react should fix the error
npm install react --save
Also, you may try upgrading your react-native install. react-native is as v0.30.0 now
npm update react-native
In my specific case I was running npm install in the wrong directory. I thought I was in my project directory but was one level higher. This meant react was missing from installed packages (because there were none) and thus gave this error.
Some steps that worked for me:
1. watchman watch-del-all
2. rm -rf node_modules
3. npm install react#15.0.2 --save
4. npm install react#15.1.0 --save
5. npm install
6. rm -fr $TMPDIR/react-*
7. npm start -- --reset-cache
In my case, the project I am working on requires a specific version of React. Since it was older than the current release, doing an install/update would still cause the error.
In order to fix the problem, I had to check the package.json of the project and install the exact version allowed by the dependency definition. In the OP's case, a
npm install react#15.0.2
should fix the problem by installing the exact version of the React module that react-native requires.
Verify that the condition was resolved by doing a npm list to see if there are any other unmet peer dependencies.

Resources