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

RNTester doesn't work #23936

Closed
tipoc123 opened this issue Mar 14, 2019 · 8 comments
Closed

RNTester doesn't work #23936

tipoc123 opened this issue Mar 14, 2019 · 8 comments
Labels
Bug Resolution: Locked This issue was locked by the bot.

Comments

@tipoc123
Copy link

tipoc123 commented Mar 14, 2019

🐛 Bug Report

I can't force to work your sample RNTester according to manual https://github.com/facebook/react-native/tree/master/RNTester

To Reproduce

  1. git clone https://github.com/facebook/react-native.git. It's OK!
  2. cd react-native
  3. npm install. It's OK, but shows some warnings:
npm WARN @react-native-community/cli@1.4.2 requires a peer of react-native@^0.59.0 but none is installed. You must install peer dependencies yourself.
npm WARN eslint-config-fbjs@2.0.1 requires a peer of babel-eslint@^7.2.3 but none is installed. You must install peer dependencies yourself.
npm WARN eslint-config-fbjs@2.0.1 requires a peer of eslint@^4.2.0 but none is installed. You must install peer dependencies yourself.
npm WARN eslint-config-fbjs@2.0.1 requires a peer of eslint-plugin-babel@^4.1.1 but none is installed. You must install peer dependencies yourself.
npm WARN eslint-config-fb-strict@22.1.0 requires a peer of babel-eslint@^7.2.3 || ^8.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN eslint-config-fb-strict@22.1.0 requires a peer of eslint@^4.2.0 but none is installed. You must install peer dependencies yourself.
npm WARN eslint-config-fb-strict@22.1.0 requires a peer of eslint-plugin-babel@^4.1.1 but none is installed. You must install peer dependencies yourself.
npm WARN eslint-plugin-react@7.8.2 requires a peer of eslint@^3.0.0 || ^4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN eslint-plugin-jsx-a11y@6.0.3 requires a peer of eslint@^3 || ^4 but none is installed. You must install peer dependencies yourself.
npm WARN jest-resolve-dependencies@24.5.0 requires a peer of jest-haste-map@^24.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN jest-snapshot@24.5.0 requires a peer of jest-haste-map@^24.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN jest-resolve@24.5.0 requires a peer of jest-haste-map@^24.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN The package jest-junit is included as both a dev and production dependency.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.7 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
  1. Prerequisites steps (https://facebook.github.io/react-native/docs/building-from-source.html#android):
    a) Set ANDROID_SDK and ANDROID_NDK (in ~/.bash_profile).
    b) Create RNTester/android/local.properties (with sdk.dir and ndk.dir properties within).
  2. ./gradlew :RNTester:android:app:installDebug. It's OK. Apk was installed on my android STB device.
  3. ./scripts/packager.sh. It's FAILED. Output:
    error Unable to find React Native files. Make sure "react-native" module is installed in your project dependencies.

Then I open installed RNTesterApp on my device:
screen

Logcat error:

03-14 23:09:49.718 E/unknown:ReactNative(20905): Exception in native call
03-14 23:09:49.718 E/unknown:ReactNative(20905): java.lang.RuntimeException: Unable to load script. Make sure you're either running a Metro server (run 'react-native start') or that your bundle 'RNTesterApp.android.bundle' is packaged correctly for release.
03-14 23:09:49.718 E/unknown:ReactNative(20905): 	at com.facebook.react.bridge.CatalystInstanceImpl.jniLoadScriptFromAssets(Native Method)
03-14 23:09:49.718 E/unknown:ReactNative(20905): 	at com.facebook.react.bridge.CatalystInstanceImpl.loadScriptFromAssets(CatalystInstanceImpl.java:218)
03-14 23:09:49.718 E/unknown:ReactNative(20905): 	at com.facebook.react.bridge.JSBundleLoader$1.loadScript(JSBundleLoader.java:31)
03-14 23:09:49.718 E/unknown:ReactNative(20905): 	at com.facebook.react.bridge.CatalystInstanceImpl.runJSBundle(CatalystInstanceImpl.java:247)
03-14 23:09:49.718 E/unknown:ReactNative(20905): 	at com.facebook.react.ReactInstanceManager.createReactContext(ReactInstanceManager.java:1152)
03-14 23:09:49.718 E/unknown:ReactNative(20905): 	at com.facebook.react.ReactInstanceManager.access$900(ReactInstanceManager.java:123)
03-14 23:09:49.718 E/unknown:ReactNative(20905): 	at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:943)
03-14 23:09:49.718 E/unknown:ReactNative(20905): 	at java.lang.Thread.run(Thread.java:818)

Then I close RNTesterApp and run it again. It shows only white screen. Logcat:

03-14 23:31:21.125 W/unknown:ReconnectingWebSocket(20905): Couldn't connect to "ws://localhost:8081/message?device=p212%20-%206.0.1%20-%20API%2023&app=com.facebook.react.uiapp&clientid=DevSupportManagerImpl", will silently retry

Environment

Ubuntu 18.04.2 LTS
Android 6.0.1

@react-native-bot
Copy link
Collaborator

Can you run react-native info and edit your issue to include these results under the Environment section?

If you believe this information is irrelevant to the reported issue, you may write `[skip envinfo]` alongside an explanation in your Environment: section.

@tipoc123
Copy link
Author

tipoc123 commented Mar 14, 2019

I ran next command in the cloned repository:

tipoc@tipoc-MS-7817:~/Desktop/react-native$ react-native info
Command `info` unrecognized. Make sure that you have run `npm install` and that you are inside a react-native project.

@grabbou
Copy link
Contributor

grabbou commented Mar 14, 2019

Thanks. I am on it.

@tipoc123
Copy link
Author

tipoc123 commented Mar 15, 2019

Still doesn't work. The same steps, the same errors.

Did you try to install RNTester by yourself?

facebook-github-bot pushed a commit that referenced this issue Mar 18, 2019
Summary:
Landing D14472633 again which failed because of a metro-buck issue.

Latest CLI requires `reactNativePath` to be explicitly set when `react-native` is not present under `node_modules` (which is the case when running from source).

Fixes #23936

This PR also updates CLI to latest version and removes private calls to `findPlugins` (it's now exposed under public interface).

We also remove custom `rn-cli.config.js` options that are no longer needed that we have `--reactNativePath`. I added them a month ago as a temporary workaround.

[GENERAL] [FIXED] - Internal - Update to the latest CLI
Pull Request resolved: #23940

Reviewed By: rickhanlonii

Differential Revision: D14501686

Pulled By: cpojer

fbshipit-source-id: c8dac71b3806d81c9d18b6d4a7e92d82962791f9
@cdskill
Copy link

cdskill commented Mar 20, 2019

any solution ? I encountered probably the same issue ...
image

@JserJser
Copy link

JserJser commented Apr 1, 2019

any solution ? I encountered probably the same issue ...
image

Thanks. I am on it.

image
i also have this problem。your answer can not help me . you use docker? i don not use it .and some text in package.json can not find

@sunnylqm
Copy link
Contributor

sunnylqm commented Apr 2, 2019

ping @grabbou

@grabbou
Copy link
Contributor

grabbou commented Apr 16, 2019

Have you started packager? Run yarn start from root of React Native.

@facebook facebook locked as resolved and limited conversation to collaborators Mar 15, 2020
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Mar 15, 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

7 participants
@sunnylqm @grabbou @cdskill @tipoc123 @JserJser @react-native-bot and others