Issues with updating my app version in gradle file - android

So I was using API 25 which is Nougat version, and I wanted to update my app to Version ApI27 which is newly out these days. but whenever I update to 27.0.1, this Error:
"Error:Failed to resolve: com.android.support:appcompat-v7.27.0.1"
keeps occurring. I don't know what I've done wrong and I'm struggling all day to find the resolution. Thank you very much for your time and assistance in this matter.
Oh, and I'm sure that I've downloaded SDK Versions and all the files that are needed already in SDK manager.
My Gradle File(Module App):
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
buildToolsVersion '27.0.1'
defaultConfig {
applicationId "org.poream.dejaview"
minSdkVersion 15
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner
"android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
}
}
dependencies {
implementation 'com.google.firebase:firebase-storage:11.6.0'
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2',
{
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:design:27.0.1'
compile 'com.google.android.gms:play-services-maps:11.6.0'
compile 'com.android.support:appcompat-v7.27.0.1'
compile 'com.android.support:design:27.0.1'
compile 'com.google.android.gms:play-services-maps:11.6.0'
compile 'com.android.support:cardview-v7:27.0.1'
compile 'com.google.android.gms:play-services-location:11.6.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.google.firebase:firebase-core:11.6.0'
compile 'com.google.firebase:firebase-database:11.6.0'
compile 'com.google.firebase:firebase-crash:11.6.0'
compile 'com.google.firebase:firebase-auth:11.6.0'
compile 'com.android.support:support-v4:27.0.1'
compile 'com.android.support:recyclerview-v7:27.0.1'
compile 'com.google.android.gms:play-services-auth:11.6.0'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
My Gradle File(Project):
// Top-level build file where you can add configuration options common to
all sub-projects/modules.
buildscript {
repositories {
mavenCentral()
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.google.gms:google-services:3.1.0'
}
}
allprojects {
repositories {
jcenter()
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}

There is a typo (the . instead of :)
compile 'com.android.support:appcompat-v7.27.0.1'
Use:
compile 'com.android.support:appcompat-v7:27.0.1'

Add maven { url 'https://maven.google.com/' } line in your project level build.gradle
repositories {
maven { url 'https://maven.google.com/' }
}

Related

having the same gradle level still throws fix the version conflict either by updating the version of the google-services plugin

I am facing this error while gradle building
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 9.0.0.
despite all my google versions are same
app.gradle
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 26
buildToolsVersion "26.0.0"
defaultConfig {
applicationId "com.iviewlabs.mrmint"
minSdkVersion 15
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner
"android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
}
}
repositories {
mavenCentral()
}
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.+'
testCompile 'junit:junit:4.12'
compile 'de.hdodenhof:circleimageview:2.2.0'
compile 'com.android.support:design:26.+'
compile 'com.android.support:cardview-v7:26.+'
compile 'com.android.support:support-v4:26.+'
compile 'com.google.android.gms:play-services-maps:11.0.4'
compile 'com.google.maps.android:android-maps-utils:0.5'
compile 'com.google.android.gms:play-services-location:11.0.4'
compile 'com.squareup.okhttp:okhttp:2.6.0'
compile 'com.google.code.gson:gson:2.8.1'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'id.zelory:compressor:2.1.0'
compile 'com.google.firebase:firebase-messaging:11.0.4'
}
while my project level gradle is
// Top-level build file where you can add configuration options common to
all sub-projects/modules.
buildscript {
repositories {
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.0'
classpath 'com.google.gms:google-services:3.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Please help me find the solution I have tried many solutions
in app.gradle
apply plugin: 'com.google.gms.google-services'
ADD THIS LINE AT THE END NOT AT THE TOP AS YOU HAVE DONE.
like this:-
dependencies {
}
apply plugin: 'com.google.gms.google-services'

Android Studio - Updating the Version of com.google.android.gms to 11.6.0

I always get this error in my android studio, and i dont have any idea about this, i've tried to find the solution on the Internet but i still cant find it.
This is my Gradle Image :
this is the Error Image :
In your project the errors comes like you have not add project level google classpath and not apply google plugin in app level gradle so,
Add in project level gradle
classpath 'com.google.gms:google-services:3.1.1'
Add in APP level gradle and google plugin
dependencies {
compile 'com.google.firebase:firebase-core:11.6.0'
compile 'com.google.android.gms:play-services:11.6.0'
}
// ADD THIS AT THE BOTTOM
apply plugin: 'com.google.gms.google-services'
NOTE-: If you want to add more Google gradle for your requirements then add with same version.
For More https://firebase.google.com/docs/android/setup
https://developers.google.com/android/guides/setup
If you are using Google Services your Gradles should look something like this:
App level build.gradle should look like
apply plugin: 'com.android.application'
apply plugin: 'com.google.firebase.firebase-crash'
android {
compileSdkVersion 26
buildToolsVersion "26.0.2"
defaultConfig {
applicationId "com.xxxxxx"
minSdkVersion 15
targetSdkVersion 26
versionCode 11
versionName "1.10"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.config
}
debug {
signingConfig signingConfigs.config
resValue("string", "PORT_NUMBER", "8081")
}
}
dexOptions {
javaMaxHeapSize "4g"
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
debugCompile project(':debug-db')
compile project(':tracker')
compile 'com.android.support:appcompat-v7:26.1.0'
compile 'com.android.support:design:26.1.0'
compile 'com.android.support:cardview-v7:26.1.0'
compile 'com.android.support:multidex:1.0.2'
compile 'com.google.android.gms:play-services-location:11.6.0'
compile 'com.google.android.gms:play-services-places:11.6.0'
compile 'com.google.android.gms:play-services-maps:11.6.0'
/* compile 'com.google.android.gms:play-services:11.6.0'*/
compile 'com.google.firebase:firebase-core:11.6.0'
compile 'com.google.firebase:firebase-crash:11.6.0'
compile 'com.google.firebase:firebase-messaging:11.6.0'
compile 'com.mcxiaoke.volley:library:1.0.19'
compile 'com.squareup.okhttp3:okhttp:3.8.0'
compile 'de.hdodenhof:circleimageview:2.1.0'
compile 'com.squareup.retrofit2:retrofit:2.3.0'
compile 'com.squareup.retrofit2:converter-gson:2.3.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:recyclerview-v7:26.1.0'
testCompile 'junit:junit:4.12'
}
// Add to the bottom of the file
apply plugin: 'com.google.gms.google-services'
As you could see, no use for build, but it completely depends on your use /* compile 'com.google.android.gms:play-services:11.4.0'*/
And root level gradle.build is:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
mavenCentral()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
classpath 'com.google.gms:google-services:3.1.1'
classpath 'com.google.firebase:firebase-plugins:1.1.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
maven { url "https://jitpack.io" }
jcenter()
mavenCentral()
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Make sure your Gradle distribution in gradle-wrapper.properties is
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-all.zip

Gradle error: JSON standard does not allow such token (android studio 3.0)

i have this problem and relative solution, but i don't know why it works
I just upgraded to Android 3.0 and tried to compile my app. I have a lot of erro in gradle.build if i have this structure (i'll keep the relevant part)
android{
....
}
dependencies {
....
}
and the error is JSON standard does not allow such token
But if i change the structure to
android {
....
dependencies {
....
}
}
(dependecies is INSIDE android object)
the error appears here:
compile '**com.android.support**:support-v4:26.1.0'
compile '**com.loopj.android**:android-async-http:1.4.9'
with another error that says "< value> expected, got ':'"
Any ideas ?
yeah things have changed. do it as follows
This is the best way to do it.
In your root level gradle.build use below
buildscript {
repositories {
mavenCentral()
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenCentral()
jcenter()
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
and in your gradle-wrapper.properties file change the wrapper version as below
distributionUrl=https\://services.gradle.org/distributions/gradle-4.2.1-all.zip
also in your app level build.gradle make sure you are using 26 vesion as below
android {
compileSdkVersion 26
buildToolsVersion "26.0.2"
defaultConfig {
applicationId "com.xxxx"
minSdkVersion 16
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
debugCompile project(':debug-db')
compile project(':tracker')
compile 'com.android.support:appcompat-v7:26.1.0'
compile 'com.android.support:design:26.1.0'
compile 'com.android.support:cardview-v7:26.1.0'
compile 'com.android.support:multidex:1.0.2'
compile 'com.google.android.gms:play-services-location:11.4.2'
compile 'com.google.android.gms:play-services-places:11.4.2'
compile 'com.google.android.gms:play-services-maps:11.4.2'
compile 'com.google.firebase:firebase-core:11.4.2'
compile 'com.google.firebase:firebase-crash:11.4.2'
compile 'com.google.firebase:firebase-messaging:11.4.2'
compile 'com.mcxiaoke.volley:library:1.0.19'
compile 'com.squareup.okhttp3:okhttp:3.4.2'
compile 'de.hdodenhof:circleimageview:2.1.0'
compile 'com.github.Kunzisoft:Android-SwitchDateTimePicker:1.7'
compile 'com.github.safetysystemtechnology:location-tracker-background:v1.2'
compile 'com.squareup.retrofit2:retrofit:2.3.0'
compile 'com.squareup.retrofit2:converter-gson:2.3.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:recyclerview-v7:26.1.0'
testCompile 'junit:junit:4.12'
}
// Add to the bottom of the file
apply plugin: 'com.google.gms.google-services'

fix the version conflict either by updating the version of the google-services or updating the version of com.google.android.gms

I'm just trying to use the Firebase Cloud Messaging but i'm getting a error. This is my first time doing this, so i think could be a version of the location services of something. I already put a few libraries, but i'm not sure whats is the problem.
The Firebase is which is making some problems.
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.2.6.
This is my Gradle (App).
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.0"
defaultConfig {
applicationId "com.xxx.xxx.xxx"
minSdkVersion 19
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
debuggable true
}
}
sourceSets { main { assets.srcDirs = ['src/main/assets', 'src/main/assets/'] } }
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
allprojects {
repositories {
// Add this line
maven { url "https://jitpack.io" }
}
}
compile('com.wdullaer:materialdatetimepicker:3.2.2') {
exclude group: 'com.android.support'
}
compile 'com.google.firebase:firebase-core:10.2.6'
compile 'com.github.Mariovc:ImagePicker:1.2.0'
compile 'com.android.support:appcompat-v7:26.+'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:design:26.+'
compile 'com.mcxiaoke.volley:library-aar:1.0.0'
compile 'com.google.android.gms:play-services-location:11.0.4'
compile 'com.android.support:support-v4:26.0.0-alpha1'
compile 'com.google.android.gms:play-services-maps:11.0.4'
compile 'com.android.support:cardview-v7:26.0.+'
compile 'com.android.support:recyclerview-v7:26.0.+'
compile 'de.hdodenhof:circleimageview:2.1.0'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
And this is the other Gradle.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.google.gms:google-services:3.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Please help me, i'm in a rush
You are using different version of the same library using:
compile 'com.google.firebase:firebase-core:10.2.6'
compile 'com.google.android.gms:play-services-location:11.0.4'
You can use:
compile 'com.google.firebase:firebase-core:11.0.4'
compile 'com.google.android.gms:play-services-location:11.0.4'
or you can switch to the latest stable version:
compile 'com.google.firebase:firebase-core:11.2.0'
compile 'com.google.android.gms:play-services-location:11.2.0'
This release requires to add the google maven repo.
repositories {
jcenter()
maven { url 'https://maven.google.com' }
}
More info about the releases of google play services here and firebase here.
Also you should use the stable version of:
compile 'com.android.support:support-v4:26.0.0'
Try to change the firebase version to the following:
compile 'com.google.android.gms:play-services:11.0.2'
compile 'com.google.firebase:firebase-core:11.0.2'
And add play-services
This error also occurs if one does not add apply plugin: 'com.google.gms.google-services' to the bottom of app/build.gradle. I happened to overlook it and added it below apply plugin: 'com.android.application'.

Firebase Android Studio (2.2.3) issue

I am facing a problem to compile Firebase in my android project.Here is my app level gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "24.0.3"
defaultConfig {
applicationId "<my_app_id>"
minSdkVersion 15
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
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:25.1.0'
compile 'com.android.support:support-v4:25.1.0'
compile 'com.google.android.gms:play-services-auth:10.0.1'
compile 'com.android.support:design:23.0.1'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'me.relex:circleindicator:1.2.2#aar'
compile 'com.android.support:recyclerview-v7:25.1.0'
compile 'com.google.firebase:firebase-core:10.2.1'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
And here is the build gradle:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.google.gms:google-services:3.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
I am getting an error of Failed to resolve : com.google.firebase:firebase-core:10.2.1
If you are using android studio,
Goto tools -> Firebase
And follow on screen instructions. Android studio take care of the dependency issues.
Change
compile 'com.google.android.gms:play-services-auth:10.2.1'
to
compile 'com.google.android.gms:play-services-auth:10.0.1'
It works for me.
update your play service version and also update firebase dependency version.

Categories

Resources