Fabric and new gradle 2 released - android

Yesterday I updated Android Studio 1.5 to Android Studio 2 and since that update my project can't be run.
I have this error:
Error:Cannot change dependencies of configuration ':android:classpath'
after it has been resolved.
As I see it, I think that the error comes from my Build.gradle (project)
buildscript {
repositories {
jcenter()
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
classpath 'io.fabric.tools:gradle:1.+'
}
I changed it to:
buildscript {
repositories {
jcenter()
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'com.android.tools.build:gradle:2.+'
classpath 'io.fabric.tools:gradle:2.+'
}
It still doesn't work. Do you have any suggestions?

I've also updated to 2.0 and uses fabric too.
here's the buildscript and it works well.
buildscript {
repositories {
jcenter()
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'com.android.tools.build:gradle:2.0.0'
classpath 'io.fabric.tools:gradle:1.+'
}
}
you can have a try :)

Related

Gradle sync BUILD SUCCESSFUL but Make project failed

When i do a Gradle sync it says build successful but when i try to Make project it fails giving the following error:
Could not GET 'http://dl.bintray.com/jlmd/maven/org/jetbrains/kotlin/kotlin-annotation-processing-gradle/1.4.21/kotlin-annotation-processing-gradle-1.4.21.pom'. Received status code 502 from server: Bad Gateway
My Gradle:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.4.21'
repositories {
jcenter()
google()
jcenter()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath 'com.android.tools.build:gradle:4.2.2'
classpath 'com.google.gms:google-services:4.3.10'
// classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.21"
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.0'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
plugins {
// id "org.jetbrains.kotlin.jvm" version '1.4.21'
}
allprojects {
repositories {
maven { url "https://maven.google.com" }
maven { url "https://jitpack.io" }
maven { url "http://dl.bintray.com/jlmd/maven" }
maven {
url "https://oss.sonatype.org/content/repositories/snapshots"
}
maven {
url "https://cardinalcommerceprod.jfrog.io/artifactory/android"
credentials {
username 'braintree_team_sdk'
password 'AKCp8jQcoDy2hxSWhDAUQKXLDPDx6NYRkqrgFLRc3qDrayg6rrCbJpsKKyMwaykVL8FWusJpp'
}
}
maven {
url 'https://zendesk.jfrog.io/zendesk/oss-releases-local'
}
jcenter()
google()
mavenCentral()
jcenter()
}
}
repositories {
maven { url 'https://dl.bintray.com/kotlin/kotlin-eap' }
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
}
apply plugin: "org.jetbrains.kotlin.jvm"
I am not an android dev I know very little about android dev so please explain in a little more detail for me :) i know something about bintray not being available anymore but not sure how to edit the gradle to remove this
It sounds like you are:
asking for the wrong library module (check your module build.gradle)
You don't specify the right repository in your top level build.gradle
You are off line.

Could not find com.android.tools.build:gradle:4.1.2

In Android Studio, I get this error when I create a project:
Could not find com.android.tools.build:gradle:4.1.2.
Correct your app top-level build.gradle file and include Maven repo to download plugin from:
buildscript {
repositories {
google()
jcenter()
maven { url "https://maven.google.com" }
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.2'
}
}
allprojects {
repositories {
google()
jcenter()
maven { url "https://maven.google.com" }
mavenCentral()
}
}
Other option, it's possible to use beta version of Android Studio and upgrade to new version of AGP:
classpath 'com.android.tools.build:gradle:7.0.0-alpha07'

Error: could not find com.google.gms:google-services:4.2.0

today I was trying to update com.google.gms:google-services to 4.2.0 from 4.1.0 as it's the latest version and recommended by firebase. But I get this error:
Could not find com.google.gms:google-services:4.2.0.
Searched in the following locations:
https://jcenter.bintray.com/com/google/gms/google-services/4.2.0/google-services-4.2.0.pom
https://jcenter.bintray.com/com/google/gms/google-services/4.2.0/google-services-4.2.0.jar
https://dl.google.com/dl/android/maven2/com/google/gms/google-services/4.2.0/google-services-4.2.0.pom
https://dl.google.com/dl/android/maven2/com/google/gms/google-services/4.2.0/google-services-4.2.0.jar
https://maven.fabric.io/public/com/google/gms/google-services/4.2.0/google-services-4.2.0.pom
https://maven.fabric.io/public/com/google/gms/google-services/4.2.0/google-services-4.2.0.jar
Required by:
project :
And here is my project's build gradle:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
google()
maven {
url 'https://maven.fabric.io/public'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.google.gms:google-services:4.2.0'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
// These docs use an open ended version so that our plugin
// can be updated quickly in response to Android tooling updates
// We recommend changing it to the latest version from our changelog:
// https://docs.fabric.io/android/changelog.html#fabric-gradle-plugin
classpath 'io.fabric.tools:gradle:1.27.0'
}
}
allprojects {
repositories {
jcenter()
maven {
url 'https://maven.google.com/'
}
google()
}
}
UPDATE:
As Doug Stevenson said the dependency is now up and running so just use google() in your repositories.
If you have any problems with other google repositories (firebase, exoplayer) you can track the issue progress here.
Because google-services:4.2.0 is not available at Central Repository, so it needs to be downloaded from Android Tools Repository. To add this to your project add
maven { url 'https://dl.bintray.com/android/android-tools' }
this to buildscript repositories. For more refer to https://mvnrepository.com/artifact/com.google.gms/google-services/4.2.0
buildscript {
repositories {
jcenter()
google()
maven {
url 'https://maven.fabric.io/public'
}
// Add this to your project
maven { url 'https://dl.bintray.com/android/android-tools' }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.google.gms:google-services:4.2.0'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
// These docs use an open ended version so that our plugin
// can be updated quickly in response to Android tooling updates
// We recommend changing it to the latest version from our changelog:
// https://docs.fabric.io/android/changelog.html#fabric-gradle-plugin
classpath 'io.fabric.tools:gradle:1.27.0'
}
}
allprojects {
repositories {
jcenter()
maven {
url 'https://maven.google.com/'
}
google()
}
}
Monday December 10 2018, 1:30PM PST
The Google Play services plugin, the Firebase Performance monitoring plug, exoplayer, and possible other dependencies were found to be missing on jCenter. It's not clear why, but some of the teams are known to be moving their build artifacts to the Google maven repo.
As of right now, the Google Play services plugin has been migrated, and should be available through google() in your buildscript for now.
Try this, work for me:
buildscript {
repositories {
google()
//jcenter()
jcenter {url 'https://dl.bintray.com/android/android-tools'}
jcenter {url 'https://firebase.bintray.com/gradle'}
mavenCentral ()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.google.gms:google-services:4.2.0'
classpath 'com.google.firebase:firebase-plugins:1.1.5'
}
}
allprojects {
repositories {
google()
//jcenter()
jcenter {url 'https://dl.bintray.com/android/android-tools'}
jcenter {url 'https://firebase.bintray.com/gradle'}
mavenCentral ()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
google-services:4.2.0 is now back on google maven repository, just sync gradle with default config:
allprojects {
repositories {
google()
jcenter()
}
}

Android CI build: Could not find aapt2-proto.jar

I have failing build on a Bitbucket CI server:
> Could not resolve all artifacts for configuration ':classpath'.
> Could not find aapt2-proto.jar (com.android.tools.build:aapt2-proto:0.3.1).
Searched in the following locations:
https://jcenter.bintray.com/com/android/tools/build/aapt2-proto/0.3.1/aapt2-proto-0.3.1.jar
I searched similar questions that suggested the Google Maven repository is missing, but I am not missing it. Top level build file:
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
classpath 'com.jakewharton:butterknife-gradle-plugin:8.8.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin"
}
}
allprojects {
repositories {
google()
jcenter()
maven { url "https://jitpack.io" }
}
}
And my app level build file:
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
google()
}
dependencies {
classpath 'io.fabric.tools:gradle:1.26.1'
}
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'io.fabric'
repositories {
maven { url 'https://maven.fabric.io/public' }
google()
mavenCentral()
}
Try moving the google() method to the top of its execution block.
Maybe it's the order of repositories it searches in that causes the issue.
So for example, change this:
repositories {
maven { url 'https://maven.fabric.io/public' }
google() // from here
mavenCentral()
}
To this:
repositories {
google() // to here
maven { url 'https://maven.fabric.io/public' }
mavenCentral()
}
If that doesn't help, instead of calling the google() method, try changing it to this:
maven {
url 'https://maven.google.com/'
name 'Google'
}
UPDATE
If all of the above didn't help - make sure your gradle version is at least 3.0.0:
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
}
And the gradle-wrapper version is at least 4.1:
Usually located here: project_name/gradle/wrapper/gradle-wrapper.properties
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip
Source
Upgrading the Gradle wrapper (in gradle-wrapper.properties) to gradle-4.10.2-all.zip fixed the problem to me.
Update Gradle Version
From the android gradle release page you can check compatible version for your gradle plugin.
Update gradle version in gradle-wrapper.properties located inside yourProject/gradle/wrapper
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4.0-all.zip
Plugin version Required Gradle version
2.3.0+ 3.3+
3.0.0+ 4.1+
3.1.0+ 4.4+
Note that order matters. google() should be top of any plugin repo.
For Android Studio version > 3.0
buildscript {
repositories {
google() // move it to top
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1' // your Android Studio Version
}
}
allprojects {
repositories {
google() // move it to top
jcenter()
}
google() plugin is needed since Android Studio version 3.0 or higher.
For Android Studio version < 3.0
buildscript {
repositories {
maven {
url 'https://maven.google.com/'
name 'Google'
}
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.0' // your Android Studio Version
}
}
allprojects {
repositories {
maven {
url 'https://maven.google.com/'
name 'Google'
}
jcenter()
}

Error:No such property: zipAlignEnabled for class: com.android.build.gradle.internal.variant.ApplicationVariantData

I am getting this error continuously when I try to build my old project in Android Studio 3.0
Here's my gradle file:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
classpath 'com.google.gms:google-services:3.0.0'
classpath 'com.github.triplet.gradle:play-publisher:1.1.4'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
classpath 'com.google.guava:guava:19.0'
classpath 'me.tatarka:gradle-retrolambda:3.3.1'
}
}
allprojects {
repositories {
jcenter()
maven { url "https://jitpack.io" }
flatDir {
dirs 'libs'
}
}
}
For me the problem was with classpath 'com.github.triplet.gradle:play-publisher:1.1.4'. I upgraded it to com.github.triplet.gradle:play-publisher:1.2.0 and the error went away.
Because AS 3.0 uses gradle 4.1,but gradle 4.1 removed the property-- ApplicationVariantData.
So, you can downgrade your AS or set
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
}
on your root .gradle file
Maybe you can see this http://dev.qq.com/topic/5a0cfef91d8190380176e74d
or this http://dev.qq.com/topic/59b272d9e0a78ea25114ed2a

Categories

Resources