简体   繁体   English

Gradle-Wrapper.Properties 不存在(Cordova)

[英]Gradle-Wrapper.Properties does not exist (Cordova)

I've been having the same problem for two days now, and I can't seem to get Cordova to do what I want.我已经有同样的问题两天了,我似乎无法让 Cordova 做我想做的事。

Background:背景:

~ I have every Android SDK installed on my machine ~ 我在我的机器上安装了每个 Android SDK

~ My PATH includes SDK tools and platform-tools, under the filepath the exist on my computer ~我的PATH包括SDK工具和平台工具,在我电脑上存在的文件路径下

~ I created an environment variable for ANDROID_HOME and JAVA_HOME , as described on the Cordova page. ~ 我为ANDROID_HOMEJAVA_HOME创建了一个环境变量,如 Cordova 页面所述。

~ I am only trying to run the program in Android, Cordova says that I meet all requirements when I call Cordova requirements ~我只是尝试在Android中运行程序,Cordova在调用Cordova要求时说我满足所有要求

~ I have done Cordova platform rm android --save / add , multiple times ~ 我已经多次执行Cordova platform rm android --save / add

~ I am running Cordova 6.2.1 and Android@5.0.0 (wouldn't install Android@5.2.1 for some reason) ~ 我正在运行 Cordova 6.2.1 和 Android@5.0.0(由于某种原因不会安装 Android@5.2.1)

I am new to Cordova, so maybe I missed some essential, and basic test, but I am getting a confusing error.我是 Cordova 的新手,所以也许我错过了一些必不可少的基本测试,但我遇到了一个令人困惑的错误。

Error: (occurs when I try Cordova build|run|clean --verbose )错误:(当我尝试Cordova build|run|clean --verbose

ANDROID_HOME=myPathToMyAndroid\sdk
JAVA_HOME=myPathToMYJava\jdk1.8.0_91
Exception in thread "main" java.lang.RuntimeException: Wrapper properties file '\Users\myName\!Projects\myApplication\platforms\android\gradle\wrapper\gradle-wrapper.properties' does not exist.
at org.gradle.wrapper.WrapperExecutor.forWrapperPropertiesFile(WrapperExecutor.java:47)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:47)
Error: cmd: Command failed with exit code 1
at /callbackString/

This baffles me mostly because everything in the gradle file is constantly being rebuilt, including everything in the gradle\\wrapper file.这让我感到困惑,主要是因为 gradle 文件中的所有内容都在不断重建,包括 gradle\\wrapper 文件中的所有内容。

I am working on a networked drive at work and have a proxy, but I don't really know if that matters, but I don't really know what information is relevant with this issue, because I can't find a single other case of this happening on the internet.我正在工作的网络驱动器上工作并有一个代理,但我真的不知道这是否重要,但我真的不知道哪些信息与此问题相关,因为我找不到其他案例这件事发生在互联网上。

Any help would be appreciated.任何帮助将不胜感激。

EDIT:编辑:

Worth noting, I HAVE a gradle-wrapper.properties file in my file system, but on the Windows file system it only reads as gradle-wrapper without the extension.值得注意的是,我的文件系统中有一个 gradle-wrapper.properties 文件,但在 Windows 文件系统上,它只读取为没有扩展名的 gradle-wrapper。 I'm running Windows 7 Enterprise.我正在运行 Windows 7 企业版。

Alright, I figured out the issue, and it seems to be a rather personal issue, and most likely will not be an issue for many other people.好吧,我想通了这个问题,这似乎是一个相当个人的问题,很可能对许多其他人来说不是问题。 But, in case it is an issue for someone in the future I will answer it.但是,如果将来有人遇到问题,我会回答。

As I said, at my work we have networked drives, I had my project folder on a networked drive instead of my C: drive.正如我所说,在我的工作中,我们有网络驱动器,我的项目文件夹位于网络驱动器而不是 C: 驱动器上。 Once I moved the project folder to the C drive it worked as it should.一旦我将项目文件夹移动到 C 驱动器,它就可以正常工作。

I think it tries to use the Gradle Wrapper but it's missing the gradle-wrapper.properties file which includes relevant version information.我认为它尝试使用 Gradle Wrapper,但它缺少包含相关版本信息的 gradle-wrapper.properties 文件。 So I suggest to add the wrapper to your project and re-run the task.所以我建议将包装器添加到您的项目中并重新运行任务。 More details about the wrapper: https://docs.gradle.org/current/userguide/gradle_wrapper.html有关包装器的更多详细信息: https : //docs.gradle.org/current/userguide/gradle_wrapper.html

检查这个答案https://stackoverflow.com/a/66121086/9138027 ...如果你没有找到它自己创建它并同步项目。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM