Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

React Native 0.59.1 Version Mismatch #23978

Closed
thecodrr opened this issue Mar 16, 2019 · 23 comments
Closed

React Native 0.59.1 Version Mismatch #23978

thecodrr opened this issue Mar 16, 2019 · 23 comments
Labels
Bug Resolution: Locked This issue was locked by the bot.

Comments

@thecodrr
Copy link
Contributor

thecodrr commented Mar 16, 2019

🐛 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:

  1. Remove app/build folder
  2. Run .\gradlew clean
  3. Run react-native start --reset-cache
  4. Delete node_modules folder and run yarn
  5. Tried all the below steps with npm as well.

Screenshot:
screenshot-2019-03-17_00 16 30 204

To Reproduce

I did the following steps to upgrade to 0.59.1:

  1. yarn add react-native@latest
  2. react-native upgrade --legacy (did yes or no appropriately)
  3. Remove the node_modules folder
  4. yarn
  5. 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
@Esemesek
Copy link
Contributor

Esemesek commented Mar 17, 2019

Don't think this is a bug. @theweavrs you likely need to reinstall app. Try removing old one and installing fresh one.

@thecodrr
Copy link
Contributor Author

@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 own react-native:0.57.5 to work. I will remove it and see if it works.

@thecodrr
Copy link
Contributor Author

Okay so I ignored the error and simply added my IP in the Dev Menu and then reloaded. It works now but I am getting this issue now: #19719

@rickhanlonii
Copy link
Member

Hey @theweavrs, thanks for filing, glad to hear you got this one fixed

As you said, this isn't a bug so I'm going to close this as this issue tracker isn't a help forum 👍

@ghost
Copy link

ghost commented Mar 29, 2019

My way is close terminal and run again!this is solve

@jaredramirez
Copy 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:

project.ext.react = [
  bundleInBeta: true,
  devDisabledInBeta: true
];

to /app/build.gradle. beta is the name of my custom build type.

@ugifractal
Copy link

I solved this issue by reiinstall expo client

expo client:install:android

@StarkAndy
Copy link

Still haven't got solution yet can anyone please help me how to resolve it .

@aplinxy9plin
Copy link

Got this error again and again.. Help me to resolve it, please.
IzP50A1zosY

@StarkAndy
Copy link

If you are still not able to resolve the issue please run it from your sublime or visual studio code .Hope it works

@boneyao
Copy link

boneyao commented Aug 5, 2019

I solved this issue by react-native link

@desfacss
Copy link

desfacss commented Aug 5, 2019

I solved this issue by react-native link

Can you elaborate please

@MatheusMesquita
Copy link

I got the same problem after migrating from React-Native: 59.5 to 60.4. I followed all the instructions but i keep getting this error:
Screenshot_20190809-133133

I have already tried:

  • Removing node_modules/
  • Removing react-navigation
  • Another develop environment
  • Deleting entire folder and cloning from remote

@ChibikeEchendu1
Copy link

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/

@hungvu193
Copy link

hungvu193 commented Oct 2, 2019

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 and react-native run-android

@MatheusMesquita
Copy link

I ended up creating another project and copying package.json and .js files to the new one, but thanks guys!

@Ericnsamba
Copy link

My way is close terminal and run again!this is solve

Thank you, this works perfectly fine

@nbarron16
Copy link

If using expo, use 'expo upgrade' rather than trying to manually upgrade react and react-native packages.

@rahulnainwal107
Copy link

rahulnainwal107 commented Dec 11, 2019

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

@kirankbee
Copy link

I am facing similar problem with both Android and iOS simulators, any tips on fixing it?

@kirankbee
Copy link

thanks guys...I removed the package lock.json, reopened the app in a new terminal and re-run the build...it is now working on android simulator

@ls-ramos
Copy link

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 and react-native run-android

Thanks !! doing that and running from the terminal instead of from android studio did it for me !

@manojalwisnz
Copy link

Just close the terminal and run again. so this error will be disappeared.

@facebook facebook locked as resolved and limited conversation to collaborators Mar 19, 2020
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Mar 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests