【问题标题】:Failed to find target with hash string 'android-24' in macOS在 macOS 中找不到带有哈希字符串“android-24”的目标
【发布时间】:2017-05-13 11:55:30
【问题描述】:

macOS 塞拉利昂

Android Studio 版本 2.2.3

android-ndk-r13b

enter image description here

我点击了“安装缺少的平台并同步项目”,现在,在我的目录 android-ndk-r13b/platforms/ 中,我确实有 android-24。

但错误仍然发生!其他人说应该编辑文件 build.gradle,现在我的 build.gradle 内容如下:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 24
    buildToolsVersion "24.0.0"
    defaultConfig {
        applicationId "com.mimo520.arderbud.myfirstandroidapplication"
        minSdkVersion 22
        targetSdkVersion 'N'
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner  "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        } 
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.0', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:24.+'
    testCompile 'junit:junit:4.12'
}

那么如何修复这个文件呢?谢谢!

【问题讨论】:

    标签: android macos android-ndk


    【解决方案1】:

    请发布您应用的 build.gradle(您已经发布了项目的 build.gradle)。

    这个问题通常是你没有当前的 buildtools 版本,或者你的编译版本与你的 buildtools 版本不匹配等等。

    【讨论】:

    • 我对应用程序的 build.gradle 进行了更改。如何修复它?
    猜你喜欢
    • 2016-06-26
    • 2018-11-23
    • 1970-01-01
    • 2017-03-20
    • 2023-03-19
    • 1970-01-01
    • 2020-01-16
    • 1970-01-01
    • 2016-01-24
    相关资源
    最近更新 更多