Could not find com.android.tools.build:gradle:2.2.0 -here is the solution

Categories: ANDROID like

In case You had problem with: Error:Could not find com.android.tools.build:gradle:2.2.0. Searched in the following locations: https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.2.0/gradle-2.2.0.pom https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.2.0/gradle-2.2.0.jar Required by: :YOUR_PROJECT:unspecified Don’t forget modify root build.gradle and add jcenter() It would look like this: buildscript { repositories { jcenter() mavenCentral() } dependencies { classpath ‘com.android.tools.build:gradle:2.2.0’ classpath ‘com.google.gms:google-services:3.0.0’ } } allprojects { repositories { mavenCentral() } }

Example gradle with incrementing version (based on commits count)

Categories: ANDROID like

Just an example how use commits count value as a build number of app. buildscript { //… } repositories { //… } def cmd = ‘git rev-list –all –count’ def gitVersion = cmd.execute().text.trim().toInteger() println “=== Building version ” + gitVersion.toString() android { compileSdkVersion 23 buildToolsVersion ‘23.0.3’ defaultConfig { //… versionCode gitVersion versionName “1.0.” + gitVersion […]