Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gradle.xml not consistent between platforms

I develop using Android Studio on both Macs and PCs, and am seeing undesired behavior when moving projects between the two platforms.

One of those issues is regarding the "gradleHome" value in '.idea/gradle.xml', which is a correct-looking value on the Mac:

<option name="gradleHome" value="$APPLICATION_HOME_DIR$/gradle/gradle-2.10" />

When I check out the project and load it into Android Studio on Windows, the '.idea/gradle.xml' value for "gradleHome" becomes a hard-coded path:

<option name="gradleHome" value="C:\Program Files\Android Studio\gradle\gradle-2.10" />

Obviously problems will ensue if the file is checked in with a hard-coded path, but there seems nothing I can do but ignore this change during checkin.

Does anyone know why this is happening or how to prevent it? Should I not be checking this file into SVN?

Thanks!

like image 580
Bungles Avatar asked Aug 01 '16 20:08

Bungles


People also ask

What is a platform in Gradle?

A platform is a special kind of software component which doesn’t contain any sources: it is only used to reference other libraries, so that they play well together during dependency resolution. Platforms can be published as Gradle Module Metadata and Maven BOMs.

What is Gradle Gradle sync?

Gradle Sync is a Gradle task who’s main function is to check all the dependencies in your build.gradle files which are associated with your Android studio project and then download that specified version (if not downloaded already). Gradle Project Sync Failed There are many variations in which this error message might occur.

Why does my Gradle project fail to run?

Bad internet connection: Since Gradle downloads all the missing versions which are required to run your project, it might fail if you don’t have a valid internet connection. Issues in Gradle compiler: There might be cases where your Gradle compiler is not working properly.

How to install Gradle on Android Studio?

After downloading, extract all the files to an accessible folder. Now launch Android Studio and go to File > Settings > Build, Execution, Deployment > Gradle. Now select the option of Local Gradle Distribution. Also, when in the Gradle home, point to the path where you just extracted the files.


1 Answers

This file should not be checked into version-control. What can go into version-control and defines the gradle-version is this file: gradle/wrapper/gradle-wrapper.properties - I would ignore the whole .idea directory. On a side node - think about using git over svn - if you really need svn as a storage there is git-svn ..

like image 193
ligi Avatar answered Oct 03 '22 13:10

ligi