問題描述
我開發了一個應用生成系統,它通過命令行 Gradle 編譯命令重新生成應用.
I develop an app generation system that is regenerating apps by command line Gradle compilation commands.
在我的 Windows Server 2008 中,我在更新到最新的 Gradle 版本和 Gradle 插件版本后遇到了問題.
In my Windows Server 2008, I'm facing a problem after updating to the last Gradle version and Gradle plugin version.
編譯時出現以下錯誤:
C:WindowsSystem32configsystemprofile.gradlecaches ransforms-1files-1.1appcompat-v7-25.0.0.aare93435c34d5cae8b6677dcef529711a5
esdrawable-xxhdpi-v4abc_text_select_handle_middle_mtrl_light.png: error: file not found.
C:WindowsSystem32configsystemprofile.gradlecaches ransforms-1files-1.1appcompat-v7-25.0.0.aare93435c34d5cae8b6677dcef529711a5
esdrawableabc_btn_colored_material.xml: error: file not found.
C:WindowsSystem32configsystemprofile.gradlecaches ransforms-1files-1.1appcompat-v7-25.0.0.aare93435c34d5cae8b6677dcef529711a5
esdrawable-hdpi-v4abc_textfield_search_default_mtrl_alpha.9.png: error: file not found.
and a lot more of errors like those...
我不確定為什么會收到此錯誤,因為文件已正確下載并且正確位于該方向.
I'm not sure why I'm getting this error, because the file is correctly downloaded and it's correctly located on that exactly direction.
它的路徑長度為 204 個字符,因此應該不會超過 NTFS Windows 文件系統上 255 個路徑字符的限制.
It has a path length of 204 characters, so supposedly it's not surpassing the limit of 255 path characters on NTFS Windows file system.
是否可以更改 Gradle 下載其緩存依賴項的位置?這個問題是由這個還是由其他原因引起的?
It is possible to change the location where Gradle downloads it's cached dependencies? Is this problem caused by this or by other thing?
推薦答案
終于解決了這個問題,將windows中的環境變量GRADLE_USER_HOME設置為c:/gradle-cache
finally i solved this setting the environmental variable GRADLE_USER_HOME in windows to c:/gradle-cache
所以肯定與文件路徑長度有關
so definitively it's related to file path lenght
這篇關于使用 Gradle 編譯時出錯(找不到下載的依賴項)的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!