ERROR: No signature of method: com.crashlytics.tools.gradle.CrashlyticsPlugin.findObfuscationTransformTask() - android

I am getting the following error while trying to build my project on Android Studio:
ERROR: No signature of method:
com.crashlytics.tools.gradle.CrashlyticsPlugin.findObfuscationTransformTask()
is applicable for argument types: (java.lang.String) values:
[DevDebug]
How to solve this?

EDIT: Before proceeding to the solution below, please at first update to the latest stable version of fabric gradle tools and check if the problem is fixed. At the time of this edit, some claim that updating to version 1.31.2 has fixed the issue.
This seems to be an issue related to version "1.28.0" of "io.fabric.tools:gradle".
Usually this kind of problem occurs if groupId:artifactId:n.+ structure of versioning is used inside dependency (app level/project level). In this case:
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
Because it auto updates the version, and as a result, if there is any fatal error in the latest version, the project is likely to face a crash due to build/runtime error.
Android Studio always suggests: 'Avoid using + in version numbers; can lead to unpredictable and unrepeatable builds...'
One working solution was found to be downgrading to a specific previous version like 1.27.1 or any other stable latest version prior to 1.28.0, like:
dependencies {
classpath 'io.fabric.tools:gradle:1.27.1'
}
Remember to check both gradle files (app level/project level) to see where the above dependency has been declared and change accordingly.

hey this error raised because of Many android developers uses
classpath 'io.fabric.tools:gradle:1.+'
like this so that compiler not find exactly match of the fabric version and error raise and also M. Arabi Hasan Sakib is right
classpath 'io.fabric.tools:gradle:1.28.0'
also raise this type of error, solution mentioned by M. Arabi Hasan Sakib is also working. I tried below code and its working for me hope it works for you people also or just replace the line like
classpath 'io.fabric.tools:gradle:1.27.1':
(Put this code into the build.gradle in app directory)
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.27.1'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
repositories {
maven { url 'https://maven.fabric.io/public' }
maven { url "https://jitpack.io" }
maven {
url "http://dl.bintray.com/lukaville/maven"
}
}

Related

Error: Could not find org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.60-eap-25 in Ionic 3

I am getting the following error suddenly while building Ionic 3 app for Android.
Could not find org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.60-eap-25
We have one solution from Android Studio here but after I did change in my build.gradle with the following code I am still getting the error.
buildscript {
repositories {
...
maven { url 'https://dl.bintray.com/kotlin/kotlin-eap' }
}
}
allprojects {
repositories {
...
maven { url 'https://dl.bintray.com/kotlin/kotlin-eap' }
}
}
My build.gradle file looks like this after I updated my Cordova and added the above solution.
buildscript {
repositories {
google()
jcenter()
maven { url 'https://dl.bintray.com/kotlin/kotlin-eap' }
}
dependencies {
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.android.tools.build:gradle:3.3.0'
}
}
allprojects {
repositories {
google()
jcenter()
maven { url 'https://dl.bintray.com/kotlin/kotlin-eap' }
}
//This replaces project.properties w.r.t. build settings
project.ext {
defaultBuildToolsVersion="28.0.3" //String
defaultMinSdkVersion=19 //Integer - Minimum requirement is Android 4.4
defaultTargetSdkVersion=28 //Integer - We ALWAYS target the latest by default
defaultCompileSdkVersion=28 //Integer - We ALWAYS compile with the latest by default
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Still the same error.
The problem lies in the cordova-support-google-services plugin for Cordova.
This plugin's build.gradle looks like this as of today (October 24th, 2019):
dependencies {
classpath 'com.android.tools.build:gradle:+'
classpath 'com.google.gms:google-services:4.2.0'
}
More exactly the problem lies in this dependency:
classpath 'com.android.tools.build:gradle:+'
That is an extremely brittle way of specifying dependencies. The '+' sign here means "fetch the most recent version available in the repo".
If a newer version is published in the repo, and it breaks the build, then everyone with this plugin has their projects broken.
This happened today. The broken version that is being fetched is com.android.tools.build:gradle:4.0.0. It requires some Kotlin stuff.
That is why you need to ALWAYS freeze dependencies to reliably build your project. Never trust the newer stuff. This dependency compiles fine just as it did yesterday:
classpath 'com.android.tools.build:gradle:3.5.1'
For those using Cordova or Ionic, you can make a quick fix to be able to build the project by freezing the dependency in the file:
<projectroot>/platforms/android/cordova-support-google-services/<project>-build.gradle
This is not a definitive solution though. If you reinstall the android platform via Cordova the error will show up again. The project maintainer should either freeze the dependency or fix it to support gradle 4.0.0.
In the meantime just use a fixed fork of this plugin.
EDIT 10/28/19:
cordova-support-google-services was updated today to version 1.3.2 which changes the classpath from
classpath 'com.android.tools.build:gradle:+'
to
classpath 'com.android.tools.build:gradle:3.+'
which seems to fix the kotlin error
Original Answer
I got mine to build successfully by doing the following:
I edited
platforms->android->cordova-support-google-services->myAppName-build.gradle
and changed
maventCentral()
to
maven { url "https://maven.google.com" }
maven { url 'https://dl.bintray.com/kotlin/kotlin-eap' }
That solved the kotlin error then I was getting a different error that I resolved by changing
classpath 'com.google.gms:google-services:4.2.0'
to
classpath 'com.google.gms:google-services:4.1.0'
It then built successfully.
Here is the solution.
The problem was exactly the maven repository (here), but the issue was with the build.gradle from the cordova-support-google-services plugin, so I added the required line and everything is ok now, I've already created a pull request to the original repo (here). But in the meantime you can do what I did, just replace in the package.json the current versiĆ³n with my repo:
Before:
...
"cordova-support-google-services": "^1.3.1",
...
After:
...
"cordova-support-google-services": "https://github.com/LuisEGR/cordova-support-google-services.git",
...
after that you will have to:
Remove folders platforms and plugins
run npm install
This is a temporal solution while the pull request to the main repo gets accepted and the npm package updated
and that's it, now you can build your project again.
I'm using Ionic 4, and some plugins require cordova-support-google-services, in case you don't have it in your package.json the error could be with another plugin, if so please add the package.json so we can find out which one is the problem.
UPDATE 24/OCT:
I've changed the solution in my repo as many of you suggested, now the solution consinst just in fixing the dependency: from: com.android.tools.build:gradle:+ to classpath com.android.tools.build:gradle:3.+, this is already in my repo if you want to see what's changed
in my project i fix like this.(my project in kotlin)
buildscript{
repositories {
google()
jcenter()
......
maven { url 'https://dl.bintray.com/kotlin/kotlin-eap' }
}
}
allprojects {
repositories {
google()
jcenter()
......
maven { url 'https://dl.bintray.com/kotlin/kotlin-eap' }
}
}
Solution for ionic v3 and cordova
#Mister Smith solution solved my problem
you have to go to the file
platforms/android/cordova-support-google-services
then
Replace
classpath 'com.android.tools.build:gradle:+'
by
classpath 'com.android.tools.build:gradle:3.5.1'
#Alternative solution I have found is to
setup kotlin in your system :)
As a further temporary fix to follow-up on the suggestion from #MisterSmith, use a hook to re-apply the lock:
<hook src="scripts/fix_android_dep.sh" type="after_platform_add"/>
with this overly wordy bash code:
#!/usr/bin/env bash
## temporary fix for android studio EAP issue
## SOURCE: https://stackoverflow.com/a/58536638/56545
if [ -d "platforms/android/cordova-support-google-services" ]; then
file="platforms/android/cordova-support-google-services/app-build.gradle"
from="classpath 'com.android.tools.build:gradle:+'"
to="classpath 'com.android.tools.build:gradle:3.5.1'"
change=`sed "s/$from/$to/" < "$file"`
echo "$change" > "$file"
fi
I had to add maven { url 'https://dl.bintray.com/kotlin/kotlin-eap' } both into the top-level build.gradle and into the app module build.gradle.
In both cases both into the buildscripts.repositories and in allprojects.repositories
None of the above worked for me. I ended up removing the google-services plugin and add it.
cordova plugin rm cordova-support-google-services
cordova plugin add cordova-support-google-services
In my case I had the same error first, then a whole bunch of other packages (org.ow2.asm:asm-analysis:4.0#jar, etc...) that could also not be resolved.
The problem was that I upgraded Gradle to v5 (to be able to support the new version of Crashlytic). Doing so, I upgraded the repository to Google(), and deleted the old maven { url ... } entries.
But I also deleted jcenter(), which was still required for a lot of nodes.
Now my repository section looks like this:
buildscript {
repositories {
maven { url "$rootDir/../node_modules/react-native/android" }
google() // Google Maven repository
jcenter()
}
//...
So if someone else is reading this but was not happy with the current accepted solution of downgrading Gradle, check if you have jcenter().
Ps.: I realize this is an old issue but I recently found it while searching on google.

The Android Gradle plugin supports only Crashlytics Gradle plugin version 1.25.4 and higher

After couple of months of not working on my app I have decided to continue and before doing so I wanted to update all dependencies, libraries etc.
After 3h+ of a nightmare with googles nonsense I am at the final (probably not even close) stage.
This error of:
The Android Gradle plugin supports only Crashlytics Gradle plugin
version 1.25.4 and higher.
Is driving me nuts. I did a global search on my project of 1.25.4 and 1 result came up which was for the classpath 'io.fabric.tools:gradle:1.25.1' so I changed it to classpath 'io.fabric.tools:gradle:1.25.4' and hoped for the best.. But the same error keeps coming up every time I am trying to build the app..
Can anyone tell me what kind of magic potion should I spray this gradle so it actually starts to work?
add this to the root project's build.gradle:
buildscript {
repositories {
...
maven { url "https://maven.fabric.io/public" }
}
dependencies {
...
classpath "io.fabric.tools:gradle:1.26.1"
}
}
and this on top of the module level's build.gradle:
apply plugin: "io.fabric"

Google Cloud Speech API protobuf is causing 'debugAndroidTestCompile' not found

I have copied and compiled the source code for speech api last month on this location https://github.com/GoogleCloudPlatform/android-docs-samples/tree/master/speech/Speech
and works. Now, when I revisited it, I'm having a Configuration with name 'debugAndroidTestCompile' not found. error.
What is causing this? If you ask me how did I know it is the one, I did the process of elimination. I removed one by one on the gradle file and sync. When I removed apply plugin: 'com.google.protobuf' the error disappears.
Update the protobuf version to the latest in build.gradle. Currently it's 0.8.8, check the latest version from the GitHub repository Protobuf Plugin for Gradle.
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.8'
}
}

Synchronizing Gradle failed due to unknown issues with downloads

I have been trying to fix this error all day now. All I did in the morning was update the compiler I had on my Android Studio. That's when everything went horribly wrong. Since then I have uninstalled the compiler...
These are the types of errors I keep getting everytime I try sync gradle:
Gradle sync failed: Could not find org.jetbrains.kotlin:kotlin-stdlib-jre8:1.2.0.
Searched in the following locations:
https://maven.google.com/org/jetbrains/kotlin/kotlin-stdlib-jre8/1.2.0/kotlin-stdlib-jre8-1.2.0.pom
https://maven.google.com/org/jetbrains/kotlin/kotlin-stdlib-jre8/1.2.0/kotlin-stdlib-jre8-1.2.0.jar
Is the latest and one I can't solve... things I've tried:
To solve the other problems I physically downloaded the jar files and
put them in the respective places (which failed with kotlin 1.2.0)...
I also added this to my gradle:
.
buildscript {
repositories {
jcenter()
google()
maven { url 'https://maven.fabric.io/public' }
maven { url 'https://jitpack.io' }
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.0'
classpath 'io.fabric.tools:gradle:1.+'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
This fixed my other issues...
I tried running from offline mode which failed...
I tried downloading the files into the project and referencing it like this:
.
compile files('kotlin-stdlib-jre8-1.2.0.jar')
I have long since removed the compiler just stuck as to what to do... I couldn't find any way online to fix my problem
I faced this problem after updating to new Android Studio too. You need to provide the dependency with new Kotlin version explicitly. In your app level build.gradle file add:
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.2.30"
Also you might need to add other dependencies:
compile "org.jetbrains.kotlin:kotlin-stdlib:1.2.30"
compile "org.jetbrains.kotlin:kotlin-reflect:1.2.30"
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.2.30"

The android gradle plugin version 3.0.0-alpha1 is too old

While building a default project (black template) on Android Studio 3.0 Canary 1, I got the below error.
The android gradle plugin version 3.0.0-alpha1 is too old, please update to the latest version. To override this check from the command line please set the
ANDROID_DAILY_OVERRIDE environment variable to "d27b293f4c7c48dfe922ba160164f3fa511cb3b9"
Upgrade plugin to version 3.0.0-alpha1 and sync project Open File
What's wrong with the default setting?
Your code may be containing an outdated gradle plugin version (may be alpha1, or something like that) in your project build.gradle file. Update it to the latest alpha4 plugin like below:
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0-alpha4'
}
Apparently, the alpha1 is obsolete, even though it is not mentioned anywhere in document I could find.
In the project build.gradle, just change from
classpath 'com.android.tools.build:gradle:3.0.0-alpha1'
to
classpath 'com.android.tools.build:gradle:3.0.0-alpha4'
classpath 'com.android.tools.build:gradle:+'
its not recommended to use +
Follow the steps :
Go to your Project structure
Click on project on left side panel
Update the Gradle version to 3.3
Click on Ok Button
let it sync and you will be done
After trying this solutions, I came with this:
buildscript {
repositories {
jcenter()
maven { url 'https://maven.google.com' }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0-alpha4'
}
}
add
maven { url 'https://maven.google.com' }
to buldscript repositories.

Categories

Resources