Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/react-native/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Gradle 反应本机示例(UIExplorer)生成问题_Gradle_React Native_Gradlew - Fatal编程技术网

Gradle 反应本机示例(UIExplorer)生成问题

Gradle 反应本机示例(UIExplorer)生成问题,gradle,react-native,gradlew,Gradle,React Native,Gradlew,解决方案 我已经通过帮助@LeoCavalcante解决了这个问题。 问题是,在命令控制台中使用gradlewword时,可以直接运行它。因为,当使用gradlew时,Windows控制台运行gradlew.bat 不要尝试使用cygwin(linux)bash命令,如sh./gradle:Exam…或sh gradle:Exam…或bash gradle:Exam… 只需使用gradlew:Examples:UIExplorer:android:app:installDebug 我无法从re

解决方案

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

不要尝试使用cygwin(linux)bash命令,如
sh./gradle:Exam…
sh gradle:Exam…
bash gradle:Exam…

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


我无法从react本地官方repo构建UIExplorer示例

我使用Windows和cygwin64

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

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

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

当我使用
--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
08:07:50.341[DEBUG][org.gradle.model.internal.registry.DefaultModelRegistry]运行模型元素“tasks.validateDebugSigning”规则操作项目..tasks.validateDebugSigning()
08:07:50.347[DEBUG][org.gradle.model.internal.registry.DefaultModelRegistry]Mutating tasks.validateDebugSigning using Project..tasks.validateDebugSigning()
08:07:50.354[DEBUG][org.gradle.model.internal.registry.DefaultModelRegistry]正在将模型元素“tasks.validateDebugSigning”转换为状态项目定义。
08:07:50.389[错误][org.gradle.BuildExceptionReporter]
08:07:50.402[错误][org.gradle.BuildExceptionReporter]失败:生成失败,出现异常。
08:07:50.409[错误][org.gradle.BuildExceptionReporter]
08:07:50.414[错误][org.gradle.BuildExceptionReporter]*出了什么问题:
08:07:50.420[错误][org.gradle.BuildExceptionReporter]在根项目“react native”中未找到任务“”。
08:07:50.425[错误][org.gradle.BuildExceptionReporter]
08:07:50.429[错误][org.gradle.BuildExceptionReporter]*尝试:
08:07:50.436[错误][org.gradle.BuildExceptionReporter]运行gradlew任务以获取可用任务的列表。使用--stacktrace选项运行以获取堆栈跟踪。
08:07:50.443[生命周期][org.gradle.BuildResultLogger]
08:07:50.449[生命周期][org.gradle.BuildResultLogger]生成失败
08:07:50.456[生命周期][org.gradle.BuildResultLogger]
08:07:50.461[生命周期][org.gradle.BuildResultLogger]总时间:2分钟25.343秒

如何克服这个问题?

它认为单一选项
:示例:UIExplorer:android:app:installDebug
是一系列选项


尝试运行:
bash-gradlew”:示例:UIExplorer:android:app:installDebug“

非常感谢您。但是我尝试了
sh./gradlew:Examples:UIExplorer:android:app:installDebug“
的命令。不幸的是,同样的结果。我试过android-ndk-r11b和android-ndk-r10e。我想除了你之外,没有人能在Windows上构建这个示例。请完全按照我提到的方式尝试,使用
bash
而不是
sh
,并且在文件名之前不使用
/
。好的。我已删除react本机目录。我现在运行
npm install
命令:)然后我尝试你的建议。不幸的是,Leo。无论如何,谢谢你。它给出了完全相同的错误消息。你还记得你在Windows上的安装/构建步骤吗?事实上,如果你有
UIExplorer.apk
,它对我很有用。当然如果你有空的话。。(我必须将应用程序安装到手机上,然后尝试地理位置屏幕)