Could Not Resolve Com.Android.Support:Appcompat-V7:26.1.0 in Android Studio New Project

Could not resolve com.android.support:appcompat-v7:26.1.0 in Android Studio new project

Finally I fixed the problem by modifying build.gradle like this:

android {
compileSdkVersion 26
buildToolsVersion "26.0.2"

defaultConfig {
minSdkVersion 16
targetSdkVersion 26
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:design:26.1.0'
}

I've removed these lines as these will produce more errors:

testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'

Also I had same problem with migrating an existing project from 2.3 to 3.0.1 and with modifying the project gradle files like this, I came up with a working solution:

build.gradle (module app)

android {
compileSdkVersion 27
buildToolsVersion "27.0.1"

defaultConfig {
applicationId "com.mobaleghan.tablighcalendar"
minSdkVersion 16
targetSdkVersion 27
}

dependencies {
implementation 'com.android.support:appcompat-v7:25.1.0'
implementation 'com.android.support:design:25.1.0'
implementation 'com.android.support:preference-v7:25.1.0'
implementation 'com.android.support:recyclerview-v7:25.1.0'
implementation 'com.android.support:support-annotations:25.1.0'
implementation 'com.android.support:support-v4:25.1.0'
implementation 'com.android.support:cardview-v7:25.1.0'
implementation 'com.google.android.apps.dashclock:dashclock-api:2.0.0'
}

Top level build.gradle

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

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

Could not resolve com.android.support:appcompat-v7:28.0.0

I'm sure other answers are good and working. but mine got solved by set proxy to Freedom of Developers.

Sample Image

This solution is for Persians like me who suffer from strict limitations for Iranians by google.

Now my app gradle look like this:

buildscript {
repositories {
maven { url 'https://plugins.gradle.org/m2/'}
}
dependencies {
classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:0.12.1'
}
}
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'

repositories {
maven { url 'https://maven.google.com' }
}

apply plugin: 'com.android.application'

android {
compileSdkVersion 28
buildToolsVersion '28.0.3'

defaultConfig {
applicationId "com.mobaleghan.nasimnoor"
manifestPlaceholders = [
onesignal_app_id: 'b1ced87b-48d1-4857-a68b-9c287aa4003f',
// Project number pulled from dashboard, local value is ignored.
onesignal_google_project_number: 'REMOTE'
]
minSdkVersion 16
targetSdkVersion 28
versionCode 9
versionName "1.6.4"
vectorDrawables.useSupportLibrary = true
}

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

lintOptions {
abortOnError false
}
}

dependencies {
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support:preference-v7:28.0.0'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.android.support:support-annotations:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'com.google.android.apps.dashclock:dashclock-api:2.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation "com.android.support:support-core-utils:28.0.0"
implementation 'com.onesignal:OneSignal:3.10.3'
}

Those repositories are there based on OneSignal documentations.

And top level build:

buildscript {
repositories {
google()
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'

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

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

And everything is working fine.

Could not resolve com.android.support:appcompat-v7:26.1.0. = configure HTTP proxy

I had the same error. Tried a lot of stackoverflow links but none of them helped until this one. The problem in my case was due to https proxy settings which were not there in the gradle.properties file. I included it and it worked.

For android studio 3, inside build.gradle file of your project you have this:

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

The jcenter() runs over https and hence if you are building in a network(in most cases company network) which uses https proxy, and you forgot to include it in your gradle.properties file, then you are likely to face the issue. You may feel that gradle is behaving weird but its not. Its only missing the proper network configuration. Even offline build settings wont work since it still needs jcenter() to download files for the first time you are building an app in latest Android Studio.

I included my https proxy settings in gradle.properties like this:

systemProp.https.proxyHost=<proxy server address>
systemProp.https.nonProxyHosts=localhost, 127.0.0.1
systemProp.https.proxyPort=<port number>

Could not resolve com.android.support:design:26.1.0

Problem that I realized in the end was that when I was setting up the android proxy, I have only set up 1 proxy which was for HTTP and did not realize that HTTPS proxy was not set up.

So after fixing that issue by setting HTTPS proxy, there was no more problems.

Trouble with gradle in android studio

You are trying to mix AppCompat and Jetpack dependencies, and you cannot do that.

I think you might not have the right repository setup for the Jetpack libraries (why it can't find any Jetpack libraries).

Don't use: implementation 'androidx.appcompat:appcompat:1.0.2' . (this is Jetpack) -- use AppCompat versions of this (besides - Jetpack is NOT consistent with Appcompat versions earlier then 28.x). Bottom line, get rid of anything that says (androidx).

Failed to resolve: com.android.support:appcompat-v7:28.0

28.0.0 is the final version of support libraries. Android has migrated to AndroidX. To use the latest android libraries, Migrating to AndroidX


Edit: Versions 28.0.0-rc02 and 28.0.0 are now available.

I don't see any 28.0 version on Google Maven. Only 28.0.0-alpha1 and 28.0.0-alpha3. Just change it to either of those or how it was previously, i.e., with .+ which just means any version under 28 major release.

For an alpha appcompat release 28.+ makes more sense.

Failed to resolve: com.android.support:design:26.2.0 error in Android Studio

Failed to resolve: com.android.support:design:26.2.0

Failed to resolve: com.android.support:appcompat-v7:26.2.0

It's simply because the last version of support library 26 is version 26.1.0. You better to use support library version 28.0.0 or either upgrading to AndroidX.



Related Topics



Leave a reply



Submit