Failed to update the android gradle plugin 3.5.0 - android

buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
//classpath 'com.android.tools.build:gradle:3.2.0-alpha09'
classpath 'com.google.gms:google-services:4.3.2'
classpath 'com.google.firebase:firebase-plugins:2.0.0'
/*classpath 'com.google.gms:google-services:3.2.1'
classpath 'com.google.firebase:firebase-plugins:1.2.0'*/
classpath 'com.google.guava:guava:24.1-jre'
}
}
allprojects {
repositories {
jcenter()
mavenCentral()
flatDir {
dirs '../libs'
}
google()
maven { url "https://jitpack.io" }
}
tasks.withType(JavaCompile) {
options.incremental = true
}
}
ERROR: Gradle DSL method not found: '19.0.0()'
Possible causes:
The project 'Rightrend-20190527-2051' may be using a version of the Android Gradle plug-in that does not contain the method (e.g. 'testCompile' was added in 1.1.0).
Upgrade plugin to version 3.5.0 and sync project
The project 'Rightrend-20190527-2051' may be using a version of Gradle that does not contain the method.
Open Gradle wrapper file
The build file may be missing a Gradle plugin.
Apply Gradle plugin

I fix this error by adding this line to .gradle file (app)
Gradle DSL method not found: 'kapt()'
Possible causes:
The project 'Isfahan Metro' may be using a version of the Android Gradle plug-in that does not contain the method (e.g. 'testCompile' was added in 1.1.0).
Upgrade plugin to version 3.5.3 and sync project
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt' // add this
for your problem check this link.
https://stackoverflow.com/answer
move google() above.

Open your gradle-wrapper.properties file, and update distributionUrl to https://services.gradle.org/distributions/gradle-5.4.1-all.zip

This is the wrongful line, because Guava is not a Gradle plugin:
classpath 'com.google.guava:guava:24.1-jre'

In "classpath" alter for "implementation" (update your dependencies):
dependencies {
implementation'com.android.tools.build:gradle:3.5.0'
//implementation'com.android.tools.build:gradle:3.2.0-alpha09'
implementation'com.google.gms:google-services:4.3.2'
implementation'com.google.firebase:firebase-plugins:2.0.0'
/*implementation'com.google.gms:google-services:3.2.1'
implementation'com.google.firebase:firebase-plugins:1.2.0'*/
implementation'com.google.guava:guava:24.1-jre'
}

Related

Execution failed for task ':app:mapDebugSourceSetPaths'. > Error while evaluating property 'extraGeneratedResDir' of task

I've checked this answer:
https://stackoverflow.com/a/34834772/13519865
It tells us to remove this line
apply plugin: 'com.google.gms.google-services'
Removing the line as asked completes the build, but I can't use Firebase (ofc!), it caused a new error, which tells me to add the line:
https://stackoverflow.com/a/40085096/13519865
So, I'm stuck in a loop here.
Related code sample added here https://github.com/Cyberavater/A.Reader
This issue started after updating the com.android.tools.build:gradle to version 7.3.0 and was fixed for me after updating the com.google.gms:google-services to version 4.3.14.
Edit: 2023-01-04
I have seen the same issue with the latest Android Studio Dolphin release, where you need to specify the Gradle version to be 7.3.1 and Google Services 4.3.14.
plugins {
id 'com.android.application' version '7.3.1' apply false
id 'com.android.library' version '7.3.1' apply false
}
dependencies {
classpath 'classpath "com.google.gms:google-services:4.3.14'
}
According to the new Chipmunk update of Android Studio, if you need to use Google Services, you have to add the following lines of code inside your build.gradle (Project) file:
plugins {
id 'com.android.application' version '7.3.1' apply false
id 'com.android.library' version '7.3.1' apply false
id 'com.google.gms.google-services' version '4.3.14' apply false 👈
}
task clean(type: Delete) {
delete rootProject.buildDir
}
And inside your build.gradle (Module) file, the following plugin IDs:
plugins {
id 'com.android.application'
id 'com.google.gms.google-services' 👈
}
change this line in >> android/build.gradle
classpath 'com.google.gms:google-services:4.3.10'
to
classpath 'com.google.gms:google-services:4.3.14'
Read this if Alex Mamo's answer does not solve the problem for you.
The new updates of Android Studio prioritize or prefer the settings.gradle file above build.gradle(project) for plugin management. There are two possible solutions.
Solution 1. Update your existing project as follows.
Update your settings.gradle
pluginManagement {
repositories {
gradlePluginPortal()
google()
mavenCentral()
gradlePluginPortal()
jcenter()
maven {
url "https://plugins.gradle.org/m2/"}
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
gradlePluginPortal()
maven {
url "https://plugins.gradle.org/m2/"}
}
}
rootProject.name = "Your App Name"
include ':app'
Update your build.gradle(project). Use your Gradle version, this example uses version 7.3.0, and google-services: 4.3.14.
buildscript {
repositories {
mavenCentral()
gradlePluginPortal()
maven {
url "https://plugins.gradle.org/m2/"
}
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.3.0'
classpath 'com.google.gms:google-services:4.3.14'
classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:0.14.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
plugins {
id 'com.android.application' version '7.3.0' apply false
id 'com.android.library' version '7.3.0' apply false
id 'com.google.gms.google-services' version '4.3.14' apply false
// other plugins in build.gradle(project)
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Add this to your build.gradle(app)
plugins {
id 'com.android.application'
id 'com.google.gms.google-services'
// other plugins
}
Solution 2. You can create a new project and move all your classes and XML into the new project.
I was facing the same issues but after updating the dependency the issues were resolved.
in my project level Gradle file previous it was as below:
dependencies {
classpath 'com.android.tools.build:gradle:7.3.1'
classpath 'com.google.gms:google-services:4.3.10'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.8.1'
classpath 'com.google.firebase:perf-plugin:1.4.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
after updating as below, It was working fine with me.
dependencies {
classpath 'com.android.tools.build:gradle:7.3.1'
classpath 'com.google.gms:google-services:4.3.14'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.2'
classpath 'com.google.firebase:perf-plugin:1.4.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
Try with deleting .idea and .gradle folders from root of your app , an then from main app module ... If this doesn't work , then you must clone your project, making new one with same package name ... This is bug in Android Studio Dolphin , and I solved it with cloning with new project with same package name
First check your build.gradle(project) and paste these code below the plugins and also sync your project.
task clean(type: Delete) {
delete rootProject.buildDir 😊
}

“Plugin with id 'com.android.application' not found”

I am getting “Plugin with id 'com.android.application' not found”. I have updated the gradle distribution version in gradle wrapper properties but to no avail. Do I need to write the build gradle dependencies somewhere?
You have to add in your top level file:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
}
}

Error:The "android" command is no longer included in the SDK. Any references to it (e.g. by third-party plugins) should be removed

I get the above error when I updated Android Gradle plugin to version 2.3.0 and Gradle to version 3.3.
Here is my Gradle script 1:
buildscript {
repositories {
jcenter()
maven { url 'example.com' }
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.0'
classpath 'com.github.JakeWharton:sdk-manager-plugin:220bf7a88a7072df3ed16dc8466fb144f2817070'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.0'
}
}
subprojects {
repositories {
jcenter()
mavenLocal()
}
version = '3.4.0'
group = 'com.journeyapps'
apply plugin: 'android-sdk-manager'
ext.androidBuildTools = '23.0.2'
ext.androidTargetSdk = 23
ext.zxingCore = 'com.google.zxing:core:3.2.1'
}
Remove this line from gradle file
apply plugin: 'android-sdk-manager'
This one work for me.
Try this SDks:
https://dl.google.com/android/repository/tools_r25.2.3-macosx.zip (form mac), https://dl.google.com/android/repository/tools_r25.2.3-windows.zip (for windows).
Reference: https://stackoverflow.com/a/42552342/1214902
Try to remove this line
apply plugin: 'android-sdk-manager'

Error showing while gradle building

I am getting following error while building the gradle:
Error:Execution failed for task ':app:processDebugGoogleServices'.
Please fix the version conflict either by updating the version of the google-services plugin (information about the latest version is available at https://bintray.com/android/android-tools/com.google.gms.google-services/) or updating the version of com.google.android.gms to 10.0.1.
Update your buildScript's dependency in your root build.gradle file like this
buildscript {
repositories {
mavenLocal()
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.0'
classpath 'com.google.gms:google-services:3.0.0'
}
}
Apply plugin in app module's build.gradle file
apply plugin: 'com.google.gms.google-services'
Add the following line in the dependency of the project-level build.gradle:
classpath 'com.google.gms:google-services:3.0.0'
Use these dependencies for the project build.gradle
dependencies {
classpath 'com.android.tools.build:gradle:2.0.0-alpha3'
classpath 'com.google.gms:google-services:2.0.0-alpha3'
}
and put this at the end of the app-level build.gradle file (after the dependencies).
apply plugin: 'com.google.gms.google-services'

How add mavenCentral to gradle in dev of nativescript plugin

I am writing a plugin for NativeScript but I have troubles with the gradle file,
how can I add the mavencentral() to the repositories tag in buildScript and an "apply instruction" ? example:
buildscript {
repositories {
jcenter()
mavenCentral()
}
dependencies {
classpath "com.android.tools.build:gradle:2.1.2"
classpath 'com.google.gms:google-services:3.0.0'
}
}
apply plugin: "com.android.application"
apply plugin: 'com.google.gms.google-services'
I tried to add this to the include.gradle for my plugin but when I add this plugin in my app project, the build process fails.

Categories

Resources