When I put apply plugin: 'android-reporting' in my project level build.gradle file as suggested here, gradle sync fails throwing
Caused by: java.lang.IllegalArgumentException: Cannot add extension with name 'android', as there is an extension already registered with that name.
Can somebody help what could be happening here. I am at latest version of gradle plugin.
You need to apply it at the end of the root build.gradle
I ran into this issue from applying an android plugin via an allPlugins block. If you change this to subprojects it might fix your issue
Related
I am following the AWS docs, here. I am able to add everything into my project's build.gradle, AndroidManifest.xml, and app's build.gradle EXCEPT for the apply plugin. When I add:
apply plugin: 'com.amazonaws.appsync'
I get the following error:
Caused by: org.gradle.api.internal.plugins.PluginApplicationException: Failed to apply plugin [id 'com.amazonaws.appsync']
How do I fix this? When I remove the apply plugin from the app's build.gradle, then my app works again.
Did you try updating you gradle version and is your android studio also in the latest state, follow this thread and also update your question with the project's build.gradle file
https://stackoverflow.com/a/37091489/1503130
Unable to resolve this warning. How can I resolve this?
variant.getExternalNativeBuildTasks()' is obsolete and has been replaced with
variant.getExternalNativeBuildProviders()
Just update Fabric gradle plugin to 1.28.0
dependencies {
classpath 'io.fabric.tools:gradle:1.28.0'
}
Add this android.debug.obsoleteApi=true to the gradle.properties file. And make gradle clean, sync and then build an APK. Worked for me. I have Android Studio 3.3 and Gradle version 4.10.1.
For more information check this link out: Android Gradle plugin release notes.
I agree with other contributors: Fabric causes this error.
UPDATE
Check Valdislav Panchenko's answer:
Now you can just update your Fabric plugin to 1.28.0 as follows:
dependencies {
classpath 'io.fabric.tools:gradle:1.28.0'
}
Most likely it's caused by Fabric's plugin needed for Crashlytics.
Commenting out apply plugin: 'io.fabric' resolves the issue. So the only option is to wait until Google devs will fix Fabric's plugin.
It's caused by one of the Gradle plugins used in your project.
Check build.gradle file and try to remove apply plugin: xxx one by one to understand exactly which plugin is causing the warning.
In our project it was apply plugin: 'io.fabric' after Google update Android Studio to 3.3 yesterday.
It happened to me but I needed to continue with the Fabric plugin.
For those who need to keep the Fabric plugin applied, the temporary solution is to go back to the previous version of the gradle at the project level.
Change the classpath version to com.android.tools.build:gradle:3.2.1.
For those who are facing this problem eventhough they dont use fabric, forget about Vitaly Zeyenko's updated answer above and simply go to the gradle folder of your project and open the gradle.properties file and add this line -->>> android.debug.obsoleteApi=true to it...
After that, Clean and rebuild project... This is a better solution than on the command line because a lot of people already have the JDK environment set to wrong locations on their computer and might face more problems solving this issue through the command line
Recently I have had to update my project to use Gradle 4.4 from 4.1.
i.e.
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
in my gradle-wrapper.properties file.
However, this is incompabitble with the fabric plugin
apply plugin: 'io.fabric'
As since the gradle update, I now get build errors when syncing my project.
Such as:
Error:Could not get unknown property 'manifestFile' for task
':Module:generateVariantFlavorRFile' of type
com.android.build.gradle.internal.res.GenerateLibraryRFileTask.
Does anyone know when/if there will be a new plugin update that is compatible with gradle 4.4+?
So my project included feature modules, where in the the base module's build.gradle, I apply the fabric plugin. i.e. apply plugin: 'io.fabric'
It turns out that gradle version 4.4 + does work but you need to add the following:
crashlytics { instantAppSupport true }
in your base module's build.gradle. I didn't actually have an instant app, but even with feature modules in appears that this line is needed.
More info on how this can be added can be found here:
How do I integrate Crashlytics with Android Instant Apps?
I wanted to try instant-run from AS 2.0 - for this to work I had to update to build-plugin to 2.0.0-alpha6 - but when doing this I cannot gradle-sync the project anymore as I am getting:
Gradle 'myProject' project refresh failed
Error:Cause: com.android.sdklib.repository.FullRevision
Anyone knows the reason/workaround for this?
I use JakeWharton/sdk-manager-plugin.
build-plugin to 1.5.0 is not problem.
In my project I have added
apply plugin: 'android-sdk-manager'
I removed it from the gradle file of App & it worked.
Hope will help you.
In my case I had to mark out 'apply plugin: 'android-sdk-manager' from the project's 'build.gradle' file. Obviously, environment and project's configurations vary, however, marking it out and allowing
dependencies{
.....
classpath 'com.jakewharton.sdkmanager:gradle-plugin:0.10+'
}
handle the plugin resolved this issue.
I tried to upload my code to bintry so that I can connect it to jcenter but the problem occurs when I add this line to my library build.gradle:
apply plugin: 'com.github.dcendents.android-maven'
gradle can not be build, what did I wrong?
I had the same issue. I was using gradle 2.4.
I don't know why but by downgrading gradle to 2.2.1 it get solved.
Just go to File then Project Settings and write in gradle field 2.2.1.