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'
Related
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'
}
Bugs: I want to update Realm database from version 4.2.0 to 4.3.3, but after gradle sync, it will fail
Goal
Update Realm from 4.2.0 to 4.3.3
Expected Results
Gradle sync will success
Actual Results
Gradle sync failed with stacktrace:
Error:Execution failed for task ':QuizApp:processDebugResources'.
Could not get unknown property 'packageForR' for task
':QuizApp:processDebugResources' of type
com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask.
Top level gradle file
buildscript {
repositories {
jcenter { url 'http://jcenter.bintray.com/' }
maven { url 'https://maven.fabric.io/public' }
maven { url "https://plugins.gradle.org/m2/" }
jcenter()
mavenCentral()
google()
}
dependencies {
// classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.android.tools.build:gradle:3.2.0-alpha01'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7'
classpath 'io.fabric.tools:gradle:1.+'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath "com.github.nullstress:DependencyAnalysisPlugin:1.0.3"
classpath 'com.google.gms:google-services:3.1.0'
classpath 'com.jakewharton:butterknife-gradle-plugin:8.4.0'
classpath "io.realm:realm-gradle-plugin:4.3.2"
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.2'
}
}
I Try cleaning gradle cache and stop the gradle daemon. Then retry the build. But the problem remains
If you are using ButterKnife, just remove ButterKnife gradle plugin, and use the annotationProcessor + implementation version instead. See step bellow:
Remove apply plugin: 'com.jakewharton.butterknife' in gradle
Just use/add dependencies below in gradle instead:
dependencies {
implementation 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
}
I had similar problem after gradle plugin update from:
classpath 'com.android.tools.build:gradle:3.0.1'
to
classpath 'com.android.tools.build:gradle:3.1.0'
In my case problem was caused by butterknife plugin, which are not compatible with gradle plugin newer than 3.0.1
Unfortunately I haven't solved this problem yet. I had to downgrade gradle plugin to 3.0.1.
And now I'm wating for newer version of butterknife plugin.
Update:
https://github.com/JakeWharton/butterknife/issues/1201
https://github.com/realm/realm-java/issues/5731
Changing the build.gradle
and then I run cordova build android the build.gradle file is updated.
How can I change the dependencies of cordova / plugins? Or force to a particular version?
Having issues with : google-gcm services
I am having conflicting dependencies of plugin causing the services to fail to build.
Something like this might help you :
buildscript {
repositories {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.google.gms:google-services:1.5.0-beta2'
}
}
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
dependencies {
compile 'com.google.android.gms:play-services-gcm:8.3.0'
}
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'
}
}
I have the error below in build.gradle at this line:
apply plugin: 'com.google.gms.google-services'
Error:(56, 0) Could not get unknown property 'LibraryVariants' for object of type com.android.build.gradle.LibraryExtension.
It happened after I installed Firebase.
How to solve this?
The error message, Error: Could not get unknown property 'LibraryVariants' for object of type com.android.build.gradle.LibraryExtension, indicates that this plugin needs to be applied to a module which uses the com.android.application plugin.
So, the simple solution is to only include the google-services plugin in your application module and not your library module:
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
I had the same problem and solved it updating gradle and google-services versions.
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
classpath 'com.google.gms:google-services:3.1.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Add the following to the #project level gradle file:
classpath 'com.android.tools.build:gradle:1.3.0'
classpath 'com.google.gms:google-services:3.0.0'
Add the following to the #app level gradle file:
// Dependency for Google Sign-In
compile 'com.google.android.gms:play-services-auth:9.4.0'
Apply plugin
apply plugin: 'com.google.gms.google-services'