2

I want to use MusicBobber library in my project, but this error showed up

Error:Failed to resolve: com.android.support:appcompat-v7:23.4.0

I have com.android.support:appcompat-v7:23.1.1 and this is complete gradle file:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"

    defaultConfig {
        applicationId "com.tabaneshahr.playaudiotest"
        minSdkVersion 15
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }

    repositories {
        maven { url 'http://repo1.maven.org/maven2' }
    }

    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.1'

    compile 'com.cleveroad:audiowidget:0.9.2'
}

I'd searched stackoverflow but noting useful. what should I do? does minSDK must change? shall I download anything?

Shima Erfan
  • 335
  • 1
  • 5
  • 19

4 Answers4

2

First, replace your appcompat compile line with the latest one like this:

    compile 'com.android.support:appcompat-v7:24.2.0'

Update to the targetSdkVersion 24 as well.

and remove the compile line for the library:

    compile 'com.cleveroad:audiowidget:0.9.2'

Second, clean/build and run the project, you should not get any errors. If this happened, then your problem is not with the appcompact at all, but it is with the library.

Thrid, try to add the library compile line and again and let the gradle sync. If you still getting a problem, then I recommend to save your self the hassle and integerate the library in your code manually by doing the following this link steps

Hope it helps!

Sami Eltamawy
  • 9,874
  • 8
  • 48
  • 66
1

Please update your build tool version :

 buildToolsVersion "23.0.2"

to 25 or you can use

 compile 'com.android.support:appcompat-v7:23.0.0'

Clean and rebuild your android project.

Ashish
  • 371
  • 3
  • 18
0
> create a new project and you will see exact version .

for example for me in project file was :

compile 'com.android.support:appcompat-v7:24.2.0'

but after created new project i saw it is like this :

compile 'com.android.support:appcompat-v7:24.0.0-alpha2'

so changed and sync and fixed .

0

I ran into this error while trying to run SQLite Android Bindings. It still uses a very old gradle configuration (included below).

TLDR

com.android.support:appcompat-v7:23.4.0 is very old and only available on https://maven.google.com (google() in build.gradle) as of this writing. Make sure your root build.gradle includes the google() repository in its allprojects.repositories section:

allprojects {
    repositories {
        jcenter()
        google()
    }
}

SQLite's woefully out of date gradle configuration:

$ROOT/build.gradle:

buildscript {
    repositories {
        jcenter()
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.4'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
        // this was the problem. google() was missing!
    }
}

$ROOT/sqlitetest/build.gradle:

android {
    compileSdkVersion 25

    defaultConfig {
        minSdkVersion 16
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
...
}
Heath Borders
  • 30,998
  • 16
  • 147
  • 256