Error:Failed to resolve: com.google.android.gms - android

Error:Failed to resolve: com.google.android.gms:play-services-basement:[11.0.4]
Error:Failed to resolve: com.google.android.gms:play-services-tasks:[11.0.4]
When i used android studio 2.3.2 version my project build successfully but after updated to android studio version to 2.3.3 and updated google play services i am getting this error please help.
There is no play-services-basement and play-services-tasks folder in my folder
when i comment this "compile 'com.google.android.gms:play-services-location:11.0.4'" line my project compiling fine if i uncomment then my project not compiling
Project Gradle file:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
}
}
allprojects {
buildDir = "C:/tmp/${rootProject.name}/${project.name}"
repositories {
jcenter()
}
}
ext {
compileSdkVersion = 25
buildToolsVersion = "25.0.2"
supportLibVersion = "25.3.1"
minSdkVersion = 14
targetSdkVersion = 25
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Module Gradle file:
apply plugin: 'com.android.application'
android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "package"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
debug {
debuggable true
}
}
lintOptions {
checkReleaseBuilds false
abortOnError false
}
}
repositories {
jcenter {
url "http://jcenter.bintray.com/"
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
compile "com.android.support:support-v4:${rootProject.ext.supportLibVersion}"
compile "com.android.support:design:${rootProject.ext.supportLibVersion}"
compile "com.android.support:recyclerview-v7:${rootProject.ext.supportLibVersion}"
compile 'com.google.android.gms:play-services-location:11.0.4'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'de.hdodenhof:circleimageview:2.1.0'
compile 'com.github.beyka:androidtiffbitmapfactory:0.9.6.2'
debugCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5'
releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5'
}

project gradle file:
buildscript {
repositories {
jcenter()
maven {
url 'https://maven.google.com'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
}
}
allprojects {
buildDir = "C:/tmp/${rootProject.name}/${project.name}"
repositories {
jcenter()
maven {
url 'https://maven.google.com'
}
}
}

Related

failed to resolve junit:junit:4.12

i am using studio 2.0 every time in new project it shows error(26,17) failed to resolve junit:junit:4.12.
after reading on stackover flow i added repository in build.gradle
but it still not work for me.
here is code:
(project:myapplication)
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
//jcenter{url 'http://jcenter.bintray.com/'}
}
dependencies {
classpath 'com.android.tools.build:gradle:2.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}}
repositories{
maven{url 'http://repo1.maven.org/maven2'}
jcenter { url 'http://jcenter.bintray.com/' }}
allprojects {
repositories {
jcenter()
// jcenter{url 'http://jcenter.bintray.com/'}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
(module:app)
apply plugin: 'com.android.application'
repositories{
maven{url 'http://repo1.maven.org/maven2'}
jcenter { url 'http://jcenter.bintray.com/' }
}
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "com.example.akshay.myapplication"
minSdkVersion 17
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.2.1'
compile 'com.android.support:design:23.1.1'
}

Don't working the library from GitHub in Android Studio

Don't working this library from GitHub in Android Studio
My build.gradle(:project):
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.example.mymaterialdialogs"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.0.1'
compile('com.afollestad.material-dialogs:core:0.8.4.2#aar') {
transitive = true
}
}
And My build.gradle(:app):
buildscript {
repositories {
maven { url "https://jitpack.io" }
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.0'
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Show this Error:
Error:(26, 13) Failed to resolve:
com.afollestad.material-dialogs:core:0.8.4.2 Show in
File(openFile:.../app/build.gradle)Show in Project Structure
dialog(open.dependency.in.project.structure)
Do the following steps:
1.In your build.gradle(:project) Add the following before dependencies
repositories {
maven { url "https://jitpack.io" }
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.0.1'
compile('com.afollestad.material-dialogs:core:0.8.4.2#aar') {
transitive = true
}
}
2.In your build.gradle(:app): replace
maven { url "https://jitpack.io" } with jcenter()
3.Sync project
Hope this helps.

issue to add a repository from android arsenal

I am trying to add a PinnedSectionListView from android arsenal.
the way to add say:
Add the specific repository to your build file:
repositories {
maven {
url "https://jitpack.io"
}
}
Add the dependency in your build file (do not forget to specify the correct qualifier, usually 'aar'):
dependencies {
compile 'com.github.beworker:pinned-section-listview:v1.0'
}
so i did that (build.gradle (Project)):
buildscript {
repositories {
jcenter()
maven {
url "https://jitpack.io"
}
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven {
url "https://jitpack.io"
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
build.gradle (Module): apply plugin: 'com.android.application'
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.example.jonathandg.listviewsections"
minSdkVersion 16
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.0'
compile 'com.beworker:pinned-section-listview:v1.0#aar'
//compile 'com.beworker:pinned-section-listview:v1.0'
}
then the android studio message is
Error:(25, 13) Failed to resolve: com.beworker:pinned-section-listview:v1.0
The repositoty is in: https://android-arsenal.com/details/1/264
Try below Gragle dependency line
compile 'com.github.beworker:pinned-section-listview:1.1'

Android Studio: Error:(58, 13) Failed to resolve: com.mikepenz:materialdrawer:4.3.5

I'm trying to add this Library
But when Sync the Android Studio project following error is coming ..
Error:(58, 13) Failed to resolve: com.mikepenz:materialdrawer:4.3.5
I'm struck with this, please help me...
Build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
minSdkVersion 15
targetSdkVersion 22
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
repositories {
maven {
url "https://jitpack.io"
}
maven { url 'https://dl.bintray.com/kennyc1012/maven' }
}
repositories{
flatDir{
dirs 'libs'
}
}
dependencies {
compile files('libs/YouTubeAndroidPlayerApi.jar')
compile files('libs/android-support-v7-recyclerview.jar')
compile files('libs/jsoup-1.7.3.jar')
compile files('libs/universal-image-loader-1.9.2.jar')
compile 'com.android.support:appcompat-v7:22.2.1'
compile 'com.google.android.gms:play-services:7.8.0'
compile 'com.github.JayFang1993:DropDownMenu:96d390f9c4'
compile 'com.oguzdev:CircularFloatingActionMenu:1.0.2'
compile 'com.github.mrengineer13:snackbar:1.2.0'
compile 'com.mcxiaoke.volley:library-aar:1.0.0'
compile 'com.android.support:design:22.2.1'
}
dependencies {
compile('com.mikepenz:materialdrawer:4.3.5#aar') {
transitive = true
}
}
My guess is that this dependency is available on maven central. Try to add the central maven repo to your repositories and resync again.
repositories {
maven {
url "https://jitpack.io"
}
maven { url 'https://dl.bintray.com/kennyc1012/maven' }
mavenCentral()
}
Just remove the jcenter() in the Project build.gradle file with mavenCentral()

Android Studio could not find any version that matches come.google.maps

My gradle seems to be complaining that it Could not find any version that matches com.google.maps.android:android-maps-utils:+.
Gradle:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.11.+'
}
}
apply plugin: 'android'
android {
compileSdkVersion 19
buildToolsVersion '19.1.0'
lintOptions {
abortOnError false
}
defaultConfig {
minSdkVersion 11
targetSdkVersion 19
}
signingConfigs {
}
buildTypes {
release {
signingConfig signingConfigs.release
}
}
productFlavors {
}
}
dependencies {
compile 'com.google.android.gms:play-services:4.+'
compile 'com.android.support:support-v4:19.1.+'
compile 'com.google.maps.android:android-maps-utils:+'
compile project(':libraries:facebook')
compile files('libs/YouTubeAndroidPlayerApi.jar')
compile files('libs/libGoogleAnalyticsServices.jar')
compile files('libs/svg-android.jar')
}
you havn't declared a repository for your project, just for the buildscript stuff.
try adding a first level repository block
repositories {
jcenter()
}

Categories

Resources