Gradle command line: could not find target android-22

I am trying to create a project that I pulled from a git repository and everything seems to be installed correctly, however, when I run gradle, I get the following message:

FAILURE: Build failed with an exception. * What went wrong: A problem occurred configuring project ':app'. > failed to find target android-22 : /home/rvogel/android-sdk-linux/tools * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. BUILD FAILED Total time: 7.562 secs 

Then I ran an android report to find out what goals I set:

 rvogel: ~/StockApp $ android list target Available Android targets: ---------- id: 1 or "android-22" Name: Android 5.1.1 Type: Platform API level: 22 Revision: 2 Skins: HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800 (default), WVGA854, WXGA720, WXGA800, WXGA800-7in Tag/ABIs : no ABIs. ---------- 

Is there another problem that is known to trigger this, and I just can't find it?

UPDATE: I have long given up on this since it was a pet project trying to remotely work with an Android application using github to synchronize the project from the VM command line. However, since you may have been able to say, or perhaps not, since it was marked as duplicate, I do not use Android Studio in the virtual machine, I launch the entire project command line using the IDE in the browser. The question that I have to duplicate specifically asks about Android Studio, the solution of which is to download the correct version of Android. I am not using Android Studio, and I copied a printout of my available targets, which indicated that the missing target was actually installed on the computer.

+8
git android gradle
source share
1 answer

Expecting that you are using android studio ...

First check the build.gradle file of the previous application or just create a new file and check the build.gradle file.

Check out the build.gradle file of the application that gives this problem. Just change it according to build.gradle in the running application.

Basically, you have to change 2 main things here. The following is shown:

 compileSdkVersion = 21// add the version which is in your running project buildToolsVersion = "21.1.2"/* add the version which is in your running project*/ minSdkVersion = 9 targetSdkVersion = 21/*same as your build.gradle of running app*/ 

After the changes, clean and rebuild your project. It should work.

or

You can download the necessary sdk versions.

+3
source share

All Articles