我需要在我的应用程序中添加演示和完整 flavor 。
https://developer.android.com/tools/building/configuring-gradle.html告诉我:
"1.在Project面板上,展开BuildSystemExample,然后展开app目录。
2.右击app下的src目录,选择New > Directory。”
我使用的是 Android Studio 1.2.1.1,所以当我创建项目时,它不会在项目中显示 src 目录。
我该如何进行?
最佳答案
也许您可以使用“项目结构”对话框为您的应用程序创建一个风格。我在示例项目中添加了完整和家庭 flavor ,如下图所示。
您可以通过菜单"file"->“项目结构”得到“项目结构”对话框。
这是 app 模块的 build.gradle 文本文件。
apply plugin: 'com.android.application'
android {
compileSdkVersion 19
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.example.zephyr.myapplication"
minSdkVersion 15
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
full {
minSdkVersion 14
applicationId 'full'
targetSdkVersion 17
}
home {
minSdkVersion 14
applicationId 'home'
targetSdkVersion 17
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
}
希望能帮助到你。
关于android - 如何在 Android Studio 中为演示和完整 flavor 代码创建适当的目录?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30338291/