Just updated to Android Studio 3.3 RC 2 & gradle tools to 5.1, it started to give the following error,
No such property: dir for class: org.gradle.api.internal.file.collections.DefaultConfigurableFileCollection
* What went wrong:
A problem occurred configuring project ':app'.
> groovy.lang.MissingPropertyException: No such property: dir for class: org.gradle.api.internal.file.collections.DefaultConfigurableFileCollection
Any idea what's the solution to this?
I'm using
com.android.tools.build:gradle:3.4.0-alpha08
The issue with me was related to Jacoco android plugin version 0.1.3
I solved the issue by updating to 0.1.4 and now the issue is solved.
In my case this happened when I upgraded Android Studio to gradle 4.1.0-beta01
The problem was with fabric plugin . I had to replace fabric plugin with firebase-crashlytics-gradle plugin
Project build.gradle
dependencies {
classpath 'com.android.tools.build:gradle:4.1.0-beta01'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:2.2.2"
classpath 'com.google.gms:google-services:4.3.3'
// classpath 'io.fabric.tools:gradle:1.31.2' replaced with below
classpath "com.google.firebase:firebase-crashlytics-gradle:2.2.0"
}
Applevel build.gradle
apply plugin: 'com.google.firebase.crashlytics' //use this instead of fabric
dependencies {
// implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1' replace with below
implementation 'com.google.firebase:firebase-crashlytics:17.1.0'
}
The issue for me was the jacoco android plugin integration. Fixed it by removing code related to its integration in the project build.gradle file. Hopes this helps!.
Fixed by downgrading gradle to 4.10.3 and com.android.tools.build:gradle:3.3.0-rc02
Related
* What went wrong:
Could not determine the dependencies of task ':app:mergeDebugResources'.
> Could not create task ':app:injectCrashlyticsMappingFileIdDebug'.
> No signature of method: org.gradle.api.internal.provider.DefaultValueSourceProviderFactory$ValueSourceProvider.forUseAtConfigurationTime() is applicable for argument types: () values: []
project's build.gradle
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath "com.android.tools.build:gradle:4.0.0"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.5'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.5.0'
}
}
app's build.gradle
apply plugin: 'com.google.firebase.crashlytics'
//...
dependencies {
implementation 'com.google.firebase:firebase-crashlytics:17.3.1'
}
Downgrading to com.google.firebase:firebase-crashlytics-gradle:2.2.0 helped me, apparently something wrong with the latest version
This is a bug in the Crashlytics plugin that causes an error when used with Gradle 6.1 - Gradle 6.4.1. We'll try to get it fixed in an upcoming release. In the meantime, upgrading to Gradle 6.5+ should fix the error.
Downgrading to com.google.firebase:firebase-crashlytics-gradle:2.4.1 helped me.
Something is wrong with the latest version.
Which Gradle version are you using? I can only say I tried in a single project and it worked perfectly.
I use the next versions in the app/build.gradle:
implementation "com.google.firebase:firebase-crashlytics:17.0.1"
implementation "com.google.firebase:firebase-crashlytics-ndk:17.0.1"
And go to change:
File > Project structure > grade version: 6.7.1
and work fine the compilation project
I'm using android studio 3.1 and I just configured gradle-wrapper.properties to use gradle-4.5 and it downlowded the file succesfully.
:
distributionUrl=https\://services.gradle.org/distributions/gradle-4.5-all.zip
how should I configure classpath in dependencies of build.gradle file?
it was like this when I was using an older version of Gradle:
dependencies {
classpath 'com.android.tools.build:gradle:3.1.0-alpha09'
}
I changed it to :
dependencies {
classpath 'com.android.tools.build:gradle:4.5'
}
but it didnt work
Don't confuse gradle with android plugin for gradle.
It is the android plugin for gradle and 4.5 doesn't exist.
dependencies {
classpath 'com.android.tools.build:gradle:4.5'
}
It is gradle, and it is enough to use gradle 4.5
distributionUrl=https\://services.gradle.org/distributions/gradle-4.5-all.zip
I have a project where I mix and match regular Android Gradle Plugin:
apply plugin: 'com.android.library'
and Experimental Gradle Plugin as a library:
apply plugin: 'com.android.model.library'
In my overall build.gradle I have the following dependencies:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.google.gms:google-services:3.0.0'
classpath 'com.android.tools.build:gradle-experimental:0.7.2'
classpath 'com.android.tools.build:gradle:2.1.3'
}
}
And now after upgrade to Android 2.1.3, I get the following error right after the Gradle Sync:
Gradle sync failed: Gradle version 2.10 is required. Current version is >2.14.1. If using the gradle wrapper, try editing the distributionUrl in ?>blah blah blah
At this time In the .idea Android Studio IDE log I see the following error:
Caused by: org.gradle.api.internal.plugins.PluginApplicationException: >Failed to apply plugin [class >'com.android.build.gradle.model.AndroidComponentModelPlugin']
When I fix the gradle-wrapper.properties file I get the following after Gradle Sync:
Error:Minimum supported Gradle version is 2.14.1. Current version is >2.10. If using the gradle wrapper, try editing the distributionUrl in >/Users/development/Desktop/android_msdk/xFAClient/Android/xFA/gradle/wrapp>er/gradle-wrapper.properties to gradle-2.14.1-all.zip
And over and over again...
I have no clue here...
Upgrade gradle experimental to 0.7.3:
classpath 'com.android.tools.build:gradle-experimental:0.7.3'
It allows gradle wrapper 2.14.1 compatibility.
I am using gradle experimental on my android proyect.
I was getting this error on the gradle build:
Error: Unable to find method com.android.build.gradle.internal.ApplicationTaskManager
My gradle project is:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
classpath 'com.android.tools.build:gradle-experimental:0.3.0-alpha7'
}
When I delete the first classpath: classpath 'com.android.tools.build:gradle:1.5.0' the error disappears the gradle built it without any problems.
I need the two classpath for my project.
Cannot I use two classpath?
Does exist another alternative?
Thanks for your help.
http://tools.android.com/tech-docs/new-build-system/gradle-experimental
Plugin name is com.android.model.application instead of com.android.application. Or use apply plugin: "com.android.model.library" if you want to create an Android aar library.
Maybe this will help.
Did you try syncing your project by enabling the online sync mode after you added the new dependencies?
I'm getting this message:
Plugin is too old, please update to a more recent version,
or set ANDROID_DAILY_OVERRIDE environment variable to
"a9d6c794295e89d95704157e2ed8fd55ffd2765c"
and:
C:\path\mobile\build.gradle
Error:(1) A problem occurred evaluating project ':mobile'.
Failed to apply plugin [id 'com.android.application']
Could not create plugin of type 'AppPlugin'.
top build.gradel file:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.0-beta1'
classpath 'com.google.gms:google-services:1.3.0-beta1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
Basically, I don't know how to update that com.android.application plugin.
I just needed to change the line
classpath 'com.android.tools.build:gradle:2.0.0-alpha1'
to
classpath 'com.android.tools.build:gradle:2.0.0-alpha3' in top build.gradle
I knew it was alpha3 because of the last release note http://tools.android.com/tech-docs/new-build-system.
Apparently, beta releases of the Gradle for Android plugin expire. AFAIK, that is not documented behavior. Right now, the only way that I know of to find out what the latest beta release is would be by monitoring http://tools.android.com/tech-docs/new-build-system. It actually shows a beta3; I had thought that the latest was beta2.
I was also facing the same problem.
I changed the gradle version from
classpath 'com.android.tools.build:gradle:2.0.0-alpha1'
to
classpath 'com.android.tools.build:gradle:2.1.0-rc1'
Since Android Studio is updated so from April 22 2016 it is the latest gradle version.
As of May 11 the stable gradle version is
classpath 'com.android.tools.build:gradle:2.1.1'
Find latest version of the build system from [Android studio project site][1]
[1]: http://tools.android.com/tech-docs/new-build-system and update classpath accordingly. As of 2016/6/23, it is 2.2.0-alpha4. So, make it classpath 'com.android.tools.build:gradle:2.2.0-alpha4on build.gradle file.