我已经按照创建Android库的官方指南,但是似乎有些地方不起作用。
我的项目包含两个模块。一个名为“app”的应用程序模块和一个名为“bfsdk”的库模块。在我的应用程序的build.gradle
文件中,我这样包含库:
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation project(path: ':bfsdk')
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'
}
然后在我的库模块中,
build.gradle
文件的第一行指定它是一个库。apply plugin: 'com.android.library'
根据文档说明,我现在只需在“项目”窗口中选择库模块,然后单击“构建 > 构建APK”,即可构建AAR文件。然而: 当我点击它并等待整个构建过程完成时,我无法在任何地方找到AAR文件。这会在
~/Source/BluePlayer/app/build/outputs/apk/android/release
生成一个APK文件,但是在~/Source/BluePlayer/bfsdk
文件夹中没有build
目录。我做错了什么?我漏掉了哪一步?AAR文件应该出现在哪里?