java - 安装 SDK 25 时,无法找到哈希字符串 'android-25' 的目标不会消失

标签 java android android-studio gradle

Android Studio 中我遇到错误:

Failed to find target with hash string 'android-25' in: [path]
Possible cause: Build properties not found for package Android SDK Platform 25

没问题,我想,所以根据post我只是安装了缺少的 Android SDK: enter image description here

但是我仍然遇到这个问题。即使重建项目后 并重新启动 Android Studio

构建.gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion '25.1.0'
    defaultConfig {
        applicationId "com.sample.app"
        minSdkVersion 21
        targetSdkVersion 25
        versionCode 1
        versionName "1.1"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}
repositories {
    maven {
        url "https://jitpack.io"
    }
    mavenCentral()
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    testCompile 'junit:junit:4.12'
    // Google libraries
    compile 'com.android.support:appcompat-v7:25.1.0'
    compile 'com.android.support:design:25.1.0'
    compile 'com.android.support:support-v4:25.1.0'
    compile 'com.google.android.gms:play-services-vision:10.0.1'
    compile 'com.android.volley:volley:1.0.0'
    // Third party libraries
    compile 'com.github.bumptech.glide:glide:3.7.0'
    compile 'com.github.paolorotolo:appintro:4.1.0'
    compile 'com.github.ViksaaSkool:AwesomeSplash:v1.0.0'
    compile 'org.greenrobot:eventbus:3.0.0'
    compile 'com.afollestad.material-dialogs:commons:0.8.6.0'
    compile 'com.alexvasilkov:gesture-views:2.1.1'
    compile 'org.adw.library:discrete-seekbar:1.0.1'
    compile 'com.squareup.picasso:picasso:2.5.2'

    compile files('libs/activation.jar')
    compile files('libs/additionnal.jar')
    compile files('libs/mail.jar')
    compile 'com.android.support:recyclerview-v7:25.1.0'
    compile 'com.android.support:cardview-v7:25.1.0'
}

注意:我已删除并重新安装了所有已安装的 Android SDK。不幸的是这没有帮助。

我还能做什么来解决这个问题?

以下是我的独立 SDK 管理器的屏幕截图:

enter image description here

enter image description here

enter image description here

最佳答案

从菜单中启动独立 SDK 管理器,您可以在其中查看安装了该 API 级别的哪些组件。有些可能还没有安装,选择并更新。

关于java - 安装 SDK 25 时,无法找到哈希字符串 'android-25' 的目标不会消失,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43467040/

相关文章:

Java JAXB 的优点/缺点和文档

java - 如何从对象数组中的 Float 转换为 float 变量?

java - 在 Java 中扩展 Throwable

android - 如何清除 RecyclerView 适配器数据

java - 按自定义顺序对 RealmResult 进行排序

java - 禁用 IntelliJ 中运行窗口的显示

android - 在 android studio junit 测试中记录消息

java - 需要验证使用 mvc :annotation-driven? 定义处理程序映射的旧方法

java - 在同一个包中找不到类

java - 将 Google Play 服务包含到 Android Studio 项目中