Android Studio“无效的哈希字符串"编译SDK版本中的警告

Android Studio“无效的哈希字符串

问题描述:

我是Android应用程序开发的新手,正在尝试对现有项目进行一些更改.当我尝试在Android Studio的项目结构"中更改编译Sdk版本"时,它在所选Sdk"Vuzix Corporation:Vuzix M300 SDK:23"的右侧显示红色警告(无效的哈希字符串),并且不适用变化.然后我意识到"Google Inc.:Google APIs:23"也会发生同样的情况.

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".

这是一个为Vuzix M300增强现实眼镜打造的应用程序,我按照其网站上的文档更新了现有项目并在Android Studio中安装了M300 SDK.首先,按照他们的建议,我使用带有编译Sdk版本API 23:Android 6.0(棉花糖)的标准Sdk构建了该应用程序.后来他们希望我们在项目结构中将Compile Sdk版本更改为Vuzix M300 SDK(API 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'])
}

我希望compileSdkVersion应该更改,但是我不知道该特定的SDK应该是什么.

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

您的compileSdkVersiontargetSdkVersionbuildToolsVersion应该处于相同的版本级别.

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

还要在SDK Manager中,确保已安装SDK版本.

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

如果问题仍然存在,请运行使缓存无效/重新启动"

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

修改

如果您使用的是Gradle插件版本3.4.1

if you are using gradle plugin version 3.4.1

此版本的Android插件要求以下条件:

This version of the Android plugin requires the following:

SDK构建工具28.0.3或更高版本.

SDK Build Tools 28.0.3 or higher.

来源

这意味着您不能使用 compileSdkVersion 23