Can't require external react native Components - ios

I'm currently trying to learn react Native. While building my first App I tryed to include a external Component from Github (https://github.com/voronianski/react-native-effects-view). Fallowing the small step by step instruction I installed the Component via npm npm install react-native-effects-view --save and included the native Code via XCode:
and required the Component via var EffectsView = require('react-native-effects-view');. After restarting the App I get the fallowing error: Error: Requiring unknown module "react-native-effects-view". If you are sure the module is there, try restarting the packager. (I did restart the package roughly 1000 times)
Maybe somebody can point out the mistake I did and explain me how to do it correct?
Thanks
Daniel

Try to run react-native run-ios. You need to run this after npm install.

you need to bundle your app again since emulator doesn't have the binary for react-native-effects-view module yet
so just run this command again
react-native run-ios

Related

React-Native error "RN Sketch not found in the UIManager"

I'm trying to build a react-native sketch project and I believe I've installed all the required libraries for it to work on my machine, but for some reason I keep on getting this error, which I'm not sure how to resolve.
Also, I wasn't sure what it meant by the linking of the react native to react native sketch, when installing the react-native sketch.
react-native link react-native-sketch
Maybe sharing your code will help debug the issue. But if the code is right then see below for installation.
So when installing this package, it is not enough to just install it. You must link to React Native. So do;
npm i -S react-native-sketch
That will install it. Now to make React Native 'aware' of this newly installed package, link it as follows;
react-native link react-native-sketch
This is just putting it in simple terms for understanding.
You should get a success message for both of the above - if an error occurs while running any of the above command lines, then it did not succeed and you'll get the error above.
If developing on IOS, don't forget to pod install and re run the project after installing the package!
CD to IOS directory - type 'pod install' and ENTER. Re Run the project.

requiring unknown module "519" ReactNative

Error info
requiring unknown module "519", if you are sure the module exists, try
restarting Metro. You may also want to run 'yarn' or 'npm install'
I just add ant-design in my rn program and run pod install and restart android app.
No error in my iOS Application, but wrong with Android application.
What can I do to fix that?
Have you tried with npm install? Usually the error means that you don't have installed a plugin or that you are importing something in the wrong mode.

Requiring unknown module "498" error in ReactNative getting started example

I'm trying to build and run an iOS simulator version of the getting started React Native project from the instructions at:
https://facebook.github.io/react-native/docs/getting-started.html
The app launches in the XCode simulator, displays it's window very briefly but then an exception occurs that opens a red screen with the message
"Requiring unknown module "498".If you are sure the module is there,
try restarting Metro Bundler. You may also want to run yarn, or npm
install (depending on your environment).
loadModuleImplementation require.js:176:29
viewPropTypes.js:15:30
loadModuleImplementation require.js:212:12
View.js:20:22
loadModuleImplementation require.js:212:12
AppContainer.js:22:13"
etc
Line 15 of ViewPropTypes is
const PlatformViewPropTypes = require('PlatformViewPropTypes');
Line 20 of node_modules/react_native/Libraries/Components/Views/View.js is
const ViewPropTypes = require('ViewPropTypes');
Note: There is another, 15 line View.js files in the directory structure at node_modules/react_native/lib/ it's basically a stub containing
// This is a forwarding module to allow React to require React Native internals
// as node dependency
module.exports = require('View');
I'm on the latest of everything, MacOS High Sierra (10.13.4), XCode 9.3 with 9.3 command line tools installed. I've tried running yarn and npm install, and a fresh install. Obviously I have NPM and Watchman installed. Any ideas why the stock example won't run for me?
Newbie mistake. I had previously attempted to build a different React Native project in a different directory, and Metro Bundler was still pointed at the previous project. As the error message suggested, restarting Metro Bundler fixed the problem.
Also didn't realize the errors in the exception screen were tappable, they take you right into the Metro Bundler terminal process for more detail. Hope this helps someone else too!
In my case, just close all the related process, and re-run react-native run-android solved the problem.
refer to: https://github.com/facebook/react-native/issues/11568
I had the same issue.
In my case, while creating a reusable component, I wasn't importing React into the file,as I was not using them(in functional component) in the component file.
Turns out that jsx to React Element conversion happens per file/module basis, so we should import React and component in every file.
Including Both React and Component normally, solved the problem.
For me I got "955" error. And a simple solution was to
import React, {Component} from "react";

ios Could not get BatchedBridge, make sure your bundle is packaged properly

I am getting this while running app on simulator using xCode, version 9.2
I've tried other solution mentioned on Stack overflow & Github S1S2 S3 S4 but most of the solution are mentioned for android.
P.S. This project also includes purescript code explained here Integrate Pure Script in your React Native project
That's how I resolved it.
Terminate your metro bundler > react-native link > react-native run-ios
It was not bundling because of some errors which was not showing in the simulator but just this error was thrown.
create index.js, index.android.js and index.ios.js whith the same content. I do have all of them and it solved my issue
I have also faced the same issue when I changed the name of images saved in my local directory. In my case, I have just restarted metro bundler, deleted the app, and restarted the app. Issue was fixed for me.
Try this:
npx react-native-asset
then:
react-native run-ios
This issue is caused basically when some packages or images are not bundled properly, it might be caused because of improper assets path or internet issue when installing packages or reload issue. The expo bundles into a standalone library so it can be available immediately.
This error does not provide any stack to debug since it does not properly have the bundled data even for error stack.
I have just face few bundled scenarios
Scenario 1 => While the expo is running and we install a new library on fly, few times during this importing the library might not get bundled properly, so it's better to stop the expo and re-run, or try reloading the error in app. This will some time resolve the issue, or if there is some error it will show up the error stack
Scenario 2 => You have a customised asset director or have changed the asset path in app.json file improperly.
Please let me know in comments if there are any other scenarios
I had a metro bundler terminal window opened and whenever I was running npm run ios , it wasn't starting a new metro server, the problem was that. I closed the metro bundler terminal window and ran npm run ios and it opened a started a new metro server and the error was gone
I had a same issue, then I did:
rm -rf node_modules,
npm install
and restarted the metro (npm start). It worked.
In Settings, go to Privacy > Local Network to see a list of every app that requested access. I solved by allowing my app to access to the local network. (Trying to run on physical iPhone device from my mac m1 on the same wifi).
Source
Make sure that when you restart the expo project you do so with expo start -c
-c throws out the cache, otherwise the problem persisted for me.

ionic build ios fails with "[TypeError: Arguments to path.join must be strings]"

I am trying to create an ionic app on Mac.
I followed the instructions on ionic's website to create a basic app and was able to run it in the browser but when I run "ionic build ios" I get following error. I cannot find a log file or any other error to debug this. How do I go about fixing this?
Check your Gulp version and gulpfile.js. You may need to remove the calls to gulp.src
See:
Gulp TypeError: Arguments to path.join must be strings
and
https://github.com/sindresorhus/gulp-ruby-sass/issues/191
ok, after lot of looking and searching I figured my npm install was messed up.
Part of my installs were in /usr/local and few of them were in /User/user.name/npm folders. /Users/user.name/npm was set in the npm config prefix.
I had two installs of cordova, one on each folder above. Some how the cordova from /usr/local was getting used to create the project and that was the old version.
To fix the problem, I uninstalled all my global npm installs and pointed my npm config prefix to /usr/local and gave myself execute permission on that folder. Everything is working now.
Here is the video that explains how to do it: https://docs.npmjs.com/getting-started/fixing-npm-permissions

Resources