1

I'm trying to up my target API to 26 (from 22), so far with some difficulty.

For some reason my Gradle continues thinking that 25.3.1 is still the latest version of support libraries.

So, here's my build.gradle for the library project:

apply plugin: 'com.android.library'

android {
    compileSdkVersion 26
    buildToolsVersion '26.0.1'
    publishNonDefault true

    defaultConfig {
        targetSdkVersion 26
        minSdkVersion 14
        versionCode 1
        versionName "1.0"
    }
}

allprojects {
    repositories {
        jcenter()
        maven {
            url 'https://maven.google.com'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:support-v4:25.3.1'
}

And the relevant sections from main project:

apply plugin: 'com.android.application'
android {
    compileSdkVersion 26
    buildToolsVersion "26.0.1"

    defaultConfig {
        targetSdkVersion 26
        minSdkVersion 14
    }
}
dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile project(path: ':MyLibrary', configuration: 'debug')
}

It seems no matter what I do, Androd Studio will not recognise the repositories and offer to upgrade to support library version 26, yet complains when I include only version 25.

I just completed looking every SO question that looked even remotely relevant to the issue and pretty much all of them just dealt with adding the new repository into dependencies. Am I adding it incorrectly?

Trying to set support-v4 library to 26.0.2 version manually just results in "failed to resolve" gradle error.

What setting am I still missing to make this work for me?

velis
  • 8,747
  • 4
  • 44
  • 64
  • Hm, moving to Android Studio 3.0 beta & gradle 4 beta makes at least Android Studio aware of the new support library versions. It still cannot compile though because of "failed to resolve" error. – velis Sep 11 '17 at 06:15

2 Answers2

0

First Set Target API to 26. then Sync gradle. after syncing process is complete clean Project.

  • As you can see, all that is set already. Project has been cleaned several times already. I even invalidated all the caches. All to no avail – velis Sep 10 '17 at 12:24
-1
apply plugin: 'com.android.application'

android { useLibrary 'org.apache.http.legacy' compileSdkVersion 26 buildToolsVersion '26.0.1'

defaultConfig {
    applicationId "com.common.yourprojectname"
    minSdkVersion 16
    targetSdkVersion 26
    versionCode 1
    versionName "1.0"

    /*jackOptions {
        enabled true
    }*/

}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}


/* compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}*/
dexOptions {
    javaMaxHeapSize "4g"
}

}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
//apt 'com.bluelinelabs:logansquare-compiler:1.3.6'

compile files('libs/android-viewbadger.jar')
//noinspection GradleCompatible
compile 'com.android.support:appcompat-v7:26.1.0'
compile 'com.android.support:design:26.1.0'
compile 'com.android.support:support-v4:26.1.0'
compile 'com.android.support:recyclerview-v7:26.1.0'
compile 'com.android.support:cardview-v7:26.1.0'
compile 'com.android.volley:volley:1.0.0'
compile 'com.jakewharton:butterknife:8.4.0'
compile 'com.google.android.gms:play-services-ads:8.4.0'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.bluelinelabs:logansquare:1.3.6'
compile 'com.weiwangcn.betterspinner:library-material:1.1.0'
compile 'com.intuit.sdp:sdp-android:1.0.4'
compile 'org.greenrobot:eventbus:3.0.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'me.dm7.barcodescanner:zxing:1.9.8'
compile 'com.github.javiersantos:MaterialStyledDialogs:2.1'
compile 'com.oguzdev:CircularFloatingActionMenu:1.0.2'
compile 'de.hdodenhof:circleimageview:2.1.0'
compile('com.payumoney.sdkui:plug-n-play:1.0.0') {
    transitive = true;
    exclude module: 'payumoney-sdk'
}

compile 'com.payumoney.core:payumoney-sdk:7.0.1'
/*compile('com.crashlytics.sdk.android:crashlytics:2.6.5@aar') {
    transitive = true;
}*/
testCompile 'junit:junit:4.12'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.4.0'
annotationProcessor 'com.bluelinelabs:logansquare-compiler:1.3.6'

}

Hanisha
  • 849
  • 10
  • 8