starter application react native error - ios

I just started with react-native development on IOS and want to get my feet wet.
I did the following:
react-native init trail
and I opened the trail starter project in xcode and hit run. There were several small issues I fixed already including upgrading watchman, upgrading OSX. Currently the logs do not show any errors.
While the logs show that the packager runs, the build failed on XCode. A lot of errors showed up with the files in the Library folder. Many of them show up as Parse Issues, Semantic Issues.
I'm currently using Mac OSX Yosemite 10.10.5. Why did the started app fail to build?
Here are some code snippets of the errors:
code snippet 1
code snippet 2

Update your versions of node, npm and xCode.
Run 'react-native init yourAppName';
Run in yourAppNameFolder 'npm i' - to install all needed dependencies, which may be missing;
Run 'open yourAppNameFolder/ios/yourAppName.xcodeproj' where appFolder - folder which one have been initialized by command 'react-native init'.
This should help, and one more suggestion - don't touch this bloody xcode, better to run the app from the shell.

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 "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";

RN 0.38.0 React/RCTBridgeModule.h' file not found

This is a long shot, but I've taken over a project done in RN v .38 and I need to update a library and resolve the build issues without updating the version of react native. I'm trying to update the react-native-aws-cognito-js library and while it looks to be compatible with the formatting change of import statements, I'm still not able to get it to build on IOS. Android is fine.
To reproduce my issue I did the following:
react-native init sample --version 0.38.0
cd sample
npm install react-native-aws-cognito-js
react-native link react-native-aws-cognito-js
react-native run-ios
Which fails with:
/node_modules/react-native-aws-cognito-js/ios/RNAWSCognito.h:4:9:
fatal error: 'React/RCTBridgeModule.h' file not found #import
Mobile and RN development is not my wheelhouse, but I'm hoping there is some sort of xcode configuration or tricks I can do to get this working and avoid a major overhaul. Running an upgrade to >.40 would probably take too long and also cause other compatibility issues that I don't have the time to resolve.
Note: I have tried the suggestions in `React/RCTBridgeModule.h` file not found

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.

when building an ionic app files and folders starting with "._" are created until error

I have a strange problem. I develop an app using Ionic on a samba network drive.
I develop on a windows machine and run all the command lines regarding Android development. I switch to a Mac to be able to build for iOS.
All went fine and as expected the last couple of days. Today I edited some HTML, JS and CSS files - just some minor improvements. I built the app for android on the windows machine (plus using jarsigner and zipalign - only if that should matter).
On the Mac I had troubles. Suddenly I get errors when trying to run ionic build --release ios (as I already did successfully the last couple days).
The executed script creates files and folders starting with "._" which were never created before and are already existing without it. This results at some point in an ENOENT (no such file or directory) aborting everything.
I don't get it. I already de-/re-installed node, npm, cordova and ionic. But nothing helped.
I would love to support you guys with additional error messages or logs, but due to I'm fairly new to mobile development (and using a Mac), I don't know what information would be helpful and what not.
Sp please tell me any information you need and I'll be happy to supply them.
I accidentally solved my own problem. I just "removed" the platforms directory (by renaming it) and re-added the platform using the command cordova platform add ios.
After that I could build my app as it did before. Don't know why or what actually triggered this behavior, but at least I'm able to proceed.
If somebody knows how to prevent that from happening again (so that I don't loose all the project settings I configured in Xcode), I would appreciate it.
This happened to me, too - I found this bug in the Cordova issues:
https://issues.apache.org/jira/browse/CB-5644
I found out that Xcode created the file PROJECT_PATH/platforms/ios/._APPNAME.xcodeproject. I deleted this file and "cordova prepared ios" was working again.
...
It should ignore files starting with ._ as they are hidden system
files used by osx to store infos about a file

Resources