zoukankan      html  css  js  c++  java
  • React Native 错误:A problem occurred configuring project ':app'. 和Execution failed for task ‘XXX’

    最近换电脑了,以前的重装了一下react native环境,还要把以前做的项目导进来,导项目的过程中遇到了一点小坑,也都解决了,在这里记录一下。

    先进通过cmd应用cd到项目下,运行命令

    react-native run-android

    导项目我是抱着必错的决心....先运行下看哪里出差了。出现的第一个错误是SDK位置问题,之前电脑安装的SDK和这个电脑安装的不一样。

    FAILURE: Build failed with an exception.
    
    * What went wrong:
    A problem occurred configuring project ':app'.
    > The SDK directory 'F:AndroidSDKAndroidSDK' does not exist.
    
    * Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

    解决办法:

    这个是配置文件的问题,利用好android studio能够很轻松的解决。

    先打开android studio点击open

    找到你项目下面的android点击ok

    android studio会自动识别你的配置问题,帮你修复。

    也可以手动更改SDK的位置

    继续react-native run-android,发现继续错误。

    FAILURE: Build failed with an exception.
    
    * What went wrong:
    Execution failed for task ':app:incrementalDebugJavaCompilationSafeguard'.
    > java.io.IOException: Could not delete path 'D:RN
    eact_native_workspaceAwesomeProject2androidappuildintermediatesclassesdebugandroidsupport'.
    
    * Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
    
    BUILD FAILED

    说它无法删除D:RN eact_native_workspace.....debugandroidsupport,我们就进入你的项目androidappuildintermediatesclasses里把debug文件手动删除。

    继续react-native run-android可能还会错误,都是debug文件里面与配置相关的,继续删除删除debug文件再运行。我操作了4~5次,最后项目安装成功了。

     

    我是也初学者,,有什么错误的地方望指出!

  • 相关阅读:
    04_特征工程
    03_特征清洗
    02_数据探索
    01_简介
    cache是什么文件?
    gulp详细入门教程
    HTML5实战与剖析之触摸事件(touchstart、touchmove和touchend)
    h4和h5的区别
    弹性盒布局
    js面向对象
  • 原文地址:https://www.cnblogs.com/-1024/p/9139734.html
Copyright © 2011-2022 走看看