首页 > 解决方案 > 无法从项目生成 aar 文件

问题描述

我是从 android studio 创建库的新手。我一直在开发者网站上阅读本教程。因此,为了尝试它,我创建了一个新项目,并且没有做任何事情,我编辑了应用程序级别的 build.gradle 文件,它的外观如下:

apply plugin: 'com.android.library'

android {
    compileSdkVersion 28
    defaultConfig {
        minSdkVersion 15
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}

现在,当我尝试构建 apk(应该构建 aar 文件)时,并没有构建任何东西,因为我在构建 apk 时看不到任何确认消息,也无法在 app/build/outputs 中找到任何内容文件夹..

我哪里错了?教程中有什么我理解错误的地方吗?

这是项目结构 - 屏幕截图

标签: android

解决方案


推荐阅读