ERROR listen EACCES 0.0.0.0:8081 android环境,关闭端口仍无效,求大神呀



  • react-native run-android
    运行节结果如图
    0_1511244738615_image.png

    而后运行

    react-native start
    出现错误
    0_1511244854650_image.png

    模拟器界面
    0_1511244893722_image.png
    界面不报错,只是在app.js里面修改的文本信息运行后没有改变
    求大神支招


  • administrators

    run-android会自己调用react-native start 所以你再start会报错
    你目前贴出来的东西一切正常,修改完后刷新模拟器即可(对着模拟器按两下字母R键)



  • 大神的操作之后仍无变化
    我改的是text里面的文字
    0_1511249799039_image.png
    再运行依旧没变化,界面显示如图
    0_1511250233787_image.png



  • @晴明 大神,仍无变化


  • administrators

    看到最后一行报错连接不上packager
    你是不是把packager窗口关了



  • @晴明
    新手,package窗口是什么窗口,这边只有这个模拟器的窗口打开了

    我把那个信息在再贴全:

    11/21 15:56:14: Launching app
    No apk changes detected since last installation, skipping installation of D:\myDemo\AwesomeProject\android\app\build\outputs\apk\app-debug.apk
    $ adb shell am force-stop com.awesomeproject
    $ adb shell am start -n "com.awesomeproject/com.awesomeproject.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
    Client not ready yet..Waiting for process to come online
    Connected to process 11732 on device emulator-5554
    Capturing and displaying logcat messages from application. This behavior can be disabled in the "Logcat output" section of the "Debugger" settings page.
    I/zygote: Not late-enabling -Xcheck:jni (already on)
    W/zygote: Unexpected CPU variant for X86 using defaults: x86
    V/fb-UnpackingSoSource: locked dso store /data/user/0/com.awesomeproject/lib-main
    I/fb-UnpackingSoSource: dso store is up-to-date: /data/user/0/com.awesomeproject/lib-main
    V/fb-UnpackingSoSource: releasing dso store lock for /data/user/0/com.awesomeproject/lib-main
    D/ReactNative: ReactInstanceManager.ctor()
    D/NetworkSecurityConfig: No Network Security Config specified, using platform default
    D/ReactNative: ReactInstanceManager.createReactContextInBackground()
    D/ReactNative: ReactInstanceManager.recreateReactContextInBackgroundInner()
    D/OpenGLRenderer: HWUI GL Pipeline
    E/unknown:ReactNative: Got non-success http code from packager when requesting status: 404
    I/zygote: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasWideColorDisplay retrieved: 0
    I/OpenGLRenderer: Initialized EGL, version 1.4
    D/OpenGLRenderer: Swap behavior 1
    W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
    D/OpenGLRenderer: Swap behavior 0
    W/unknown:ReconnectingWebSocket: Couldn't connect to "ws://10.0.2.2:8081/message?device=Android%20SDK%20built%20for%20x86%20-%208.1.0%20-%20API%2027&app=com.awesomeproject&clientid=DevSupportManagerImpl", will silently retry
    D/EGL_emulation: eglCreateContext: 0x9fa840c0: maj 2 min 0 rcv 2
    W/unknown:ReconnectingWebSocket: Couldn't connect to "ws://10.0.2.2:8081/message?device=Android%20SDK%20built%20for%20x86%20-%208.1.0%20-%20API%2027&app=com.awesomeproject&clientid=DevSupportManagerImpl", will silently retry
    D/EGL_emulation: eglMakeCurrent: 0x9fa840c0: ver 2 0 (tinfo 0x9fa833c0)
    D/ReactNative: ReactInstanceManager.recreateReactContextInBackgroundFromBundleLoader()
    D/ReactNative: ReactInstanceManager.recreateReactContextInBackground()
    D/ReactNative: ReactInstanceManager.runCreateReactContextOnNewThread()
    I/zygote: Thread[25,tid=11769,Native,Thread*=0xa783ba00,peer=0x1689bda8,"Thread-2"] recursive attempt to load library "/data/app/com.awesomeproject-y0hzbUxPf_DiQmfCLblfcA==/lib/x86/libfb.so"
    D/ReactNative: ReactInstanceManager.createReactContext()
    D/EGL_emulation: eglMakeCurrent: 0x9fa840c0: ver 2 0 (tinfo 0x9fa833c0)
    W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTGroupViewManager
    W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTGroupShadowNode
    W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTShapeViewManager
    W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTShapeShadowNode
    W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTTextViewManager
    W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTTextShadowNode
    W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.checkbox.ReactCheckBoxManager
    W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.uimanager.LayoutShadowNode
    W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.picker.ReactDialogPickerManager
    W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.drawer.ReactDrawerLayoutManager
    W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.picker.ReactDropdownPickerManager
    W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.scroll.ReactHorizontalScrollViewManager
    W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.scroll.ReactHorizontalScrollContainerViewManager
    W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.progressbar.ReactProgressBarViewManager
    W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.progressbar.ProgressBarShadowNode
    W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.scroll.ReactScrollViewManager
    W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.slider.ReactSliderManager
    W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.slider.ReactSliderManager$ReactSliderShadowNode
    W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.switchview.ReactSwitchManager
    W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.switchview.ReactSwitchManager$ReactSwitchShadowNode
    W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.toolbar.ReactToolbarManager
    W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.webview.ReactWebViewManager
    W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.swiperefresh.SwipeRefreshLayoutManager
    W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTSurfaceViewManager
    W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.art.ARTSurfaceViewShadowNode
    W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.frescosupport.FrescoBasedReactTextInlineImageViewManager
    W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.frescosupport.FrescoBasedReactTextInlineImageShadowNode
    W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.image.ReactImageManager
    W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.modal.ReactModalHostManager
    W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.modal.ModalHostShadowNode
    W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.ReactRawTextManager
    W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.ReactRawTextShadowNode
    W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.textinput.ReactTextInputManager
    W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.textinput.ReactTextInputShadowNode
    W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.ReactTextViewManager
    W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.ReactTextShadowNode
    W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.view.ReactViewManager
    W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.viewpager.ReactViewPagerManager
    W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.ReactVirtualTextViewManager
    W/unknown:ViewManagerPropertyUpdater: Could not find generated setter for class com.facebook.react.views.text.ReactVirtualTextShadowNode
    D/ReactNative: Initializing React Xplat Bridge.
    D/ReactNative: Initializing React Xplat Bridge before initializeBridge
    D/ReactNative: Initializing React Xplat Bridge after initializeBridge
    D/ReactNative: CatalystInstanceImpl.runJSBundle()
    D/ReactNative: ReactInstanceManager.setupReactContext()
    D/ReactNative: CatalystInstanceImpl.initialize()
    W/unknown:ReactNative: Packager connection already open, nooping.
    D/ReactNative: ReactInstanceManager.attachRootViewToInstance()
    I/ReactNativeJS: Running application "AwesomeProject" with appParams: {"rootTag":1}. DEV === false, development-level warning are OFF, performance optimizations are ON
    I/zygote: Do partial code cache collection, code=30KB, data=24KB
    I/zygote: After code cache collection, code=30KB, data=24KB
    I/zygote: Increasing code cache capacity to 128KB
    I/zygote: Do partial code cache collection, code=59KB, data=41KB
    I/zygote: After code cache collection, code=59KB, data=41KB
    I/zygote: Increasing code cache capacity to 256KB
    W/unknown:InspectorPackagerConnection: Couldn't connect to packager, will silently retry
    I/zygote: Do full code cache collection, code=120KB, data=79KB
    I/zygote: After code cache collection, code=105KB, data=58KB



  • @晴明
    已经解决了,但仍没有其他窗口弹出
    ..\android\app\src\main\assets
    目录下的文件删除(assets目录是手工创建的)
    再运行
    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/

    再执行时,页面发生了变化,但每次都需要这样的话好像很麻烦,有什么其他好的方法?


  • administrators

    从头到尾就不应该bundle 正式发布时才应该bundle
    bundle的结果就是不能更新



  • @晴明 但是在项目运行的时候,如果不生成bundle,app页面会

    报错:unable to load script from assets ‘index.android bundle’ ,make sure your bundle is packaged correctly or youu’re runing a packager server


  • administrators



  • @晴明 我用的是谷歌模拟器
    如果不bundle的话,怎么解决这个问题呢,你给的那个链接里面并没有看到这个解决方案,从网上搜来的大多数的解决方案都是说执行那个命令
    0_1511506105079_image.png


  • administrators

    我的链接里就是解决方案


登录后回复