Failed to resolve libraries: Android Studio 2.2.3 - android

I am getting the following errors and the gradle build fails:
Failed to resolve: com.facebook.android:facebook-android-sdk:4.+
Failed to resolve: de.hdodenhof:circleimageview:1.3.0
Failed to resolve: com.viewpagerindicator:library:2.4.1
I have looked thorough almost all the solutions present on stackoverflow but nothing seems to work for me.
dependencies {
compile 'com.viewpagerindicator:library:2.4.1'
compile 'com.facebook.android:facebook-android-sdk:4.+'
compile 'de.hdodenhof:circleimageview:1.3.0'
}
repositories {
mavenCentral()
}
android {
compileSdkVersion 23
buildToolsVersion "24.0.2"
}
Can anyone help me please?

In project of android studio -> Open Module Settings -> tab dependency -> add item -> find valid version of library

Related

Failed to resolve dependencies: com.squareup.retrofit2:retrofit:2.3.0

compile 'com.squareup.retrofit2:retrofit:2.3.0'
compile 'com.squareup.retrofit2:converter-gson:2.3.0'
I am getting this error
Failed to resolve: com.squareup.retrofit2:retrofit:2.3.0
Failed to resolve: com.squareup.retrofit2:converter-gson:2.3.0
I am using Android studio 3.1.3
I am adding these dependencies in the project i pulled from git
Try adding the following block in your build.gradle file
repositories
{
jcenter()
google()
}
Make sure that your android version is 2.3 and above and use like this
also check the update for java file
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
implementation 'com.google.code.gson:gson:2.8.4'

Error:(23, 13) Failed to resolve: com.google.android.gms:play-services:11.2.0 "Install Repository and sync project" dose not work

I am trying to get location and update to server in my Android app.
This is my Gradle code, here I included compile 'com.google.android.gms:play-services:11.2.0'. This line is from the documentation:
dependencies {
compile 'com.google.android.gms:play-services:11.2.0'
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:support-v4:25.3.1'
}
But this is the error I get:
Error:(23, 13) Failed to resolve: com.google.android.gms:play-services:11.2.0
Install Repository and sync project
Show in File
Show in Project Structure dialog
Clicking in "Install Repository and sync project" doesn't work.
Add this to your project-level build.gradle file:
repositories {
maven {
url "https://maven.google.com"
}
}
Try update version new of google play service
Start Android Studio.
On the Tools menu, click Android > SDK Manager.
Update the Android Studio SDK Manager: click SDK Tools, expand Support
Repository, select Google Repository, and then click OK.
In build.gradle file:
repositories {
maven {
url "https://maven.google.com"
}
}
Same problem and more solution here
Error:(39, 13) Failed to resolve: com.android.support:appcompat-v7:26.0.0

Android studio default project fails: Error:Failed to resolve: com.android.support:support-v4:25.2.0

I am literally just starting app development for the first time and the default project when I create a new one will not build. I have tried looking on Google and SO for these errors and have found some but their solutions do not work. Given that I have not edited the files at all, I presume it is an issue with Android Studio not being setup properly but can't figure it out. The errors are as follows:
Error:Failed to resolve: com.android.support:support-v4:25.2.0
Install Repository and sync project
Open File
Show in Project Structure dialog
Error:(23, 24) Failed to resolve: com.android.support.test.espresso:espresso-core:2.2.2
Install Repository and sync project
Show in File
Show in Project Structure dialog
Error:(26, 13) Failed to resolve: com.android.support:appcompat-v7:26.+
Install Repository and sync project
Show in File
Show in Project Structure dialog
The build.gradle file it points to is as follows:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.0"
defaultConfig {
applicationId "com.extremecomputing.spotzz"
minSdkVersion 17
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-maps:11.0.1'
testCompile 'junit:junit:4.12'
}
I have tried with a previous project that I had created a few things I found online. Such as they had recommended the + in the version could cause unpredictable builds, but that wasn't it. One had recommended a few compile lines in the dependencies section, it changed the errors for a moment saying I needed to download something, I did then it went back to the original errors. I also have tried to make sure that the SDK tools are updated, and they appear to be. Any suggestions would be greatly appreciated.
Please be noted that support library from revision 25.4.0 to the latest, we need to add google maven. As in the release note says:
Important: The support libraries are now available through Google's
Maven repository. You do not need to download the support repository
from the SDK Manager. For more information, see Support Library Setup.
So you need to add the google maven to your root build.gradle like this:
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}
Read more at Support Library Setup.
Try this:
in Android Studio, open Tools -> Android -> SDK Manager
under tab "SDK Tools" un-check the libraries causing problems
click "apply" to uninstall them
re-check the same libraries click "apply" to reinstall them
close SDK Manager and run Gradle sync / build
I had the same problem and it was due of an interference with another library.
In my case I had to comment:
compile 'com.onesignal:OneSignal:[3.5.3,4.0.0)
Now it builds

google play service error

I got this below error
Error:(1, 1) A problem occurred evaluating project ':app'.
> Failed to apply plugin [id 'com.android.application']
> Gradle version 2.10 is required. Current version is 2.8. If using the gradle wrapper, try editing the distributionUrl in C:\Users\TARUN\Desktop\GingerBuds\gradle\wrapper\gradle-wrapper.properties to gradle-2.10-all.zip
Then I changed the above gradle path, Then following problem occurred,
I am getting this exception, while building my project . I rebuild and clean the project and updated google-play-services , then also i got error. can anyone please help me how to solve this.
Error:Execution failed for task ':app:compileDebugJavaWithJavac'.
java.io.FileNotFoundException: C:\Users\TARUN\Desktop\Gingerbuds\app\build\intermediates\exploded-aar\com.google.android.gms\play-services\8.4.0\jars\classes.jar (The system cannot find the path specified)
Build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.kitchenvilla.gingerbuds"
minSdkVersion 15
targetSdkVersion 23
versionCode 24
versionName "1.2.2"
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
android {
useLibrary 'org.apache.http.legacy'
}
android {
publishNonDefault true
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:recyclerview-v7:23.0.0'
compile 'com.mcxiaoke.volley:library:1.0.15'
compile 'org.apmem.tools:layouts:1.10#aar'
compile 'com.android.support:appcompat-v7:23.0.0'
compile 'com.android.support:design:23.0.0'
compile 'com.google.android.gms:play-services-maps:8.4.0'
compile 'com.google.android.gms:play-services:8.4.0'
compile 'com.android.support:support-v4:23.0.0'
compile 'com.pkmmte.view:circularimageview:1.1'
compile 'com.squareup.picasso:picasso:2.3.2'
compile 'com.facebook.android:facebook-android-sdk:4.7.0'
}
This bug has been fixed according to Google dev blog: http://tools.android.com/tech-docs/new-build-system
2.0.0-alpha6 (2016/1/15)
Instant Run
Fix alpha5 reported issues :
- cannot build when importing play-services.
You should update android gradle tools version
dependencies {
classpath 'com.android.tools.build:gradle:2.0.0-alpha6'
}
This exception is thrown during a failed attempt to open the file denoted by a specified Path-name.
You can use
compile 'com.google.android.gms:play-services:8.3.0'
Update your classpath
classpath 'com.android.tools.build:gradle:2.0.0-alpha2'
this will solve it
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
classpath 'com.google.gms:google-services:2.0.0-alpha2'
}
and
compile 'com.google.android.gms:play-services:8.3.0'
update gradle version to alpha9 in project level gradle file
classpath 'com.android.tools.build:gradle:2.0.0-alpha9'
i tried to import admob ads to a new app i was making and i ran into this problem...... i found the solution the be the StartAppInApp file being located in the wrong spot or not being there..... my app needed the StartAppInApp-3.1.1.jar file to be located in the libs folder and when i looked at my app there was no libs folder located there at all .....
open your main app folder... then click app and you should have 3 folders.... src ... build.... and libs .....
in my case there was no libs folder..... so i created the libs folder and then went and copied the StartAppInApp-3.1.1.jar file from a different android project i had and i pasted it to the new libs folder i made in my current project... the error is now GONE!
i also made sure to include
compile files('libs/StartAppInApp-3.1.1.jar')
in the dependencies of my app gradle file
not sure if this is a solid answer but if anyone has this problem double check your StartAppInApp-3.1.1.jar location and version and check your gradle dependencies

Android Studio 1.3 will not work with jcenter() Android Repository

Project build.gradle
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.2.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
Module build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "23.0.0 rc3"
defaultConfig {
applicationId "com.example.mark.god_dam_supportlib"
minSdkVersion 15
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v21:22.2.1'
compile 'com.android.support:appcompat-v7:22.2.1'
}
tried:
Putting the URL for bintray in the jcenter()
.
Disable offline mode
Made sure jcenter was in Project Structure - > Project - > [Android Plugin Repository && Default Library Repository].
Toggled disable offline mode.
Removed and reinstalled Android Support Repository,
Android Support Library (many times).
No network proxy.
Set the .gradle to 777.
No Matter what get on a gradle sync:
Error:(25, 13) Failed to resolve: com.android.support:appcompat-v21:22.2.1
Install Repository and sync projectShow in FileShow in Project Structure dialog
Click on “ Install Repository and sync project”
Error message in the “Install Missing Components” dialog:
Loading SDK information...
Ignoring unknown package filter 'extra-android-m2repository'Warning: The package filter removed all packages. There is nothing to install.
Please consider trying to update again without a package filter.
As well in red at the bottom of “Install Missing Components” dialog”
Imstailed Failed: Please check your network conection and try again. You may continue creating your project, but it will not compile correctly without the missing components
On a Gradle build get:
Error:A problem occurred configuring project ':app'.
Could not resolve all dependencies for configuration ':app:_debugCompile'.
Could not find com.android.support:appcompat-v21:22.2.1.
Searched in the following locations:
https://jcenter.bintray.com/com/android/support/appcompat-v21/22.2.1/appcompat-v21-22.2.1.pom
https://jcenter.bintray.com/com/android/support/appcompat-v21/22.2.1/appcompat-v21-22.2.1.jar
file:/home/usr/Android/Sdk/extras/android/m2repository/com/android/support/appcompat-v21/22.2.1/appcompat-v21-22.2.1.pom
file:/home/usr/Android/Sdk/extras/android/m2repository/com/android/support/appcompat-v21/22.2.1/appcompat-v21-22.2.1.jar
file:/home/usr/Android/Sdk/extras/google/m2repository/com/android/support/appcompat-v21/22.2.1/appcompat-v21-22.2.1.pom
file:/home/usr/Android/Sdk/extras/google/m2repository/com/android/support/appcompat-v21/22.2.1/appcompat-v21-22.2.1.jar
Required by:
Name_ofApp_folder:app:unspecified
Checked Google, Stack Over Flow.
Box is an Ubuntu 14.04 LTS straight up desktop.
Went as far as trying to down load the Android Support Repository manually could find a download page.
As An Aside used these “ Android Support Repository” first quarter of the year with out any grief (need to update one!).
Completely and totally out of ideas and getting dangerously low on patience as well
Failed to resolve: com.android.support:appcompat-v21:22.2.1 Install Repository and sync project
That is because there is no artifact named com.android.support:appcompat-v21. It is called com.android.support:appcompat-v7, and you already have a compile statement for it. Delete the compile statement for com.android.support:appcompat-v21.
Note that none of this has anything to do with JCenter, despite your question title.

Categories

Resources