1

I'm very new at Android app development and trying to apply some changes on an existing project. When I try to change the Compile Sdk Version in Project Structure in Android Studio, it displays a red warning (Invalid hash string) on the right side of the chosen Sdk "Vuzix Corporation:Vuzix M300 SDK:23" and doesn't apply the changes. And then I realised the same also happens for "Google Inc.:Google APIs:23".

It's an app built for Vuzix M300 augmented reality glasses and I followed the documentation on their site to update an existing project and install the M300 SDK in Android Studio. First I built the app using the standard Sdk with Compile Sdk Version API 23: Android 6.0 (Marshmallow), as they recommended to do so. Later they want us to change the Compile Sdk Version to Vuzix M300 SDK (API 23) in Project Structure, which didn't work.

apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion '28.0.3'

defaultConfig {
    applicationId "de.tum.fml.pbvofflineapp"
    minSdkVersion 15
    targetSdkVersion 15
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
  }
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
}

I expect that the compileSdkVersion should change but I don't know what it should be for that specific Sdk.

elificious
  • 28
  • 5

3 Answers3

2

your compileSdkVersion , targetSdkVersion and buildToolsVersion should be on the same version level .

also , in the SDK Manager, make sure SDK version is installed.

after that run "invalidate caches/restart" if the problem persist

Edit

if you are using gradle plugin version 3.4.1

This version of the Android plugin requires the following:

SDK Build Tools 28.0.3 or higher.

source

which means you can't use compileSdkVersion 23

ismail alaoui
  • 5,748
  • 2
  • 21
  • 38
  • 1
    My `compileSdkVersion` and `targetSdkVersion` are on the same version level which is 23. Android Studio does not allow me to use `buildToolsVersion 23.0.3` saying: WARNING: The specified Android SDK Build Tools version (23.0.3) is ignored, as it is below the minimum supported version (28.0.3) for Android Gradle Plugin 3.4.1. Android SDK Build Tools 28.0.3 will be used. And I'm still not able to use the SDK I need (SDK version and tools are all installed) – elificious Jun 11 '19 at 19:12
  • Okay I finally found the way around that: `compileSdkVersion 'Vuzix Corporation:Vuzix M300 SDK:23'` which worked! – elificious Jun 11 '19 at 19:22
  • Thank you, I'll try to build with an older Gradle version. – elificious Jun 11 '19 at 19:27
0

If you change compileSdkVersion change also targetSdkVersion to the same. It has no sense to target a previous sdk and compile with greater one. Also you should have buildToolsVersion according with compile sdk

Lenin
  • 500
  • 3
  • 11
  • Ok I changed the targetSdkVersion to 23 as well, still I can't choose my desired Compile Sdk Version as "Vuzix Corporation:Vuzix M300 SDK:23". It displays the same warning (invalid hash string) – elificious Jun 11 '19 at 18:16
-1

If you not choose your desired Compile Sdk Version as "Vuzix Corporation:Vuzix M300 SDK:23". which will leads to can not find custom add-on sdk class build error.