Ashu
Ashu

Reputation: 1320

Not able to compile exoplayer in Android Studio

I have imported exoplayer using jcenter but am getting error as : Error:(46, 13) Failed to resolve: com.google.android.exoplayer:exoplayer:r2.3.0 Following is my code of gradles:

build.gradle(Project)

buildscript{
repositories {
    jcenter()
   /* mavenCentral()*/
}
dependencies{
  classpath 'com.android.tools.build:gradle:2.2.3'
  classpath 'com.android.tools.build:gradle:1.0.0-rc1'
 // NOTE: Do not place your application dependencies here; they belong
 // in the individual module build.gradle files
}}allprojects {
repositories {
    jcenter()
    mavenCentral()
}
}
task clean(type: Delete)
{
 delete rootProject.buildDir
}

build.gradle(Module)

apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
    applicationId "com.example.pash.dr"
    minSdkVersion 15
    targetSdkVersion 25
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

}buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}} 
 repositories {
     jcenter()
  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'
})
compile 'com.android.support:appcompat-v7:25.3.0'
compile 'com.android.support:design:25.3.0'
compile 'com.android.support:recyclerview-v7:23.3.+'
compile 'com.android.support:cardview-v7:23.3.+'
testCompile 'junit:junit:4.12'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.squareup.picasso:picasso:2.5.2'
/** *************For player ***************/
compile 'com.android.support:support-v4:21.0.3'
compile 'com.nineoldandroids:library:2.4.0'
compile 'com.daimajia.slider:library:1.1.5@aar'
compile 'com.google.android.exoplayer:exoplayer:r2.3.0'
}

Please guide me. Thank you in advance.

Upvotes: 1

Views: 6097

Answers (2)

batsheva
batsheva

Reputation: 2295

you don't have to go back in versions, you can use the last release version: as in this link [1]https://github.com/google/ExoPlayer/releases just try to do invalidate and restart your project

Upvotes: 1

Sathya Baman
Sathya Baman

Reputation: 3515

Change exo player dependencies to 1.5.2 and then go to File->Invalidate cache /restart

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.0'
compile 'com.android.support:design:25.3.0'
compile 'com.android.support:recyclerview-v7:23.3.+'
compile 'com.android.support:cardview-v7:23.3.+'
testCompile 'junit:junit:4.12'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.squareup.picasso:picasso:2.5.2'
/** *************For player ***************/
compile 'com.android.support:support-v4:21.0.3'
compile 'com.nineoldandroids:library:2.4.0'
compile 'com.daimajia.slider:library:1.1.5@aar'
compile 'com.google.android.exoplayer:exoplayer:r1.5.2'
}

Upvotes: 2

Related Questions