react-native: React Native 0.59.1 Version Mismatch
🐛 Bug Report
So I upgraded to react-native:0.59.1
from react-native:0.57.5
and every time I do react-native run-android
it builds successfully but I get this error.
What I have already tried:
- Remove
app/build
folder - Run
.\gradlew clean
- Run
react-native start --reset-cache
- Delete
node_modules
folder and runyarn
- Tried all the below steps with npm as well.
Screenshot:
To Reproduce
I did the following steps to upgrade to 0.59.1
:
yarn add react-native@latest
react-native upgrade --legacy
(did yes or no appropriately)- Remove the node_modules folder
yarn
- Run
react-native run-android
Expected Behavior
The app should build and run without a version mismatch error.
Code Example
My package.json:
{
"name": "scrittori",
"version": "0.1.0",
"private": true,
"rnpm": {
"assets": [
"./src/assets/Fonts/"
]
},
"devDependencies": {
"@babel/core": "^7.1.5",
"@babel/preset-flow": "^7.0.0",
"babel-core": "^7.0.0-bridge.0",
"babel-plugin-transform-decorators-legacy": "^1.3.5",
"babel-plugin-transform-remove-console": "^6.9.4",
"babel-preset-react-native-stage-0": "^1.0.1",
"eslint": "^5.9.0",
"eslint-config-google": "^0.10.0",
"jest": "^23.5.0",
"jest-react-native": "^18.0.0",
"metro-react-native-babel-preset": "^0.48.3",
"react-test-renderer": "16.5.2"
},
"scripts": {
"start": "react-native start",
"android": "react-native run-android",
"ios": "react-native run-ios",
"test": "jest"
},
"jest": {
"preset": "react-native"
},
"dependencies": {
"@babel/plugin-external-helpers": "^7.0.0",
"@babel/runtime": "^7.1.5",
"core-js": "^2.5.7",
"install": "^0.12.2",
"moment": "2.22.2",
"native-base": "^2.12.1",
"prop-types": "^15.6.2",
"react": "16.8.3",
"react-native": "^0.59.1",
"react-native-animatable": "^1.3.0",
"react-native-clear-app-cache": "^1.0.4",
"react-native-dialogs": "^1.0.2",
"react-native-elements": "^1.0.0-beta7",
"react-native-firebase": "^5.1.0",
"react-native-git-upgrade": "^0.2.7",
"react-native-image-crop-picker": "^0.21.3",
"react-native-image-resizer": "^1.0.0",
"react-native-linear-gradient": "^2.4.3",
"react-native-modal-filter-picker": "^1.3.4",
"react-native-navigation": "https://github.com/theweavrs/react-native-navigation/tarball/master",
"react-native-popup-menu-android": "^1.0.3",
"react-native-progress": "^3.5.0",
"react-native-share": "^1.1.3",
"react-native-simple-dialogs": "^1.0.0",
"react-native-swipe-view": "^3.0.1",
"react-native-timeago": "^0.4.0",
"react-native-vector-icons": "^6.2.0",
"react-native-view-more-text": "^2.0.1",
"react-native-view-shot": "^2.5.0",
"react-redux": "^5.1.0",
"redux": "^4.0.1",
"redux-logger": "^3.0.6",
"redux-persist": "^5.10.0",
"redux-thunk": "^2.3.0",
"sync-storage": "^0.3.0"
}
}
Environment
React Native Environment Info:
System:
OS: Windows 10
CPU: (8) x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
Memory: 5.07 GB / 15.89 GB
Binaries:
Yarn: 1.13.0 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 6.4.1 - C:\Program Files\nodejs\npm.CMD
IDEs:
Android Studio: Version 3.3.0.0 AI-182.5107.16.33.5264788
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 23 (4 by maintainers)
My way is close terminal and run again!this is solve
try react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/
I solved this issue by
react-native link
I was running into this issue on android, but only when building a custom build type. I was able to fix it by adding:
to
/app/build.gradle
.beta
is the name of my custom build type.use android:usesCleartextTraffic=“true” in your AndroidManifest file like this : <application android:usesCleartextTraffic=“true”
>
</application>
The default value of usesCleartextTraffic for apps that target API level 27 or lower is “true”. Apps that target API level 28 or higher default to “false”.If all the solution above doesn’t work, please delete file
android.index.bundle
in android/app/asset. After that regenerate this file by using this command at the root project:react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/
Clean and rebuild your android project andreact-native run-android
@Esemesek it’s not a bug, I agree. But I have tried everything from top to bottom; nothing worked. I removed the old one multiple times. Don’t know why this is happening. Maybe because of
react-native-navigation
, it uses its ownreact-native:0.57.5
to work. I will remove it and see if it works.