Not using the Expo fork of react-native - react-native

I'm using expo with react native. All is fine, but i get this warning and the app takes a long time in loading :
[exp] Warning: Not using the Expo fork of react-native. See https://docs.expo.io/.
How can i fix it please.

If you create a react native app with the command from the getting started page: $create-react-native-app AwesomeProject then the package.json file has the following dependencies:
"dependencies": {
"expo": "^20.0.0",
"react": "16.0.0-alpha.12",
"react-native": "^0.47.0"
}
If you create an app directly in the Expo XDE, you will see in the package.json, they use a fork of react-native:
"dependencies": {
"expo": "^20.0.0",
"react": "16.0.0-alpha.12",
"react-native": "https://github.com/expo/react-native/archive/sdk-20.0.0.tar.gz"
},
Changing the react-native module path to https://github.com/expo/react-native/archive/sdk-20.0.0.tar.gz and running npm install will fix the problem.

That's how I fixed it:
I updated my "react-native" dependency to the latest one available:
"https://github.com/expo/react-native/archive/sdk-23.0.0.tar.gz"
I removed all dependency that I had installed by mistake in my previous expo app that actually required react-native link using the npm uninstall --save command:
react-native-image-to-base64,
react-native-cloudinary
Then I also had to remove them from the General > Linked Frameworks and Libraries
Now it works! I'm having issues with the Facebook Login now but at least it doesn't crash my app.
Good luck to you.

Related

Upgrading React Native from 0.62.2 to 0.63.0 hangs on blank white screen

I am trying to upgrade react native from 0.62.2 to 0.63.0 manually. I followed upgrade helper.
App builds with no errors but it shows up white screen on start up for both android and ios.
Dependencies
"react": "16.13.1",
"react-dom": "^16.13.1",
"react-native": "0.63.0"
I tried clearing cache, removing node_modules and pods and then run npm install and pod install. Nothing helped and I still have the same issue.
hey I just update node packages is not not enough you should update other files too, please check following like
https://react-native-community.github.io/upgrade-helper/?from=0.62.2&to=0.63.0

npm start command gives error in react native

I have been using /programming react native app since last 2 months.
Always it used to work fine , I could code and run the simulator on my iphone . The environment details are as follows:
EXPO --version 3.1.2 , npm -v 6.9.0, node -v12.4.0
Suddenly, yesterday when I started the project by command 'expo start' it did not start, got a message expo is not installed. Hence I installed expo cli.
Now I typed the command 'expo start', however it gives error
It opens the Metro builder but stops with error
I am unable to start the project and continue coding the app
I tried following troubleshooting :
removed 'node_modules' folder , re-installed 'npm install'
however the same issue persists.
Expected:
The project should start , I should be able to run the simulator in phone
Actual:
The project did not start with 'expo start'
Microsoft Windows [Version 10.0.17134.1006]
(c) 2018 Microsoft Corporation. All rights reserved.
C:\Users\Jituni>cd C:\Users\Jituni\bholmentorworld
C:\Users\Jituni\bholmentorworld>expo start
Starting project at C:\Users\Jituni\bholmentorworld
Expo DevTools is running at http://localhost:19002
Opening DevTools in the browser... (press shift-d to disable)
Error: Can't find react-native in package.json dependencies
Error: React Native is not installed. Please run `npm install` in your project directory.
Couldn't start project. Please fix the errors and restart the project.
Set EXPO_DEBUG=true in your env to view the stack trace.
this is the dependencies.
{
"dependencies": {
"eslint": "^6.2.1",
"expo": "^33.0.0",
"firebase": "^6.4.0",
"react": "16.8.3",
"react-dom": "^16.8.6",
"react-native-gesture-handler": "^1.2.2",
"react-native-reanimated": "^1.0.1",
"react-native-web": "^0.11.4",
"react-navigation": "^3.11.1"
}
}
you hadn't installed the react-native in your dependencies.
SOLUTION
you should make the new project with expo-cli.
FIRST, run this command -> expo init projectname
at this step, select the blank project selection.
then you can see the generated project.
SECOND, merge the dependencies. and then run npm install or yarn install.
LAST, run react-native project with npm start or yarn start.

Unable to resolve module react-native/Libraries/Components/View/ViewStylePropTypes

This is my package.json:
{
"name": "BStore",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"expo": "^32.0.5",
"native-base": "^2.11.0",
"prop-types": "^15.7.2",
"react": "16.6.3",
"react-native": "0.58.3",
"react-native-gesture-handler": "^1.0.15",
"react-native-paper": "^2.11.0",
"react-navigation": "^3.0.9",
"react-navigation-material-bottom-tabs": "^1.0.0"
},
"devDependencies": {
"babel-core": "7.0.0-bridge.0",
"babel-jest": "24.1.0",
"jest": "24.1.0",
"metro-react-native-babel-preset": "0.51.1",
"react-test-renderer": "16.6.3"
},
"jest": {
"preset": "react-native"
}
}
I am getting this error Unable to resolve modulereact-native/Libraries/Components/View/ViewStylePropTypes`
any ideas how can I solve this issue?
Had same issue.
As I find out expo 32.0.5 and react-native 0.58.3 are not compatible. So expo react-native fork should be used.
To install it you can use command
npm install --save react-native#https://github.com/expo/react-native/archive/sdk-32.0.1.tar.gz
You have to read the error-message carefully. I've the same issue, mine was:
Unable to resolve module
react-native/Libraries/Components/View/ViewStylePropTypes from
/APP/node_modules/react-native-render-html/src/HTMLUtils.js:
Module react-native/Libraries/Components/View/ViewStylePropTypes
does not exist in the Haste module map
So the 3rd Party Library react-native-render-html cause the error, because it try to use ViewStylePropTypes.
In case of #adrian-moisa: For you it's react-native-reanimated.
Don't know what the cause was for the ThreadOpener, he didn't post an usable error-message.
Fact is, that ViewStylePropTypes was removed up from react-native 0.58
compare:
https://github.com/facebook/react-native/tree/v0.57.8/Libraries/Components/View
https://github.com/facebook/react-native/tree/v0.58.0/Libraries/Components/View
So the solution is to figure out, which 3rd-Party Component cause the error, and look if there is an upgrade from the maintainer, or yourself have to patch it (e.g. with patch-package)
This combo works for me:
"expo": "^31.0.4",
"react": "16.5.0",
"react-native": "https://github.com/expo/react-native/archive/sdk-31.0.1.tar.gz",
I adjusted the instructions from here, with what worked for me:
Here’s how to upgrade your app to Expo SDK 32.0.6 from 31.0.0:
Close your Expo CLI server In app.json, change sdkVersion to "32.0.1"
In package.json, change these dependencies:
react-native to "https://github.com/expo/react-native/archive/sdk-32.0.1.tar.gz"
expo to "^32.0.6"
react to "16.8.6" — (this exact version)
react-navigation to "^3.9.1" (if you use it — this is also optional, you don’t have to update it to use the newest SDK. If you
choose to, make sure you read the changelog for breaking changes, and
see this upgrade guide for upgrading from v2 to v3.)
jest-expo to "^32.0.0" (if you use it)
sentry-expo to "~1.11.2" (if you use it) Delete your project’s node_modules directory and run npm install again (or use Yarn, we
love Yarn) Run expo start -c Update the Expo app on your phones from
the App Store / Google Play. expo-cli will automatically update your
apps in simulators. Make sure to check the breaking changes section
of this post! If you built a standalone app previously, remember that
you will need to create a new build in order to update the SDK
version. Run expo build:iosand/or expo build:android when you are
ready to do a new build for submission to stores. If you are planning
to submit your iOS app to the App Store, you must upgrade to Xcode 10
in order to do so.

failed building javascript bundle about #expo/vector-icons

I use react-native-app and expo to build a project called UdaciFitness, but I come across some problems when I use 'import '#expo/vector-icon''
the error message in windows CMD is
17:41:21: Unable to resolve #expo/vector-icons" from "./C:\\Users\\acer\\WebstormProjects\\UdaciFitness\\node_modules\\expo\\src\\Icon.js"
17:41:21: Failed building JavaScript bundle
18:16:28: Unable to resolve #expo/vector-icons" from "./C:\\Users\\acer\\WebstormProjects\\UdaciFitness\\node_modules\\expo\\src\\Icon.js"
here is part of my package.json:
"dependencies": {
"expo": "^25.0.0",
"react": "16.2.0",
"react-native": "0.52.0"
}
You need to install #expo/vector-icons. Run yarn add #expo/vector-icons in your project directory to add it to package.json and install the package. Then restart the Expo tools and load your project again.

Undefined is not an object (evaluating ExponentConstants.linkinguri)

Can someone guide me on this issue which shows up once I try using expo in my react native project.
Dependencies:
"expo": "^21.0.2",
"react": "^16.0.0-alpha.12",
"react-native": "^0.48.4",
"react-native-animatable": "^1.2.4",
"react-native-snap-carousel": "^3.3.2",
"react-native-swiper": "^1.5.13",
"react-navigation": "^1.0.0-beta.13"
Error Message
If I use create-react-native-app to initiate my project, I don't see the issue that you mentioned. But if I use react-native init to create my project, I see the same issue. To fully take advantage of the integration of react native and expo client, do the following:
npm install -g create-react-native-app
create-react-native-app YourProjectName
cd YourProjectName
npm start
Hope that helps.