問(wèn)題描述
我開發(fā)了一個(gè)應(yīng)用生成系統(tǒng),它通過(guò)命令行 Gradle 編譯命令重新生成應(yīng)用.
I develop an app generation system that is regenerating apps by command line Gradle compilation commands.
在我的 Windows Server 2008 中,我在更新到最新的 Gradle 版本和 Gradle 插件版本后遇到了問(wèn)題.
In my Windows Server 2008, I'm facing a problem after updating to the last Gradle version and Gradle plugin version.
編譯時(shí)出現(xiàn)以下錯(cuò)誤:
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...
我不確定為什么會(huì)收到此錯(cuò)誤,因?yàn)槲募颜_下載并且正確位于該方向.
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.
它的路徑長(zhǎng)度為 204 個(gè)字符,因此應(yīng)該不會(huì)超過(guò) NTFS Windows 文件系統(tǒng)上 255 個(gè)路徑字符的限制.
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 下載其緩存依賴項(xiàng)的位置?這個(gè)問(wèn)題是由這個(gè)還是由其他原因引起的?
It is possible to change the location where Gradle downloads it's cached dependencies? Is this problem caused by this or by other thing?
推薦答案
終于解決了這個(gè)問(wèn)題,將windows中的環(huán)境變量GRADLE_USER_HOME設(shè)置為c:/gradle-cache
finally i solved this setting the environmental variable GRADLE_USER_HOME in windows to c:/gradle-cache
所以肯定與文件路徑長(zhǎng)度有關(guān)
so definitively it's related to file path lenght
這篇關(guān)于使用 Gradle 編譯時(shí)出錯(cuò)(找不到下載的依賴項(xiàng))的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!