I'm trying to use React native and I am getting an error in xcode that says "Lexical or preprocessor error 'RTCRootView.h' not found." I have checked and this file is in the framework folder and I have tried moving it into the project as well and still have not been able to eliminate the error and successfully build.
In the example directory, run npm install to install the dependencies.
Then, open swipeoutExample.xcodeproj and run.
react-native-swipeout#15.
edit (2015-10-12):
react-native-swipeout has been updated to use the latest react-native including ./ios and ./android directories.
iOS: Open the xcode project in the ./ios directory and run it.
Android: Start a simulator, then run react-native run-android in project root directory. (note: swipeout is currently incompatible with Android, but will be soon.)
Running npm install might work for some people, but it didn't work for me.
What worked for me was in XCode > Product > Clean
Sometimes it might be because the node_modules folder is missing in your project directory.
Move the node_modules folder to your project
run npm install in your project directory
Just faced with the same error. In my case it was because of typing error. I replaced RTCRootView.h with RCTRootView.h (RCT is an abbreviation of ReaCT).
Related
I've tried looking for a way to solve this error. It's occurring to me while I try to install my app with react-native run-android.
Already took a look at the solutions from this thread, but my project isn't named native, ./gradlew clean from the android folder didn't work, and I tried deleting the .gradle folder. I've also tried my own simple solutions that sometimes work for whatever reason - uninstalling the app from my phone before re-running react-native run-android and reopening VSCode.
This error started occurring after I installed react-native-unimodules, following the android instructions. A potential problem I see from this is just that react-native-unimodules is supposed to be for Expo and I'm doing things with React Native CLI, but from what I understood, this is allowed.
My react-native version is 0.61.5, react-native-cli is 2.0.1.
Edit:
build.gradle file, as requested.
Also, I don't know if it's relevant, but since it was part of one of the suggested answers, I'll mention this as well: in the gradle.properties file,
android.useAndroidX=true and android.enableJetifier=true were already present.
This is a pretty common case, but what ive figured out during my app building, these steps always helped.
First you need to add below lines in gradle.properties file
android.useAndroidX=true
android.enableJetifier=true
Then after that you need to install, jetfier via either yarn or npm like :
npm i jetifier // first this then the below
npx jetify
After that again re-bundle your code and then run, hope it helps. Feel free for doubts
I have tried running npm install react-native-picker --save
react-native-link
etc but the package remains missing every time I run react-native run-android
https://github.com/beefe/react-native-picker/issues/67
Nothing I tried from this list works. I would like suggestions on debugging this type of react-native error. The node_module is there. What else could be keeping it from being visible during react-native run-android? Is this a failure to link? Is it a failure to compile? How do I debug this?
Ok, solution is work around wrong version of Android compile and target at 27. Work around is to go into node_modules of picker and modify android.gradle under app to switch 27 to 28 for target etc. That fixes it.
I have create sample React Native project and following the tutorial as per react native website.
I have try to run the application IOS simulator, its throwing error as below ,
** BUILD FAILED **
The following build commands failed:
PhaseScriptExecution Install\ Third\ Party /Users/Test/Documents/REACTJS/SampleReactNative/ios/build/Build/Intermediates.noindex/React.build/Debug-iphonesimulator/double-conversion.build/Script-190EE32F1E6A43DE00A8543A.sh
(1 failure)
Installing build/Build/Products/Debug-iphonesimulator/SampleReactNative.app
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=2):
Failed to install the requested application
An application bundle was not found at the provided path.
Provide a valid path to the desired application bundle.
Print: Entry, ":CFBundleIdentifier", Does Not Exist
Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/SampleReactNative.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist
my environment setup information,
node version v9.8.0 npm version 5.6.0 react-native-cli: 2.0.1
react-native: 0.54.2 xcode 9.2
Please help us to resolve the issues.
I have the same problem right after init:
react-native init myapp
cd myapp
react-native run-ios
..although run-android was fine.
Not a solution but a workaround for the moment, maybe be to init using a lower version of RN:
react-native init myapp --version react-native#0.51.0
That builds okay.
Similar in an existing project, install an older version of RN.
Other versions before 0.54.2 might work but I haven't tried.
(edited 2018/4/2)
Found my solution from this link: https://github.com/facebook/react-native/issues/18238
RN 0.54 requires types available since iOS 11. So you have to upgrade your xcode and set minimum iOS version in your app to 11
In short, upgraded OSX & Xcode to the latest. (As of today, OSX 10.13.4 Xcode & 9.3)
This may happen because of some library files not found.You need to follow some steps That I have done and it is worked perfectly for me.
1.) go to Xcode project -> Target -> select build Phase -> Go to target dependies -> Click on + -> add "react" and press add.
2.) Xcode > Product -> scheme > manage sceme -> click on + button -> targetName(React) -> Okay -> make shared of this by select checkbox under shared column.
3.) Clean your project and try to build, If it is getting some error like "glog/logging.h file not found" or "cofig.h file not found" in Xcode and "CFBundleIdentifier not exist" then do not worry. You are just one step far. This is may occurs if you are missing config.h file, For this you need to update config.h file. For this
4.) follow below steps
a.) close your Xcode
b.) Open terminal with the project (Or you can directly left click your project and drag your folder to closed terminal, [It will automatically take the path from your that corresponding folder])
c.) write command
cd node_modules/react-native/third-party/glog-0.3.4/
d.) Run the configure scripted file by the command
./configure
e.) now close terminal and go to terminal with your project root path. now try final run your iOS project by
react-native run-ios
For XCODE 10.0,
I did two things
1) check out this answer
which basically says
Go to File -> Project settings
Click the Advanced button
Select "Custom" and select "Relative to Workspace" in the pull down
Change "Build/Products" to "build/Build/Products"
2) If (1) doesn't work for you then open your project from xcode
go to project navigator and select your project name --> go to info --> use debug for command-lines builds.
do this
3) go to terminal and react-native run-ios
Run the command:
react-native upgrade
react-native run-ios
or:
react-native run-android
Try to add CFBundleIdentifier in the Info.plist as:
<key>CFBundleIdentifier</key>
<string>org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)</string>
I experienced this issue due to the xcode 12 upgrade, and I solved my problem by upgrading my rn by using this command:
react-native upgrade
then go to podfile change your:
pod 'ReactCommon/callinvoker', :path => "../node_modules/react-native/ReactCommon"
to:
pod 'React-callinvoker', :path => "../node_modules/react-native/ReactCommon/callinvoker"
Do you have CFBundleIdentifier in your Info.plist?
If not than add it for eg. com.ios.learning
Usually, this error comes up due to inconsistent versions (either of react-native, OS or XCode). I had the same issue with react-native v0.57.0 on MacOS Sierra and XCode v9.x.
All I had to do was to upgrade to High Sierra and then XCode to v10.0.
Otherwise, you'd have to use an older version of react-native either by downgrading it
or by initialising a project with an older version
react-native init test --version react-native#0.x.x
In my case, just delete the build directory, Pods directory, node_modules directory and running yarn install, pod install and npx react-native run-ios solves the issue.
React Native is trying to install your app on a different app name for some reason. What you can do is in Xcode --> build settings --> packaging --> change the product name to the one given in the path which the simulator is trying to install.
Look at this: https://amala-gopal.medium.com/entry-cfbundleidentifier-does-not-exist-6098b90516f6
npm uninstall react-native
delete ios and android folder
then run :
npm install react-native
react-native upgrade
I have been going through the react-native tutorial and ran
react-native init AwesomeApp as detailed in the FB page.
After many trials and errors in setting the correct permissions and path I was able to get the app running on IOS.
Awesome app is in a directory Projects
Now I want to create my own app in the same Projects folder and when I try
react-native init newApp I get
Looks like React Native project already exists in the current
folder. Run this command from a different folder or remove node_modules/react-native
I tried from a different folder and still get the same message.
What's the best way to resolve this, deleting the node_modules/react-native or is there another solution and why the same error in a different folder?
Had the same issue, the solution wasn't obvious and I find it nowhere on the Internet so I'm leaving it here.
You may have installed react-native globally. While you should install react-native-cli globally.
Having the first one installed makes typical react-native commads work (starting an app, linking native modules). The only difference is that init fails with above message. And IIRC calling react-native without arguments reveals the source of the problem with descriptive message that you've globally installed wrong package.
Edit:
On Windows also make sure to use CMD, not PowerShell. PowerShell was calling react-native binary (instead of react-native-cli) from SOMEWHERE (I don't know the source, I don't have it available globally, I removed every single globally installed package and it was still calling it (probably from some locally insalled copy)).
React Native development caused another issues too (can't remember the details, sorry) when used with Powershell, so just stick to CMD on Windows.
You were probably still in the AwesomeApp directory while running react-native init newApp.
Try cd .. back to the Projects directory and run react-native init newApp again.
You will then see newApp directory is created inside the Projects directory.
This error occurs when it is in a folder that you deleted. Try to cd to another folder, and it will work.
In the directory C:\\Users\YourUserName you have a file "nodemodules" and a file named "MyProjectName" .
you should delete nodemodules file.
it works for me!
I ran into this too, Make sure your folder does not have any node modules, if problem persists then install react-native-cli again globally using
yarn add global react-native-cli and then initialize your project.
using react-native init {name}.
I had the same error because in some parent directory was backuped "node_modules" directory.
Error resolved by rename it.
Hello for everyone this problem gonna be solved by became sudo user in your Mac if you're using macbook now. Then start to create your project one more time.
Thanks
I'm attempting to use a component in my React Native project, specifically this one:
https://github.com/lucholaf/react-native-grid-view
I run npm install react-native-grid-view in the project's directory, but as soon as I do that, after building I get:
Is the problem that I'm running npm install in the wrong location? I've tried other directories, but then React doesn't see the modules and says "unknown module".
Thanks!
The problem was that the component was pointing to an older version of React Native, 0.3.4. Manually updated to 0.4 and it worked.