Could not find target using hash string android-23

When trying to create an OpenStreetMapView from git: //github.com/osmdroid/osmdroid, I get this error:

failed to find target with hash string android-23: D:\Users\myusername\AppData\Local\Android 

How can i fix this? Previous questions like this suggest checking that Android 23 is not installed, but in my case it is.

The following is the relevant information:

ANDROID_HOME D:\Users\myusername\AppData\Local\Android\sdk

D:\Users\myusername\AppData\Local\Android\sdk\platforms\ contains the directory \ android-23 \ (as well as android-19, android-21, android-22, android-MNC)

build.gradle

 apply plugin: 'com.android.application' android { compileSdkVersion 23 buildToolsVersion "23.0.1" defaultConfig { applicationId "org.osmdroid.example" minSdkVersion 8 targetSdkVersion 23 versionCode 16 versionName "4.4-SNAPSHOT" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } packagingOptions { exclude 'META-INF/LICENSE' exclude 'META-INF/DEPENDENCIES' exclude 'META-INF/NOTICE' } lintOptions { abortOnError false } } dependencies { compile 'android.support:compatibility-v4:23+' compile project(':osmdroid-android') //compile 'org.osmdroid:osmdroid-third-party:4.4-SNAPSHOT' } 

I tried to change targetSdkVersion and compileSdkVersion to 22. This causes the error message to change to "android-22" instead of "android-23".

SDK Manager: enter image description here

+84
android gradle android-build
Oct 29 '15 at 2:52
source share
20 answers

In my case, cleaning the caché did not work.

In the SDK Manager, be sure to check the "show package descriptions" box; then you should also select the “Google API” for the version you want to install.

Install it, and then you should be fine

+70
Jun 30 '16 at 0:17
source share

In Android Studio File -> Invalidate Caches/Restart , the problem for me was solved.

+20
Jul 10 '16 at 11:37
source share

The answer to this question .

Gradle dies from time to time, and destroying the cache is the only solution I have found. You will find the hidden.gradle folder in your user home folder and the other where the extraction location is for osmdroid.

+17
Nov 12 '15 at 15:09
source share

I fixed this problem for me by opening the Android SDK Manager and installing build tools for all 23.xx versions

See screenshot.

enter image description here

+13
Sep 08 '16 at 19:36
source share

Note. I think this may be a bug in Android Studio.

  • Go to project structure
  • Select application module
  • In the first Properties tab, change the Compile SDK version to API XX from Google API xx (for example, API 23 instead of Google API 23).
  • Click OK
  • Wait for the process to complete, in my case I did not get an error at this point.

Now return the compiled version of Sdk back to the Google API xx.

If this does not work, then:

  1. In the Google API (Google xx API instead of xx API), omit the build tool version (e.g. Google API 23 and tool version 23.0.1)
  2. Click "OK" and wait for the process to complete.
  3. Revert the version of your build tool to what it was before you changed
  4. Click ok
  5. Wait for the process to complete.
  6. Done!
+6
Apr 11 '16 at 8:22
source share

After these recommended directions, it seemed to work:

Tip. Open the SDK manager by running: / path / to / android / tools / android

You will need: 1. "Platform SDK" for Android 23 2. "Platform tools Android SDK (latest versions) 3." Development Tools Android SDK "(latest version)

+3
Aug 12 '16 at 5:41
source share

I had the same problem with a different number, it worked for me:

  1. Click at the top of the error message "Gradle Project Sync Error" where it says "Open Message" in the text

  2. In the "Message synchronization" window in the lower left corner, select the provided solution "Install the missing ..."

  3. Repeat 1 and 2 as necessary

23:08 Sync Gradle: could not find the target using the hash string 'android-26' in: C: \ Users \ vik \ AppData \ Local \ Android \ Sdk

Android SDK provides a solution in the lower left Android SDK providing a solution in the bottom left corner

+3
Jan 30 '18 at 23:18
source share

This worked for me by changing compileSdkVersion to 24 and targetSdkVersion to 24 and changing compile to com.android.support:appcompat-v7:24.1.0

+2
Sep 19 '16 at 9:32
source share

There are 2 solutions to this problem:

1) Download the appropriate Android SDK via Tools → Android → SDK Manager → SDK Tools (make sure you have “Show Package Details” installed). Your case will be Android 6.0 (Marshmallow / API Level 21)

2) Either open the build.gradle file and update the following attributes:

  • compileSdkVersion
  • buildToolsVersion
  • targetSdkVersion

either to the latest version of the Android API that you installed, or to another installed version that you would like to use (although I always recommend using the latest version for common reasons: fixing bugs, etc.)

If you follow step 2, it is also important to remember that you need to update the version of the Android support library if your application uses it. This can be found in the dependencies section of your build file and looks something like this:

compile 'com.android.support:appcompat-v7:27.0.2'

(replace 27.0.2 the latest version of the support library for the API level that you are going to use with your application)

+2
Jan 15 '18 at 10:21
source share

Open the Android SDK Manager and Update with the latest.

+1
May 30 '16 at 10:35
source share

Nothing worked for me. I changed the SDK path to the new SDK location and reinstalled the SDK. It works great.

+1
Sep 21 '16 at 5:58
source share

Tools> Android> SDK Manager.

enter image description here

+1
Jul 07 '17 at 12:09 on
source share

I had this problem when using windows. It turned out that the problem with the SDK in my profiles was a problem. So I had to move the SDK folder to the documents, and then it worked.

+1
Dec 21 '17 at 14:11
source share

My complained about 26. I looked in my folders and found a folder for 27, but not for 26. So I changed my build.gradle file, replacing 26 with 27. compileSdkVersion, targetSdkVersion and implementation (changed these numbers to v: 7: 27 , 02). This changed my error message. Then I added buildToolsVersion "27.0.3" to the Android brackets section right below compileSdkVersion.

The make project button now works with 0 messages.

Next, how to actually select a module in my configuration so that I can run this.

+1
Jan 29 '18 at 22:52
source share

For me, the problem was that I wrote compileSdkVersion '23' instead of 23. Quotation marks were a problem.

+1
May 7 '18 at 6:24
source share

Download the specific version of Android from the link provided in the assembly console.

+1
Jul 20 '18 at 9:33
source share

you do not need to update anything. Just download the SDK for API 23 (or any other version that it requested) from the Android SDK Manager or by running the standalone SDK manager for Android. The error is the lack of a platform, not the missing tool.

enter image description here

0
Dec 22 '17 at 11:58
source share

My problem is resolved after Run as administrator of Andorid Studio

0
Feb 20 '18 at 13:04 on
source share

The problem is because the code that you run was created at an older API level, and your current SDK Manager does not support running them. So try the following; 1.Install SDK Manager that supports API level 23. Go to> SDK Manager,> Android SDK, then select API 23 and install. 2. The second alternative is to update the build.grade application module to change compileSdkVersion, compile, and other numbers to the current supported API level.

Note: make sure you check the API and Revision numbers and change them exactly. otherwise your project will not sync

0
Jun 06 '18 at 10:14
source share

Make sure the IDE recognizes that you have a package. It did not work even after loading 28, so I uninstalled it and then reinstalled, realizing that it was not in the File-Project Structure-Modules-App as the choice for the SDK.

Alternatively, you can change your build path to fit.

Lightly coupled, the latest updates seem to be compiling when I forced the update to 28 for CompileSDK, and not just to the new Google Play API 26 min requirement. This is due to dependencies, and may not affect your

0
Dec 19 '18 at 5:17
source share



All Articles