Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio - Could not download sdk-common.jar

Tags:

android

I'm trying to learn Android programming. I installed Android Studio and installed the SDK for 28 - 24. Then I started a new project and set the minimum level to 26. As soon as Android Studio creates the project it attempts to build the project and immediately presents this error:

Error:Could not download sdk-common.jar (com.android.tools:sdk-common:26.1.4):
    No cached version available for offline mode

I've tried searching but haven't found any solution.
How can I fix this? Thanks.

like image 222
Vijer Avatar asked Sep 03 '18 08:09

Vijer


People also ask

Which version of Android Studio does the SDK tools support?

This version of the SDK Tools is designed to work with Android Studio 0.2.x and later. If you are developing without an integrated development environment (IDE), you must have Apache Ant 1.8 or later.

Why can't I re-download components from Android SDK tools?

If you install Android Studio 2.2 or lower, you won't be able to re-download the components. In order to download components via the SDK manager, upgrade to a newer version of Android Studio. Android SDK Tools is a component for the Android SDK. It includes development and debugging tools for Android.

How do I download Android SDK from SDK manager?

Open the SDK Manager from Android Studio by clicking Tools > SDK Manager or click SDK Manager in the toolbar. Click the checkbox next to Android SDK Platform-Tools so it shows a checkmark. A download icon should appear in the left column.

How do I add an Android SDK to my project?

You can also follow these steps: 1. In the Android Studio welcome screen select Configure->Project Defaults->Project Structure. You will get to the following screen: 2. Select SDKs. If you don't have an Android SDK in that list then click the + icon and select Android SDK, now point to the SDK path.


2 Answers

Error:Could not download sdk-common.jar (com.android.tools:sdk-common:26.1.4): No cached version available for offline mode

  • You should Uncheck offline work at first.

File -> Settings ->Build, Execution,Deployment -> Build Tools -> Gradle -> Uncheck Offline work

Then Clean-Rebuild and GRADLE your project.

like image 103
IntelliJ Amiya Avatar answered Sep 24 '22 16:09

IntelliJ Amiya


You have to disable offline mode in android studio so that it can download all the required components /dependencies from network that are not available offline.

See this for how to disable offline mode in android studio: How to disable gradle 'offline mode' in android studio?

like image 37
Qasim Avatar answered Sep 24 '22 16:09

Qasim