Android studio 2.3生成aar而不是apk

时间:2017-03-14 13:56:16

标签: android gradle

Build > Build APK生成aar而不是apk。

Success window

outputs文件夹中,我只有aar文件夹:

explorer

我的build.gradle android部分:

android {
compileSdkVersion 25
buildToolsVersion "25.0.0"
defaultConfig {
    applicationId "my.cool.app"
    minSdkVersion 21
    targetSdkVersion 25
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    multiDexEnabled true;
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
packagingOptions {
    exclude 'META-INF/LICENSE.txt'
    exclude 'META-INF/NOTICE.txt'
    exclude 'META-INF/DEPENDENCIES'
    exclude 'META-INF/NOTICE'
    exclude 'META-INF/LICENSE'
}

}

有什么问题?

1 个答案:

答案 0 :(得分:1)

问题是您的Build APK正在调用错误的gradle函数。检查您的complie选项:

Android Studio /偏好设置/构建,执行和部署/编译器

Android Studio / Preferences / Build, Executions and Deployment / Compiler

同时检查项目配置:

enter image description here

enter image description here