react-native run-android 报错,是android配置问题吗?



  • $ react-native run-android
    Starting JS server...
    Running F:\Android\sdk/platform-tools/adb reverse tcp:8081 tcp:8081
    error: no devices/emulators found
    Could not run adb reverse: Command failed: F:\Android\sdk/platform-tools/adb re
    erse tcp:8081 tcp:8081
    Building and installing the app on the device (cd android && gradlew.bat instal
    Debug...
    :app:preBuild UP-TO-DATE
    :app:preDebugBuild UP-TO-DATE
    :app:checkDebugManifest
    :app:preReleaseBuild UP-TO-DATE
    :app:prepareComAndroidSupportAppcompatV72301Library
    :app:prepareComAndroidSupportRecyclerviewV72301Library
    :app:prepareComAndroidSupportSupportV42321Library
    :app:prepareComFacebookFrescoDrawee0110Library
    :app:prepareComFacebookFrescoFbcore0110Library
    :app:prepareComFacebookFrescoFresco0110Library
    :app:prepareComFacebookFrescoImagepipeline0110Library
    :app:prepareComFacebookFrescoImagepipelineBase0110Library
    :app:prepareComFacebookFrescoImagepipelineOkhttp30110Library
    :app:prepareComFacebookReactReactNative0320Library
    :app:prepareComFacebookSoloaderSoloader010Library
    :app:prepareOrgWebkitAndroidJscR174650Library
    :app:prepareDebugDependencies
    :app:compileDebugAidl
    :app:compileDebugRenderscript
    :app:generateDebugBuildConfig
    :app:generateDebugAssets UP-TO-DATE
    :app:mergeDebugAssets
    :app:generateDebugResValues UP-TO-DATE
    :app:generateDebugResources
    :app:mergeDebugResources
    :app:bundleDebugJsAndAssets SKIPPED
    :app:processDebugManifest
    :app:processDebugResources FAILED

    FAILURE: Build failed with an exception.

    • What went wrong:
      Execution failed for task ':app:processDebugResources'.

    at index 4

    • Try:
      Run with --stacktrace option to get the stack trace. Run with --info or --debug
      option to get more log output.

    BUILD FAILED



  • 去确定自己 android studio 中SDK Platforms 是否有设置正确,确保正确后使用 react-native init <name> 生成一个项目,再运行react-native run-android



  • 是的 通过 android studio 又安装了一遍 sdk 就可以了 歇息



  • @feng003 怎么安装一遍啊



  • @willing7 去sdk 管理器 重新安装 官网要求的 sdk 版本


Log in to reply