Android Studio Failed to resolve: support-core-utils - android

After upgrading support library version to 27.1.1 when i sync the project i face with below error:
Failed to resolve: support-core-utils
Any idea?
here is my project level build file:
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.0'
classpath 'com.google.gms:google-services:3.1.0'
}
}
allprojects {
repositories {
google()
jcenter()
maven { url "https://jitpack.io" }
}
}
and app level build file:
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'

I solved this by setting
google() as first entry in allprojects/repositories in top level build.gradle
allprojects {
repositories {
google()
jcenter()
maven { url "https://jitpack.io"
}
}
}

as per behavior changes in android-Gradle plugin (v3.2.0 September 2018) you need to keep the google repository as the first entry
buildscript {
repositories {
google() // here
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.0'
}
}
allprojects {
repositories {
google() // and here
jcenter()
}
android-Gradle plugin release note

I have same problem and i changed to successful.
Added maven { url 'https://maven.google.com' } as first entry in allprojects/repositories in top level build.gradle

In my case , it was because of a library dependency and I solved by excluding support-core-utils from that library :
implementation ('com.github.chrisbanes:PhotoView:2.0.0'){
exclude module: 'support-core-utils'
}

I had the same problem with AppCompat library with version 28.0.0. I fixed it by using 28.0.0-alpha1. None of answers helped me.
Android studio 3.1.4
Target and compile sdk 28.
At the time the library was not really stable. support-core-utils is a part of android-support-v4, so if you still have a problem with that try adding
implementation 'com.android.support:support-v4:27.1.1'
to the dependencies.

do you add implementation 'com.android.support:design:XX.X.X', implementation 'com.android.support:support-v4:XX.X.X' ?
when I saw "duplicate value for resource" message I just had implementation 'com.android.support:appcompat-v7:28.0.0'
and I added implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support:support-v4:28.0.0' and worked it !

Remove mavenCentral() from repositories script in project level if there.

Related

Update firebase 11 dependency on Android Gradle

I have the follow app/build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
...
minSdkVersion 19
targetSdkVersion 27
...
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
useLibrary 'org.apache.http.legacy'
}
dependencies {
implementation fileTree(include: ['*.jar', '*.aar'], dir: 'libs')
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.google.firebase:firebase-messaging:11.8.0'
implementation 'com.google.firebase:firebase-core:11.8.0'
implementation 'com.google.code.gson:gson:2.8.2'
implementation 'com.github.IntruderShanky:scatter-piechart:1.0.0'
implementation 'com.etsy.android.grid:library:1.0.5'
implementation 'com.journeyapps:zxing-android-embedded:3.6.0'
implementation 'com.google.zxing:core:3.3.0'
testImplementation 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
And follow project/build.gralde
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.3'
classpath 'com.google.gms:google-services:3.2.1'
}
}
allprojects {
repositories {
jcenter()
maven {
url "https://jitpack.io"
}
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
When I'm hovering mouse above firebase implementations I get the follow warnings
implementation 'com.google.firebase:firebase-messaging:11.8.0' show me
A newer version of com.google.firebase:firebase-messaging than 11.8.0
is available: 17.1.0
and implementation 'com.google.firebase:firebase-core:11.8.0' show me
A newer version of com.google.firebase:firebase-core than 11.8.0
is available: 16.0.1
Then I do the sugestion and update my implementation to available version as follow
implementation 'com.google.firebase:firebase-messaging:17.1.0'
implementation 'com.google.firebase:firebase-core:16.0.1'
and sync my project. But the project show me the follow errors
Failed to resolve: play-services-base Open File
Failed to resolve: play-services-tasks Open File
Failed to resolve: play-services-stats Open File
Failed to resolve: play-services-ads-identifier Open File
Failed to resolve: play-services-basement Open File
I'm trying solve it for a long time and nothing work. Please, help me to solve it!
In the top level gradle file add the following:
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.3'
classpath 'com.google.gms:google-services:4.0.2'
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Add the google() repo before jcenter() and use the latest google service plugin version 4.0.2
https://bintray.com/android/android-tools/com.google.gms.google-services/
Make sure you are connected to a good network
Try adding Google maven repository into app's build.gradle file:
repositories {
maven { url "https://maven.google.com" }
}
If step 1 won't work, remove gradle from your project root folder and rebuild your project again.
Try another
Goto >file -> other settings -> Under build, execution, and deployment
-> you will see Gradle. uncheck the checkbox offline work

How to put Firebase RealtimeDatabase and FCM together

I might have some versions' issue I guess? I was using
implementation 'com.google.firebase:firebase-messaging:15.0.2'
Everything works fine, now I want to add RealtimeDatabase
The Assistant of Android Studio suggested :
implementation 'com.google.firebase:firebase-messaging:15.0.2'
implementation 'com.google.firebase:firebase-database:11.8.0'
Official Guide suggest
implementation 'com.google.firebase:firebase-messaging:15.0.2'
implementation 'com.google.firebase:firebase-database:16.0.1'
Both resulting : Please fix the version conflict either by updating the version of the google-services plugin ... or updating the version of com.google.android.gms to 15.0.2.
I know I might have to align their version, but I got
Could not find com.google.firebase:firebase-messaging:16.0.1.
or
Could not find com.google.firebase:firebase-database:15.0.2.
// If I use All official latest
implementation 'com.google.firebase:firebase-messaging:17.0.0'
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.google.firebase:firebase-database:16.0.1'
Could not find com.google.firebase:firebase-core:17.0.0.
So how can I put them together?
Official site :
Getting a "Could not find" error? Make sure you have added the Google maven respository to your root build.gradle
But I did. (Did I?) Here is my app.gradle
buildscript {
ext.kotlin_version = '1.2.30'
repositories {
google()
jcenter()
maven { url 'https://plugins.gradle.org/m2/' }
maven { url "https://maven.google.com" }
}
dependencies {
classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:0.10.1'
classpath 'com.android.tools.build:gradle:3.1.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:3.1.1'
}
}
allprojects {
repositories {
google()
jcenter()
}
}
ext {
roomVersion = '1.0.0'
archLifecycleVersion = '1.1.0'
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Change this:
classpath 'com.google.gms:google-services:3.1.1'
into this:
classpath 'com.google.gms:google-services:4.0.1'
And use the following dependencies:
implementation 'com.google.firebase:firebase-messaging:17.0.0'
implementation 'com.google.firebase:firebase-database:16.0.1'
implementation 'com.google.firebase:firebase-core:16.0.1'
More info here: Firebase Release notes

Could not find any version that matches com.google.android.gms:play-services-base:[15.0.1,16.0.0)

I am using firebase for my android app and suddenly I am getting an error when I tried to run the app. Saturday it was working perfectly. I don't know how this error occurred and how to solve this. Please help me.
dependencies in my build.gradle
dependencies {
compile('com.crashlytics.sdk.android:crashlytics:2.5.2#aar') {
transitive = true;
}
compile 'com.android.volley:volley:1.0.0'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:cardview-v7:23.4.0'
compile 'com.facebook.android:facebook-android-sdk:4.1.0'
compile 'com.google.code.gson:gson:2.8.4'
compile 'com.android.support:multidex:1.0.3'
compile 'com.microsoft.azure:azure-mobile-android:3.1.0'
compile 'com.mixpanel.android:mixpanel-android:4.8.0'
compile 'com.firebase:firebase-client-android:2.4.0'
compile 'com.google.firebase:firebase-core:16.0.0'
compile 'com.google.firebase:firebase-auth:16.0.1'
compile 'com.android.support:support-v4:23.4.0'
compile 'com.android.support:design:23.4.0'
compile 'com.j256.ormlite:ormlite-android:4.48'
compile 'com.j256.ormlite:ormlite-core:4.48'
compile 'com.android.support:recyclerview-v7:23.4.0'
compile 'com.github.tibolte:elasticdownload:1.0.+'
compile 'me.dm7.barcodescanner:zxing:1.8.4'
compile 'com.google.android.gms:play-services-vision:15.0.2'
compile 'com.android.support.constraint:constraint-layout:1.1.1'
compile 'com.github.amlcurran.showcaseview:library:5.4.3'
compile 'com.wang.avi:library:2.1.3'
testCompile 'junit:junit:4.12'
androidTestCompile 'com.jayway.android.robotium:robotium-solo:5.6.0'
androidTestCompile 'com.android.support.test:rules:1.0.2'
}
apply plugin: 'com.google.gms.google-services'
In my project level build.gradle:
dependencies {
classpath 'com.android.tools.build:gradle:2.2.2'
classpath 'com.google.gms:google-services:4.0.0'
}
The Error I am getting:
Could not find any version that matches com.google.android.gms:play-services-base:[15.0.1,16.0.0).
Make sure you have google() repository in project-level build.gradle before any others:
allprojects {
repositories {
google()
mavenLocal()
jcenter()
}
}
Add this line in build.gradle
apply plugin: 'com.google.gms.google-services'
// Work around for onesignal-gradle-plugin compatibility
com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true
or
googleServices.disableVersionCheck = true
I encountered the same issue after updating. Try to verify if you installed the latest Build Tool and Google Repository versions.
Also, verify the Project's build.gradle that you're using google() and the build tool version. After checking the build.gradle, try to re-sync, clean, and re-build your project.
If needed, try to update to the latest version of your project's dependencies.
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.3'
}
// ...
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
in my case i just update Andorid SDK Platform-Tools previous was 28.0.0 when i updated it to 28.0.1 problem fix!
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.google.firebase:firebase-database:16.0.1'
implementation 'com.google.android.gms:play-services-auth:16.0.1'
}
apply plugin: 'com.google.gms.google-services'
com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true
All of sudden with out any changes in my project I was getting below error.
ERROR: Unable to resolve dependency for ':app#debug/compileClasspath': Could not resolve com.google.android.gms:play-services-location:[15.0.0, 16.0.0).
In project level build.gradle
buildscript {
ext.kotlin_version = '1.3.21'
repositories {
google()
jcenter()
maven {
url 'https://dl.bintray.com/android/android-tools'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.2.0'
}
and
allprojects {
repositories {
google()
mavenCentral()
jcenter()
maven { url 'https://google.bintray.com/exoplayer/' }
}
}
with above settings I had no luck.
Below is what worked for me
I found that the problem is with onesignal
I added exclude clause to dependency:
implementation ('com.onesignal:OneSignal:3.10.5') {
exclude group: 'com.google.android.gms'
}
then added the missing dependencies manually.
After adding exclude clause I got Could not resolve com.google.firebase:firebase-messaging:[10.2.1, 12.1.0). If you find any other missing dependencies just do as I did below.
In the module level build.gradle I replaced
implementation 'com.google.firebase:firebase-messaging:17.4.0' with
implementation 'com.google.firebase:firebase-messaging:10.2.1'
and finally Build completed successfully. I wasted almost 5 hours on this. Hope this helps some one.
In my case everything was working fine, but suddenly I encountered this problem in the next "run action"!
Anyway, the problem is solved by updating com.google.gms:google-services in the project build.gradle file to its latest version as the below :
buildscript {
repositories {
jcenter()
mavenLocal()
mavenCentral()
maven {
url 'https://maven.google.com/'
name 'Google'
}
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.2'
classpath 'com.google.gms:google-services:4.3.0'
}
}
allprojects {
repositories {
jcenter()
maven { url 'https://maven.google.com' }
maven { url "https://jitpack.io" }
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Also, make sure that:
- You are not in offline mode.
- And if you are using Http Proxy, you can connect to the google repository.
Note (in the above sample):
Android Studio : 3.4.2
compileSdkVersion 28
targetSdkVersion 28
Build -> Clean Project
was enough in my special case (with gms:v15.0.1 and firebase:v16.0.1).
I solved this issue with this build.gradle [Proyect]
buildscript {
ext.kotlin_version = '1.2.30'
repositories {
google()
jcenter()
maven {
url 'https://dl.bintray.com/android/android-tools'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.2.0'
}
}
OPTION 1:
Follow the below instruction to resolve it.
Project-level build.gradle
use
maven { url "https://www.jitpack.io" }
instead of
maven { url "https://jitpack.io" }
OPTION 2:
Follow the below steps to resolve it.
Step1:
Project-level build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.google.gms:google-services:4.2.0' // google-services plugin
classpath 'com.android.tools.build:gradle:3.4.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
maven { url "http://dl.bintray.com/populov/maven" }
maven { url "https://jitpack.io" } // For Ucrop
maven { url "https://maven.google.com" } // Google's Maven repository - FCM
maven {
url 'https://dl.bintray.com/azeesoft/maven'
}
google()
jcenter()
mavenCentral()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Step2:
App-level build.gradle
I have update One Signal version.
use
implementation 'com.onesignal:OneSignal:3.11.1'
instead of
implementation 'com.onesignal:OneSignal:3.10.9'
Changing
implementation('com.onesignal:OneSignal:3.15.1')
with
implementation('com.onesignal:OneSignal:3.15.1') {
exclude group: 'com.android.support', module: 'customtabs'
exclude group: 'com.google.android.gms'
}
solved my problem.
Possible reasons would be
Internet not connected/work Offline not enabled from AndroidStudio Preference
Cached versions of dependancy not exists
Proxy enabled
Google Play Service Temporarily Unavailable
Solution :
Along with the above answers don't forget to add mavenLocal() inside project level build.gradle
allprojects {
repositories {
......
......
mavenLocal()
}
}
This helps to access cached dependencies when Service Temporarily Unavailable
This is what worked for me. In project-level Gradle file use the following order:
repositories {
google()
maven {
url 'https://maven.google.com/'
name 'Google'
}
jcenter()
}
allprojects {
repositories {
google()
mavenCentral()
maven {
url "https://jitpack.io"
}
jcenter()
}
}
i deleted every firebase plugin like:
firebase_core
cloud_firestore
firebase_dynamic_links
firebase_messaging
firebase_auth
from pubspec.yaml
and run pub get and flutter run
add packages again
run pub get and flutter run again
worked for me.
if not fixed, try packages one by one
go to build.gradle in android directory , insert
maven { url 'https://maven.google.com' }
in top position of repositories of allprojects same this :
allprojects {
repositories {
maven { url 'https://maven.google.com' } //<<--Insert this above google()
google()
Just run build with Internet Connected (it worked for me).

Failed to resolve: com.android.volley:volley:1.1.0 ....glide:3.7.0

'gradle' 'import' was done.
Then I got a problem. Help.
D:\bg.jou\GanggoContacts\build.gradle
Error:(25, 13)
Failed to resolve: com.android.volley:volley:1.1.0
Show in File<br>Show in Project Structure dialog
Error:(26, 13)
Failed to resolve: com.github.bumptech.glide:glide:3.7.0
Show in File<br>Show in Project Structure dialog
not complete problem
buildscript {
repositories {
jcenter()
mavenCentral()
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.google.gms:google-services:3.1.0'
}
}
dependencies {
//compile 'com.android.support:appcompat-v7:26.1.0'
compile 'com.android.support:appcompat-v7:22.0.0'
compile 'com.google.android.gms:play-services-gcm:11.8.0'
compile fileTree(include: '*.jar', dir: 'libs')
compile project(':fingerpush_3.0.7')
compile 'com.android.volley:volley:1.1.0'
compile 'com.github.bumptech.glide:glide:3.7.0'
}
jcenter() is now deprecated.
Use this in build.gradle of app:
'com.android.volley:volley:1.2.0'
And this in build.gradle:
repositories {
google()
mavenCentral()
}
One of the solutions below must solve your problem:
1- If you've added the following line in your "module/app" build.gradle,
compile 'com.android.volley:volley:1.1.0'
you need to have the following code in your "project" build.gradle in order to enable your programming environment to find and download volley package
allprojects {
repositories {
jcenter()
}
}
2- You are living in a country which is under U.S. and International sanctions and that's why your programming environment cannot connect automatically to jcenter(bintray.com) to download the library, even though you've added jcenter to your repo list. If so, you have to use a proxy while syncing gradle.
Add this snippet to your build.gradle file,
allprojects {
repositories {
google()
jcenter()
}
}
and replace with this -
buildscript {
repositories {
google() // Just google() will be fine
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.google.gms:google-services:3.1.0'
}
}
If, you are using gradle version lower than 4.1 - replace
google() with
maven {
url 'https://maven.google.com'
}
you probably need to force the project to use the latest version of volley

Failed to resolve com.android.support:support-annotations 26.0.1

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.3.1'
compile 'com.android.support:design:25.3.1'
testCompile 'junit:junit:4.12'
// ButterKnife
compile 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
// Parse SDK
compile 'com.parse:parse-android:1.16.0'
}
This is my app gradle dependencies. I don't know what to do to resolve it. I've tried installed from SDK Manager Android SDK Build Tools 26.0.1, and I also have latest version of Android support.
All current editions of Google libraries reside in Google's Maven repository (maven.google.com), not in the old offline-capable support repositories.
In your project-level build.gradle file, make sure that your allprojects closure looks like this:
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}
or, on Android Studio 3.0+, like this:
allprojects {
repositories {
jcenter()
google()
}
}
Even with Android Studio 3.0.+, I had to add this below (not just google()
like #CommonsWare recommended), to get pass the error
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}
I resolved this issue by adding the below in project level build.gradle file.
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
// 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'
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
I had this error:
ERROR: Failed to resolve: support-annotations
For fix it open gradle.properties file and add
android.enableJetifier=true
#this line must be too:
android.useAndroidX=true

Categories

Resources