Android gradle sync issue - android

This app was running perfectly OK without any issue. Suddenly i saw this gradle sync problems.I'm really stuck and need help. What to do now? I've uninstalled and reinstalled android support repository from SDK manager.
C:\Users\DELL\AndroidStudioProjects\Prokriti\app\build.gradle
Error:Error:Failed to resolve: com.android.support:support-annotations:27.0.1
Install Repository and sync project
Error:Error:Failed to resolve: com.android.support:appcompat-v7:27.0.1
Install Repository and sync project
Error:Error:Failed to resolve: com.android.support:customtabs:27.0.1
Install Repository and sync project
Error:Error:Failed to resolve: com.android.support:cardview-v7:27.0.1
Install Repository and sync project
Error:Error:Failed to resolve: com.android.support:support-v4:27.0.1
Install Repository and sync project
Error:Error:Failed to resolve: com.android.support:support-core-utils:27.0.1
Install Repository and sync project
build.gradle (app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "26.0.1"
defaultConfig {
applicationId "com.avtro.prokriti.prokriti"
minSdkVersion 16
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled true
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'
})
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:cardview-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support:support-core-utils:25.3.1'
compile 'com.android.support:support-annotations:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.google.android.gms:play-services-auth:11.0.4'
compile 'com.google.firebase:firebase-core:11.0.2'
compile 'com.google.firebase:firebase-messaging:11.0.2'
compile 'com.google.firebase:firebase-database:11.0.2'
compile 'com.google.firebase:firebase-auth:11.0.2'
compile 'com.google.firebase:firebase-ads:11.0.2'
compile 'com.afollestad.material-dialogs:core:0.9.4.5'
compile 'com.wang.avi:library:2.1.3'
compile 'com.google.android.gms:play-services-ads:11.0.4'
compile 'de.hdodenhof:circleimageview:2.1.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.survivingwithandroid:weatherlib:1.6.0'
compile 'com.amitshekhar.android:android-networking:1.0.0'
compile 'com.android.support:multidex:1.0.1'
compile 'com.squareup.okhttp:okhttp:2.0.0'
compile 'com.facebook.android:facebook-android-sdk:[4,5)'
compile 'com.google.firebase:firebase-storage:11.0.2'
androidTestCompile 'junit:junit:4.12'
compile 'javax.inject:javax.inject:1'
compile 'com.android.support:support-v4:25.3.1'
compile 'com.github.bumptech.glide:glide:3.8.0'
}
apply plugin: 'com.google.gms.google-services'
build.gradle (project)
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.google.gms:google-services:3.0.0'
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
i didnt update android studio or gradle. Android support repository is installed.

I solve the problem by removing
compile 'com.facebook.android:facebook-android-sdk:[4,5)'
And adding
compile 'com.facebook.android:facebook-android-sdk:4.26.0'

You need to change only one line.
Fixed by updating facebook sdk version
from
compile 'com.facebook.android:facebook-android-sdk:[4,5)'
to
compile 'com.facebook.android:facebook-android-sdk:4.26.0'

'com.facebook.android:facebook-android-sdk:[4,5)'
or
'com.facebook.android:facebook-android-sdk:4.+'
above replace with below
'com.facebook.android:facebook-android-sdk:4.26.0'

Replace
compile 'com.facebook.android:facebook-android-sdk:[4,5)'
by
compile 'com.facebook.android:facebook-android-sdk:4.26.0'
hope it will work

Add google() in buildscript.repositories and allprojects.repositories :
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.google.gms:google-services:3.0.0'
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
This should solve your problem.

Its work for me
Its work for me
Update Android SDK Build -Tools and SDK platforms
Changed in project build file.
buildscript {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}
changed in app build file
compileSdkVersion 26
buildToolsVersion "26.0.2"
Disable dependencies inspection.
compile 'com.android.support:design:25.3.1

use this
repositories {
maven { url 'https://maven.google.com/' }
}

For react-native projects: Add maven repo to your project. (Removes react-native-fbsdk error after adding maven repo links).
buildscript {
repositories {
jcenter()
mavenCentral()
maven { // Add this block
url "https://maven.google.com"
}
}
}
allprojects {
repositories {
mavenLocal()
jcenter()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
// If something is not found from above maven repo.
maven { url 'https://maven.google.com' } // Add this block
}
}
More Info here

Don't
compile 'com.facebook.android:facebook-android-sdk:[4,5)'
According to Facebook SDK for Android, You should use
// Facebook Android SDK (everything)
compile 'com.facebook.android:facebook-android-sdk:4.+'
for updated case read Changelog and release notes for the Facebook SDK for Android.
compile 'com.facebook.android:facebook-android-sdk:4.26.0'
compile 'com.facebook.android:facebook-android-sdk:4.27.0'
compile 'com.facebook.android:facebook-android-sdk:4.28.0'
compile 'com.facebook.android:facebook-android-sdk:4.29.0'

Related

Error:Failed to resolve: support-vector-drawable

I have a problem with gradle. it was working fine but all of sudden when I was rebuilding the project it gives me this error:
Error:Failed to resolve: support-vector-drawable
I can't find out what my problem is?
My app.gradle
buildscript {
repositories {
maven { url 'https://plugins.gradle.org/m2/' }
}
dependencies {
classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:0.8.1'
}
}
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
repositories {
maven { url 'https://maven.google.com' }
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
android {
compileSdkVersion 26
buildToolsVersion '26.0.2'
defaultConfig {
applicationId "com.arizeh.arizeh"
minSdkVersion 17
targetSdkVersion 22
multiDexEnabled true
versionCode 29
versionName "3.0.5"
useLibrary 'org.apache.http.legacy'
testInstrumentationRunner
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility 1.8
targetCompatibility 1.8
}
}
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 'com.google.android.gms:play-services-maps:15.0.1'
compile 'com.google.android.gms:play-services-places:15.0.1'
compile 'com.google.android.gms:play-services-location:15.0.1'
compile 'com.google.android.gms:play-services-gcm:15.0.1'
compile 'com.google.android.gms:play-services-base:15.0.1'
compile 'com.google.firebase:firebase-messaging:15.0.2'
compile 'com.android.support:design:26.1.0'
compile 'com.android.support:cardview-v7:26.1.0'
compile 'uk.co.chrisjenx:calligraphy:2.1.0'
compile 'com.google.code.gson:gson:2.8.0'
compile 'com.koushikdutta.ion:ion:2.+'
compile 'com.android.support:percent:26.1.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.shawnlin:number-picker:2.4.2'
compile 'com.astuetz:pagerslidingtabstrip:1.0.1'
compile 'com.android.support:multidex:1.0.2'
compile 'com.android.support:support-compat:26.1.0'
compile 'com.daimajia.easing:library:2.0#aar'
compile 'com.daimajia.androidanimations:library:2.2#aar'
compile 'com.zarinpal:purchase:0.0.3-beta'
compile 'com.squareup.retrofit2:retrofit:2.3.0'
compile 'com.squareup.retrofit2:converter-gson:2.3.0'
}
In my case, I've moved the Google repo on the top in the build.gradle config:
allprojects {
repositories {
google() // now here
mavenLocal()
jcenter()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
// google() // was here
}
}
Add vectorDrawables.useSupportLibrary = true in defaultConfig
defaultConfig {
vectorDrawables.useSupportLibrary = true
}
If an error still persists then
allprojects {
repositories {
google() // make it first element
jcenter()
maven { url 'https://maven.google.com' }
}
}
I just encountered this error along with some others:
Failed to resolve: support-vector-drawable
Failed to resolve: livedata-core
Failed to resolve: common
Failed to resolve: runtime
Failed to resolve: viewmodel
Failed to resolve: monitor
I'm not using React Native but found the answer on there:
In android/build.gradle move the jcenter() to the bottom:
allprojects {
repositories {
google()
maven {
url 'https://maven.google.com/'
}
jcenter()
}
}
I faced this error on androidx project and solved it with:
1- in Build.gradle (Module file), android{} section add:
vectorDrawables.useSupportLibrary = true
2- in dependencies {} section,
change :
implementation 'androidx.vectordrawable:vectordrawable:1.0.1'
to update version:
implementation 'androidx.vectordrawable:vectordrawable:1.1.0-beta02'
compile again.
I had the same problem. you must change build.gradle to
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenCentral()
maven { url 'https://maven.google.com' }
google()
jcenter()
maven { url 'https://jitpack.io' }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
I had the same problem.
Resolved it via raising the version of v7 Support Libraries:
implementation 'com.android.support:appcompat-v7:28.0.0'
i have tried enough and getting the same issue as in screen shot and finally got success.
my code was like this..
so after searching enough i solved it by adding maven in my gradle file..
its solved then..
You should add this to build.gradle(module: app)
implementation 'com.android.support:support-vector-drawable:28.0.0'
I try many but only this decoration help me to sync the Gradle,
Hope this one help yours
repositories {
mavenLocal()
google()
jcenter()
}
And actually add this line to defaultConfig of app module :
vectorDrawables.useSupportLibrary = true

Error:Failed to find Build Tools revision 26.0.2

i know the title of this error may seem familiar , but beilive me I have done every thing to solve the problem , but I failed every time! so please help me!
i dowloaded a code for and online shop app , i tried to run it in android studio but following error has occurred:
Error:Failed to find Build Tools revision 26.0.2
"install.build.tools">Install Build Tools 26.0.2 and sync project
now here is what i did :
at first i was using android studio v 2.3
i checked sdk manager and every thing was installed ,
to resolve the problem i tried updating it to latest version (v 3.0.1)
and I manually instaled sdk 26 and tools_26.0.2
but error wouldnt go away!! :((
here is the code for my build.gradle for a closer look :
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.2"
defaultConfig {
applicationId "ir.tameshki.zanbil"
minSdkVersion 14
targetSdkVersion 26
versionCode 2
versionName "1.1.1"
}
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'
})
testCompile 'junit:junit:4.12'
// library for user interface
compile 'com.android.support:appcompat-v7:26.0.2'
compile 'com.android.support:cardview-v7:26.0.2'
compile 'com.android.support:recyclerview-v7:26.0.2'
compile 'com.android.support:design:26.0.2'
compile 'com.android.support:support-v4:26.0.2'
compile 'com.balysv:material-ripple:1.0.2'
// library for api
compile 'com.squareup.retrofit2:retrofit:2.1.0'
compile 'com.squareup.okhttp3:logging-interceptor:3.3.1'
compile 'com.squareup.retrofit2:converter-gson:2.1.0'
compile 'com.google.code.gson:gson:2.4'
// glide image loader
compile 'com.github.bumptech.glide:glide:3.7.0'
// firebase notification library
compile 'com.google.firebase:firebase-messaging:9.2.1'
// firebase ads library
compile 'com.google.firebase:firebase-ads:9.2.1'
compile 'uk.co.chrisjenx:calligraphy:2.3.0'
}
apply plugin: 'com.google.gms.google-services'
and my other gradle file :
// Top-level build file where you can add configuration options common to
all sub-projects/modules.
buildscript {
repositories {
jcenter()
maven { url "https://jitpack.io" }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
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 {
google()
jcenter()
maven { url "https://jitpack.io" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}

Android. Firebase: Could not parse the Android Application module

My build.gradle:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.1.3-2'
ext.realm_version = '3.7.2'
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.google.gms:google-services:3.1.0'
classpath "io.realm:realm-gradle-plugin:$realm_version"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// 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" }
maven { url 'https://dl.bintray.com/jetbrains/anko' }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
repositories {
mavenCentral()
}
My app/build.gradle
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-android'
apply plugin: 'io.fabric'
apply plugin: 'realm-android'
realm {
syncEnabled = true;
}
repositories {
maven { url 'https://maven.fabric.io/public' }
mavenCentral()
}
android {
compileSdkVersion 26
buildToolsVersion "25.0.3"
dexOptions {
jumboMode = true
}
defaultConfig {
applicationId "com.my.project"
minSdkVersion 15
targetSdkVersion 23
versionCode 54
versionName "1.3.54"
multiDexEnabled true
}
}
def AAVersion = '4.3.1'
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:26.1.0'
compile('com.crashlytics.sdk.android:crashlytics:2.6.0#aar') {
transitive = true;
}
compile('com.digits.sdk.android:digits:1.11.0#aar') {
transitive = true;
}
compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.volley:volley:1.0.0'
compile 'com.baoyz.swipemenulistview:library:1.3.0'
compile 'com.google.android.gms:play-services-gcm:11.0.4'
compile 'com.google.code.gson:gson:2.7'
compile 'com.miguelcatalan:materialsearchview:1.4.0'
compile 'com.squareup.okhttp:okhttp-urlconnection:2.7.3'
compile 'com.squareup.okhttp:okhttp:2.7.3'
compile 'com.theartofdev.edmodo:android-image-cropper:2.2.5'
compile 'commons-codec:commons-codec:1.9'
compile 'commons-io:commons-io:2.4'
compile 'io.realm:android-adapters:2.0.0'
compile 'org.apache.commons:commons-lang3:3.4'
compile 'org.apache.httpcomponents:httpcore:4.4.4'
compile 'org.apache.httpcomponents:httpmime:4.3.6'
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
compile 'us.feras.mdv:markdownview:1.1.0'
compile 'org.jetbrains.anko:anko-sdk15:0.9.1'
compile "org.androidannotations:androidannotations-api:$AAVersion"
// for annotaions
kapt "io.realm:realm-android-library:$realm_version"
kapt "org.androidannotations:androidannotations:$AAVersion"
compile 'com.firebaseui:firebase-ui-auth:2.3.0'
compile 'com.google.firebase:firebase-auth:11.0.4'
compile "com.android.support:design:26.1.0"
compile "com.android.support:customtabs:26.1.0"
compile "com.android.support:cardview-v7:26.1.0"
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
When I build I get error:
Error:Execution failed for task ':app:processDevGoogleServices'.
> File google-services.json is missing. The Google Services Plugin cannot function without it.
Searched Location:
com\my_project\app\src\dev\google-services.json
com\my_project\\app\google-services.json
OK.In Android Studio select menu: Tools->Friebase
Firebase-> Authentification
Click on Email and password authentification
Connect to your app to Firebase
and get error:
Could not parse the Android Application module
I've just resolve this problem.
I was upgrading the old GCM to FCM, and the Firebase Assistant shows the same error message as yours.
Solved by:
Go to Firebase console, in the Settings of my project, download google-servics.json to app/ folder. (Replace my old GCM's json file)
doing Add Firebase to your app again,
Then I can use the Firebase Assistans of AndroidStudio, again.
For me, the issue was classpath 'com.google.gms:google-services:4.3.0' was giving error, then I changed to classpath 'com.google.gms:google-services:4.2.0', resync'd Project with Gradle Files', then pressed Connect to firebase, :D
You might want to try 'Sync Project with Gradle Files'.
Sometimes I forget to sync the implementations after adding them to the gradle file.

How to compile play-services:11.2.0 [duplicate]

This question already has answers here:
Failed to resolve: com.android.support:cardview-v7:26.0.0 android
(26 answers)
Failed to resolve: com.google.firebase:firebase-core:11.2.0
(6 answers)
Failed to resolve com.google.android.gms play-services-auth:11.4.0
(13 answers)
Closed 5 years ago.
I want to get current place of my device, and I follow this link:google
And this tutorial requires Google Play services version 11.2.0 or later.
But when I compile 'com.google.android.gms:play-services:11.2.0', I get :
Error:(26, 13) Failed to resolve: com.android.support:appcompat-v7:26.0.0
here is my build.gradle(Module:app):
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.1"
defaultConfig {
applicationId "com.example.administrator.googlemap"
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'
}
}
}
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.google.android.gms:play-services:11.2.0'
compile 'com.google.android.gms:play-services-maps:11.0.2'
compile 'com.google.android.gms:play-services-places:11.0.2'
compile 'com.google.android.gms:play-services-location:11.0.2'
testCompile 'junit:junit:4.12'
}
And here is my build.grandle(Project)
buildscript {
repositories {
jcenter()
maven { url "https://maven.google.com/"}
}
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 {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
How can I resolve this Error.?
Instead of variable version name
compile 'com.android.support:appcompat-v7:26.+'
Use constant version, latest is 26.1.0
compile 'com.android.support:appcompat-v7:26.1.0'
You've google maven repo link in buildscript repository list, You should also add google maven repo in project dependencies repository list of your root build.gradle file
allprojects {
repositories {
jcenter()
maven { url "https://maven.google.com/"}
}
}
Selective compile is better option instead of complete play-services artifacts, you should choose what you needed in your project.
compile 'com.google.android.gms:play-services:11.2.0' // -> latest is 11.4.0
break it into your required artifact, like
compile 'com.google.android.gms:play-services-maps:11.4.0'
compile 'com.google.android.gms:play-services-places:11.4.0'
compile 'com.google.android.gms:play-services-location:11.4.0'
If you're using Android Plugin for Gradle 3.0.0 or latter version
repositories {
mavenLocal()
mavenCentral()
google() //---> Add this
}
replace compile with implementation, More about this replacement here
Add
maven {
url 'https://maven.google.com'
}
in your build.gradle, ie,
allprojects {
repositories {
jcenter()
maven {
url 'https://maven.google.com'
}
}
}
And also remove other google dependencies if you use play service 11.2.0
compile 'com.google.android.gms:play-services:11.2.0'
compile 'com.google.android.gms:play-services-maps:11.0.2'
compile 'com.google.android.gms:play-services-places:11.0.2'
compile 'com.google.android.gms:play-services-location:11.0.2'
to
compile 'com.google.android.gms:play-services:11.2.0'

Cannot install Support repository and sync project in Android Studio

I am trying to use the support libraries of version 25.2.0
so I will be able to use the CameraKit library.
I have got the newest build tools downloaded:
and the support repository:
my gradle file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion '25.0.2'
defaultConfig {
applicationId "com.sample.myapp"
minSdkVersion 21
targetSdkVersion 25
versionCode 1
versionName "1.1"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
repositories {
maven {
url "https://jitpack.io"
}
mavenCentral()
}
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'
})
testCompile 'junit:junit:4.12'
// Google libraries
compile 'com.android.support:appcompat-v7:25.2.0'
compile 'com.android.support:design:25.2.0'
compile 'com.android.support:support-v4:25.2.0'
compile 'com.google.android.gms:play-services-vision:10.0.1'
compile 'com.android.volley:volley:1.0.0'
// Third party libraries
compile 'com.flurgle:camerakit:0.9.17'
compile 'com.android.support:recyclerview-v7:25.2.0'
compile 'com.android.support:cardview-v7:25.2.0'
}
Problem:
For each support-library I get the issue:
Failed to resolve com.android.support:cardview-v7:25.2.0
If I try to click on Install repository and sync project nothing happens.
I have followed that gradle file as an example. Were could be my mistake?
Previously the Android Support Library dependencies were downloaded from Android SDK Manager.
Now all the new versions are available from Google's Maven repository.
In future all android libraries will be distributed through maven.google.com
So, by adding the below code to the repositories will build the project.
repositories {
maven {
url "https://maven.google.com"
}
}
I had to add the following to my project level build.gradle. Then the button to install and worked.
allprojects {
repositories {
maven {
url "https://maven.google.com"
}
jcenter()
}
}
Try using the latest support library versions:
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:support-v4:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.google.android.gms:play-services-vision:10.2.1'
compile 'com.android.volley:volley:1.0.0'
// Third party libraries
compile 'com.flurgle:camerakit:0.9.17'
compile 'com.android.support:recyclerview-v7:25.3.1'
compile 'com.android.support:cardview-v7:25.3.1'
here is the detail Dependencies
EDIT
Use Google Maven Repository
To add them to your build, you need to first include Google's Maven repository in your top-level build.gradle file:
Project -- build.gradle (Not app build.gradle)
allprojects {
repositories {
// If you're using a version of Gradle lower than 4.1, you must instead use:
maven {
url 'https://maven.google.com'
}
// An alternative URL is 'https://dl.google.com/dl/android/maven2/'
jcenter()
}
}
Make sure to put it under allprojects! My mistake was to put it under buildscript.
DON'T DO THIS:
buildscript {
repositories {
jcenter()
maven {
url 'https://maven.google.com' //don't put it here
}
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
}
}
BUT INSTEAD DO THIS:
allprojects {
repositories {
jcenter()
maven {
url 'https://maven.google.com' //put it here
}
}
}

Categories

Resources