React Native示例(UIExplorer)构建问题

时间:2016-01-25 06:57:48

标签: gradle react-native gradlew

我通过帮助@LeoCavalcante解决了这个问题。 问题是在命令控制台中使用gradlew字时,它可以直接运行。因为,在使用gradlew时,Windows控制台会运行gradlew.bat

请勿尝试使用cygwin(linux)bash命令,例如sh ./gradle :Exam...sh gradle :Exam..bash gradle :Exam...

只需使用gradlew :Examples:UIExplorer:android:app:installDebug

即可

我无法从反应本地官方回购中构建UIExplorer示例。

我使用Windows和cygwin64。

我已经设置了SDK和NDK。然后克隆了repo并在react-native的根目录中提供了npm install命令,该目录刚刚被克隆。我添加了local.properties文件,该文件指定了sdk.dirndk.dir路径。

当我尝试sh ./gradlew :Examples:UIExplorer:android:app:installDebug命令时,控制台给出了如下输出;

enter image description here

当我尝试使用--debug参数的命令时,控制台输出变得太长。但错误行如下;

08:07:50.341 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Running model element 'tasks.validateDebugSigning' rule action Project.<init>.tasks.validateDebugSigning()
08:07:50.347 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Mutating tasks.validateDebugSigning using Project.<init>.tasks.validateDebugSigning()
08:07:50.354 [DEBUG] [org.gradle.model.internal.registry.DefaultModelRegistry] Transitioning model element 'tasks.validateDebugSigning' to state ProjectionsDefined.
08:07:50.389 [ERROR] [org.gradle.BuildExceptionReporter]
08:07:50.402 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception.
08:07:50.409 [ERROR] [org.gradle.BuildExceptionReporter]
08:07:50.414 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong:
08:07:50.420 [ERROR] [org.gradle.BuildExceptionReporter] Task '.' not found in root project 'react-native'.
08:07:50.425 [ERROR] [org.gradle.BuildExceptionReporter]
08:07:50.429 [ERROR] [org.gradle.BuildExceptionReporter] * Try:
08:07:50.436 [ERROR] [org.gradle.BuildExceptionReporter] Run gradlew tasks to get a list of available tasks. Run with --stacktrace option to get the stack trace.
08:07:50.443 [LIFECYCLE] [org.gradle.BuildResultLogger]
08:07:50.449 [LIFECYCLE] [org.gradle.BuildResultLogger] BUILD FAILED
08:07:50.456 [LIFECYCLE] [org.gradle.BuildResultLogger]
08:07:50.461 [LIFECYCLE] [org.gradle.BuildResultLogger] Total time: 2 mins 25.343 secs

我如何克服这个问题?

1 个答案:

答案 0 :(得分:1)

该等级认为单个选项:Examples:UIExplorer:android:app:installDebug是一系列选项。

尝试运行:bash gradlew ":Examples:UIExplorer:android:app:installDebug"