What I can know what dependency version I need compile with gradle - android

I have the next gradle file:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.0.0-alpha3'
classpath 'com.android.tools.build:gradle:2.0.0-alpha3'
classpath 'com.google.gms:google-services:2.0.0-alpha3'
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'org.apache.httpcomponents:httpcore:4.4.1'
compile 'org.apache.httpcomponents:httpclient:4.5'
compile 'org.apache.httpcomponents:httpcore:4.4.1'
compile 'org.apache.httpcomponents:httpclient:4.5'
compile 'com.android.support:design:23.2.1'
compile 'com.loopj.android:android-async-http:1.4.4'
compile 'com.google.android.gms:play-services-base:8.4.0'
compile 'com.google.android.gms:play-services-location:7.3.0'
compile 'com.google.gms:google-services:2.1.0-rc1'
}
I'm getting error in the lines starting with: compile 'com.google.android.gms
The error is:
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 8.3.0.
How I can know what version are available for this specific component?

You should keep the version of com.google.android.gms libraries the same. If you are going to use v. 8.4.0 for the services.base, then you should always keep the others the same. So, you should also set services-location to the same version:
compile 'com.google.android.gms:play-services-base:8.4.0'
compile 'com.google.android.gms:play-services-location:8.4.0'
See Google Play Services for more version information.
Also, here is a similar question that is helpful for general Gradle setup as well: Version conflict updating to 8.4.0

Related

Error for the version of google services [duplicate]

This question already has answers here:
Error : Please fix the version conflict either by updating the version of the google-services plugin
(2 answers)
Closed 5 years ago.
Even after updating the version same error continues to pop up whenever the gradle is built.
Project base gradle
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.google.gms:google-services:3.1.0'
}
**App base gradle **
ependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.google.firebase:firebase-auth:10.0.1'
compile 'com.google.firebase:firebase-database:9.2.0'
compile 'com.github.barteksc:android-pdf-viewer:2.4.0'
compile 'com.google.firebase:firebase-storage:10.0.1'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
and the error is shown as follows:-
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.
Please help me to solve the issue.
Your all firebase version should be same.
compile 'com.google.firebase:firebase-database:9.2.0'
update it
compile 'com.google.firebase:firebase-database:10.0.1'

Android Studio dependency Version conflict gradle

I have a conflict with my dependencies, and no matter which version I try that it recommends me, it doesn't solve the issue. Looking around did no help so this is my last resort. Here is my error;
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 11.0.2.
My Gradle;
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.google.gms:google-services:3.1.0'
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:26.+'
compile 'com.android.support:design:26.+'
compile 'com.nightonke:boommenu:2.1.0'
compile 'com.google.firebase:firebase-messaging:11.0.2'
compile 'com.google.firebase:firebase-core:11.0.4'
compile 'com.google.firebase:firebase-ads:10.0.1'
compile 'com.google.android.gms:play-services-plus:11.0.2'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
You should remove following line from gradle
compile 'com.google.android.gms:play-services-plus:11.0.2'
Firebase dependencies must have same version
compile 'com.google.firebase:firebase-messaging:11.0.4'
compile 'com.google.firebase:firebase-core:11.0.4'
compile 'com.google.firebase:firebase-ads:11.0.4'
compile 'com.google.android.gms:play-services-plus:11.0.4'
Error:Execution failed for task ':app:processDebugGoogleServices'.
Please fix the version conflict either by updating the version of the
google-services plugin
You should use SAME versions of FIREBASE & GMS .
Use 11.0.4 .
compile 'com.google.firebase:firebase-messaging:11.0.4'
compile 'com.google.firebase:firebase-core:11.0.4'
compile 'com.google.firebase:firebase-ads:11.0.4'
compile 'com.google.android.gms:play-services-plus:11.0.4'
Finally Clean-Rebuild-Run .
compile 'com.google.firebase:firebase-messaging:11.0.2'
compile 'com.google.firebase:firebase-core:11.0.2'
compile 'com.google.firebase:firebase-ads:11.0.2'
compile 'com.google.android.gms:play-services-plus:11.0.2'
Change these dependency with this version.

firebase and com.google.android.gms

I just added firebase support to my android app. At first it worked fine. However, in order to track stacktraces I added the following stuff to my app/gradle.build:
compile 'com.google.firebase:firebase-crash:10.2.6'
such that it looks like this right now:
dependencies {
compile 'com.google.firebase:firebase-core:11.0.0'
compile 'com.google.firebase:firebase-crash:10.2.6'
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
However, when I want to start my app now I am getting the following error message:
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 11.0.0.
I first checked in the SDK manager that everything was up to date and it is:
Since it did not work, I tried to add the required dependency manually like this:
compile 'com.google.gms:google-services:3.1.0'
Didn't work either. What am I doing wrong here?
Make sure following dependencies are using the same version.
compile 'com.google.firebase:firebase-core:11.0.0'
compile 'com.google.firebase:firebase-crash:10.2.6'

All com.google.android.gms libraries must use exact same version

I have updated compileSdkVersion from 23 to 24. After, it gave me an error for com.google.android.gms. When I checked the library, there is only one com.google.android.gms is in the version of 8.3.0 (measurement).
I couldn't force to update measurement as
compile 'com.google.android.gms:play-services-measurement:9.4.0'
It is giving the following error;
Failed to resolve:
com.google.android.gms:play-services-measurement:9.4.0
I have examined other stackoverflow questions but they couldnt solve my problem.
How can I solve this error?
Here are my dependencies;
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile('com.google.api-client:google-api-client-android:1.20.0') {
exclude group: 'org.apache.httpcomponents'
}
compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support:appcompat-v7:24.2.0'
compile 'com.google.android.gms:play-services-gcm:9.4.0'
compile 'com.google.android.gms:play-services-analytics:9.4.0'
compile 'com.google.android.gms:play-services-maps:9.4.0'
compile 'com.google.android.gms:play-services-location:9.4.0'
compile 'com.github.npanigrahy:Custom-Calendar-View:v1.0'
compile 'com.android.support:support-v4:24.2.0'
compile 'com.wonderpush:wonderpush-android-sdk:1.2.3.2'
compile 'com.android.support:design:24.2.0'
compile 'org.mod4j.org.apache.commons:lang:2.1.0'
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
compile('com.crashlytics.sdk.android:crashlytics:2.5.5#aar') {
transitive = true;
}
compile 'com.mcxiaoke.volley:library:1.0.19'
compile 'uk.co.chrisjenx:calligraphy:2.2.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile project(':circleimageview-release')
}
full error text:
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 8.3.0.
I have find the solution of my problem. I have updated my project level of my gradle as from
classpath 'com.google.gms:google-services:1.5.0-beta2'
to
classpath 'com.google.gms:google-services:3.0.0'

Gradle DSL method not found 'compile()

I'm making an interactive login app with Android Studio and wampserver. After creating the Android Studio project, I changed the build.gradle like this:
dependencies {
classpath 'com.android.tools.build:gradle:1.3.0'
compile 'com.android.support:appcompat-v7:21.0.3'
compile 'com.android.support:support-v4:21.0.3'
compile 'com.mcxiaoke.volley:library-aar:1.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
Then the IDE keeps showing the following error:
(((Gradle DSL method not found: 'compile()
Possible causes:The project 'Login_wamp' may be using a version of Gradle that does not contain the method.
The build file may be missing a Gradle plugin.
Apply Gradle plugin )))
When I click on Apply gradle plugin, it shows me a lot of plugins. Should I pick one of these options?
What should I do to fix this error?
UPDATE
I have moved the above lines to the other build.gradle file, but I get 2 other problems now:
the support library should not use the different version(21) than the compileSDK version(23).
These lines are my gradles exact shape. Which "21" should be changed to "23" or which "23" should be changed into "21"?
I have changed the
compile 'com.android.support:appcompat-v7:21.0.3' to
compile 'com.android.support:appcompat-v7:23.0.3' and it says that I should Install Repository and sync project.
Here is my build.gradle:
compileSdkVersion 23
buildToolsVersion "23.0.1"
minSdkVersion 14
targetSdkVersion 23
versionCode 1
versionName "1.0"
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.android.support:appcompat-v7:23.0.3'
compile 'com.android.support:support-v4:21.0.3'
compile 'com.mcxiaoke.volley:library-aar:1.0.0'
}
You are using the top level build.gradle
root
|--app
|----build.gradle
|--build.gradle //top level file
|--settings.gradle
In this file you can't use the compile statement:(it is the reason of your issue)
Just move these lines:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.1'
//REMOVE THESE LINES
//compile 'com.android.support:appcompat-v7:21.0.3'
//compile 'com.android.support:support-v4:21.0.3'
//compile 'com.mcxiaoke.volley:library-aar:1.0.0'
}
}
Then you have to add the dependencies in your module/build.gradle file.
EDIT: After your comment.
In your module/build.gradlefile:
use the same version for all support libraries
use the latest (currenlty 23.1.1)
dont' add the same library twice (appcompat)
the 23.0.3 doesn't exist
Here the changes:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1' //update to 23.1.1
//compile 'com.android.support:appcompat-v7:23.0.3' //REMOVE THIS LINE. It doesn't exist and you adding twice
compile 'com.android.support:support-v4:23.1.1' //USE THE SAME VERSION
compile 'com.mcxiaoke.volley:library-aar:1.0.0'
}
I think you are using the wrong build.grade file.
There are two gradle files in your Project.
One is called build.gradle (Project: YourProjectname)
The other one build.grade (Module: app).
Delete the following lines from build.gradle (Project: YourProjectname):
compile 'com.android.support:appcompat-v7:21.0.3'
compile 'com.android.support:support-v4:21.0.3'
compile 'com.mcxiaoke.volley:library-aar:1.0.0'
Search the dependencies in your build.gradle (app: Module)
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
}
and add the compile lines there:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:21.0.3'
compile 'com.android.support:support-v4:21.0.3'
compile 'com.mcxiaoke.volley:library-aar:1.0.0'
}
salam Mehdi. first of all you must open freegate and set proxy settings from android studio settings.(IP=127.0.0.1 and port=8580). after that you must click on apply gradle plugin to update your SDK. after updates done the error must gone. Hope this help you.

Categories

Resources