* 에러 메세지 

The development server returned response error code: 500

 - react-native 상위 버젼에서 나타나는 오류임. 

(dependencies 를 적절히 낮춰서 맞춰주면 해결됨.)

 - 현재 환경 : 

안드로이드 스튜디오 : SDK Platform(android 9.0)

디바이스(5.1 WVGA API 26, android 8.0)


* 시도 (실패, 대부분 이 방법들로 성공했다고 하지만 내 경우는 모두 실패함.)

 - https://github.com/expo/expo/issues/1282


1.

  "dependencies": {

    "@babel/runtime": "^7.1.2",

    "react": "16.5.0",

    "react-native": "0.55.2",

    "babel-preset-react-native": "4"

  },


2. 

Downgrade the following:

react-native init Project

cd Project

npm uninstall react-native

npm install --save react-native@0.55.4

npm uninstall --save babel-preset-react-native

npm install --save babel-preset-react-native@4.0.0

react-native run-android


3.

for now after react-native init, since a lot of new changes are coming out, this fix worked for me (I got it from reading other issues):

with npm:

npm install --save-dev @babel/core

npm install --save-dev @babel/runtime

or with yarn:

yarn add --dev @babel/core

yarn add --dev @babel/runtime


if on ios you get _this._registerEvents is not a function, after a successful build

do

npm run start --reset-cache

or

react-native start --reset-cache


* 시도 (성공)

 - https://github.com/react-community/create-react-native-app/issues/401


1.

None of the solutions above worked for me. Finaly I replaced the dependencies in package.json to match the one generated a couple of days ago with react-native init. This is the plane base package.json that works for me, even using react-native 0.57


{

  "name": "someProject",

  "version": "0.0.1",

  "private": true,

  "scripts": {

    "start": "node node_modules/react-native/local-cli/cli.js start",

    "test": "jest"

  },

  "dependencies": {

    "react": "16.5.0",

    "react-native": "0.57.0"

  },

  "devDependencies": {

    "babel-jest": "23.6.0",

    "jest": "23.6.0",

    "metro-react-native-babel-preset": "0.45.3",

    "react-test-renderer": "16.5.0"

  },

  "jest": {

    "preset": "react-native"

  }

}

Notice that


"react": "16.5.0"

"react-native": "0.57.0"

and


"metro-react-native-babel-preset": "0.45.3",

"react-test-renderer": "16.5.0"

works together as required.


Those were the changes in package.json that made it possible to build and run the app in my case.



+ Recent posts