Could not create task ':app:injectCrashlyticsMappingFileIdDebug' - android

* 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

Related

Gradle Sync Failed - MissingPropertyException after upgrade to gradle 5.1

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

I have a problem with fabric and crashlytics when building my Android App

This is the error I am seeing.
Could not find method create() for arguments [crashlyticsStoreDeobsRelease, class com.crashlytics.tools.gradle.tasks.StoreMappingFileTask, com.android.build.gradle.internal.scope.BuildArtifactsHolder$FinalBuildableArtifact#1711854a] on task set of type org.gradle.api.internal.tasks.DefaultTaskContainer.
For me this happened after upgrading to Android Studio 3.2 which come along with Gradle 4.6. So i switched back from
classpath 'io.fabric.tools:gradle:1.26.0'
to
classpath 'io.fabric.tools:gradle:1.25.4'
for the moment.
The cause of the issue seems incompatibility Fabric version with latest version of Gradle.The below works for me. Don't upgrade your Gradle version, Stick with your previous version and Sync the project once.
My Android Studio Version is 3.2
project.gradle
dependencies {
classpath 'com.android.tools.build:gradle:3.1.4'
}
build.gradle
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.26.0'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
repositories {
maven { url 'https://maven.fabric.io/public' }
}
Try replacing the line io.fabric.tools:gradle:1.+ by the latest stable Fabric version which is 1.25.4. at the moment: io.fabric.tools:gradle:1.25.4
I had problem when I updated my Android studio from 3.1.4 to 3.2.
The way I got the solution. I changed in the Build.gradle (app).
from
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
to
dependencies {
classpath 'io.fabric.tools:gradle:1.25.4'
}
As others have mentioned, there's some type of conflict between io.fabric.tools:gradle:1.26.0, and Gradle 4.6. So I found the best solution, rather than roll back io.fabric.tools:gradle, seems to be to upgrade Gradle to the latest version, 4.10.2. Seemed to work for my project without issue.
For me this happened after upgrading to Android Studio 3.2 which come along with Gradle 4.6. So i switched back to gradle 4.4 for the moment. Maybe a bug.

Two classpath on gradle Android

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?

Found com.google.android.gms:play-services:8.4.0, but version 8.3.0 is needed for the google-services plugin

Can't use google maps because of above said error. Anyone find the same issue ?
Make sure that the following line is at the end of the app build.gradle file:
apply plugin: 'com.google.gms.google-services'
Mine was on the top and gradle was defaulting to 8.3.0 instead of what was specified: 8.4.0
My build.gradle files are the same as the ones in the Version conflict updating to 8.4.0
As those previous anweres are only part-wise complete.
Here are my three steps which worked fine for me:
Put this to the end of your apps build.gradle
apply plugin: 'com.google.gms.google-services'
Set your projects build.gradle dependencies to
'classpath 'com.google.gms:google-services:2.0.0-alpha5'
Set Gradle Version to 2.10
Android Studio: File > Project Structure > Project
#redsonic's answer worked for me.. By simply moving apply plugin:
'com.google.gms.google-services' after the dependecies in
build.gradle (Module: app)
I'm using Android Studio 1.5.1 with Gradle version 2.10
In case you are using Gradle version older than 2.10 you'll also need to update that by selecting the ProjectName or app directory in the Project tool Windows and pressing F4. This will open Project Structure window, select Project from the menu and update Gradle version to 2.10. Press OK (Android Studio will download it in background).
build.gradle (Project: ProjectName)
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
classpath 'com.google.gms:google-services:2.0.0-alpha6'
}
build.gradle (Module: app)
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.google.android.gms:play-services:8.4.0'
}
apply plugin: 'com.google.gms.google-services'
This is a slight variant of #Lord Flash's answer:
For me it wasn't necessarily that I should place the google services plugin at the bottom of the file it was that it should come before the com.android.application plugin.
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.android.application'
Also there are newer binaries than the alpha variants for google-services
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.google.gms:google-services:2.0.0-beta6'
}
}
I'm sure there will be newer ones soon. I found the list of variants here
follow all the steps at this link Add App Invites to Your App
use this : compile 'com.google.android.gms:play-services-appinvite:8.4.0'
instead of this : compile 'com.google.android.gms:play-services:8.4.0'
please follow all the steps and then build the project
hope thats help
I had the same problem, and I found that moving:
apply plugin: 'com.google.gms.google-services'
To the bottom of the module app gradle.
and then use:
classpath 'com.android.tools.build:gradle:2.1.0'
classpath 'com.google.gms:google-services:2.1.0'
The problem is that some of your app dependencies that start with com.google.android.gms: have a version that is incompatible your project dependencie classpath 'com.google.gms:google-services:
Check for these on your app build.gradle
compile 'com.google.android.gms:play-services-plus:8.4.0'
compile 'com.google.android.gms:play-services-analytics:8.4.0'
compile 'com.google.android.gms:play-services-gcm:8.4.0'
compile 'com.google.android.gms:play-services-maps:8.4.0'
And for this in your project build.gradle
classpath 'com.google.gms:google-services:1.5.0'
You can update your project build.gradle to use the latest google-services version or your can just change your app dependencies to use the 8.3 version.
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.0'
classpath 'com.google.gms:google-services:3.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
// this should solve the gradle update error if it persists even after following above steps
Make sure that the following line is at the end of the app build.gradle file:
compile 'com.google.android.gms:play-services:11.0.2'
google update there API day by day.Now mine is '11.0.2'
try with the updated API

how to update com.android.application plugin?

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.

Categories

Resources