Error in building project in Android Studio

后端 未结 10 2228
生来不讨喜
生来不讨喜 2020-12-11 14:56

Freshly Installed Android Studio and started new android project. When tried to run it. Got this error from Gradle

Error:Could not open init         


        
10条回答
  •  遥遥无期
    2020-12-11 15:33

    In my case, it was the roaming profile issue. Gradle Sync failed every time I switched networks from work to home. Although I was able to access the network drives by connecting with VPN, still it used to give this error. I had to move the Gradle Service Directory Path to a different location that wasn't dependent on the network.

    You can do this in AS 1.4 by going to File > Settings > Build, Execution, Deployment > Build Tools > Gradle > Service Directory Path. Screen shot below:

    You can also add GRADLE_USER_HOME environment variable with the same value of the location for making it a default for every project (http://blog.james-carr.org/2011/05/04/setting-gradle-cache-to-a-common-location/). You may refer to the following page for more info on moving Android related stuff to different locations: http://www.littlecpu.com/android-studio-c-drive

提交回复
热议问题