Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.android.support:appcompat-v7:26.1.0.
Could not resolve com.android.support:appcompat-v7:26.1.0.
Required by: project :app
No cached version of com.android.support:appcompat-v7:26.1.0 available for offline mode.
Could not resolve all files for configuration ':app:debugCompileClasspath'.
Could not resolve com.android.support:appcompat-v7:26.1.0.
Required by:
project :app
No cached version of com.android.support:appcompat-v7:26.1.0 available for offline mode.
No cached version of com.android.support:appcompat-v7:26.1.0 available for offline mode.
Could not resolve com.android.support.constraint:constraint-layout:1.1.0-beta3.
Required by:
project :app
No cached version of com.android.support.constraint:constraint-layout:1.1.0-beta3 available for offline mode.
No cached version of com.android.support.constraint:constraint-layout:1.1.0-beta3 available for offline mode.
Could not resolve com.android.support:design:26.1.0.
Required by:
project :app
No cached version of com.android.support:design:26.1.0 available for offline mode.
No cached version of com.android.support:design:26.1.0 available for offline mode.
Could not resolve com.android.support:cardview-v7:26.1.0.
Required by:
project :app
No cached version of com.android.support:cardview-v7:26.1.0 available for offline mode.
No cached version of com.android.support:cardview-v7:26.1.0 available for offline mode.
Could not resolve com.google.android.gms:play-services-ads:11.4.2.
Required by:
project :app
No cached version of com.google.android.gms:play-services-ads:11.4.2 available for offline mode.
No cached version of com.google.android.gms:play-services-ads:11.4.2 available for offline mode.
Could not resolve com.android.support:support-v4:26.1.0.
Required by:
project :app
No cached version of com.android.support:support-v4:26.1.0 available for offline mode.
No cached version of com.android.support:support-v4:26.1.0 available for offline mode.
Error log image:
Go to File->Other Settings->Default Settings->Build, Execution, Deployment->Build Tools->Gradle->Uncheck Offline work option.
Below is a workaround demo image of ; Uncheck Offline work option by going to:
File -> Settings -> Build, Execution, Deployment -> Gradle
Open the
build.gradle
file for your application.Make sure that the repositories section includes a maven section with the "https://maven.google.com" endpoint. For example:
allprojects { repositories { jcenter() maven { url "https://maven.google.com" } } }
Add the support library to the
dependencies
section. For example, to add the v4 core-utils library, add the following lines:dependencies { ... compile "com.android.support:support-core-utils:27.1.0" }
Caution: Using dynamic dependencies (for example,
palette-v7:23.0.+
) can cause unexpected version updates and regression incompatibilities. We recommend that you explicitly specify a library version (for example,palette-v7:27.1.0
).Manifest Declaration Changes
Specifically, you should update the
android:minSdkVersion
element of the<uses-sdk>
tag in the manifest to the new, lower version number, as shown below:<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="23" />
If you are using Gradle build files, the
minSdkVersion
setting in the build file overrides the manifest settings.apply plugin: 'com.android.application' android { ... defaultConfig { minSdkVersion 16 ... } ... }
Below is a workaround demo image of ; Uncheck Offline work option by going to:
File -> Settings -> Build, Execution, Deployment -> Gradle
Open the
build.gradle
file for your application.Make sure that the repositories section includes a maven section with the "https://maven.google.com" endpoint. For example:
allprojects { repositories { jcenter() maven { url "https://maven.google.com" } } }
Add the support library to the
dependencies
section. For example, to add the v4 core-utils library, add the following lines:dependencies { ... compile "com.android.support:support-core-utils:27.1.0" }
Caution: Using dynamic dependencies (for example,
palette-v7:23.0.+
) can cause unexpected version updates and regression incompatibilities. We recommend that you explicitly specify a library version (for example,palette-v7:27.1.0
).Manifest Declaration Changes
Specifically, you should update the
android:minSdkVersion
element of the<uses-sdk>
tag in the manifest to the new, lower version number, as shown below:<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="23" />
If you are using Gradle build files, the
minSdkVersion
setting in the build file overrides the manifest settings.apply plugin: 'com.android.application' android { ... defaultConfig { minSdkVersion 16 ... } ... }
Just went to build.gradle
and deleted the line:
implementation 'com.android.support:appcompat-v7:26.1.0'
After that, I re-synced the Gradle. Then, I pasted the line of code back, re-synced the Gradle again and it worked.
Note: While I was making this changes, I also updated all the SDK Tools that needed update.
Invalidate Cache / Restart
from File option.Just unchecking offline mode did not work for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With