【发布时间】:2014-10-24 11:28:41
【问题描述】:
我最近将 Android Studio 从 0.6 更新到 0.8.6,似乎指定默认“运行”配置的功能已被删除(或者移动到我需要帮助查找的位置)。我能够在调试或发布模式下生成签名的 APK(生成向导已更改为允许我此时选择构建变体)但似乎无法找到如何为一般选择构建变体采用。换句话说,当我单击“运行”时,当我需要运行 assembleDebug 时,gradle 会执行 assembleRelease。知道如何改变这个吗?
编辑:当我选择“调试”而不是“运行”时,gradle 仍然选择运行assembleRelease,所以我收到此错误
Cannot debug application com.caseybrooks.scripturememory on device lge-vs985_4g-VS9854Gc824b3f1.
This application does not have the debuggable attribute enabled in its manifest.
If you have manually set it in the manifest, then remove it and let the IDE automatically assign it.
If you are using Gradle, make sure that your current variant is debuggable.
但是,如果我将 debuggable="true" 属性添加到我的清单中,则构建会失败。我的 build.gradle 是否正确?
apply plugin: 'android'
android {
compileSdkVersion 19
buildToolsVersion '19.1.0'
defaultConfig {
minSdkVersion 8
targetSdkVersion 19
}
signingConfigs {
release {
storeFile file('C:/Users/Casey/Documents/android/scripturememory/scripturememory_keystore')
keyAlias 'scripturememory_keystore'
storePassword '***********'
keyPassword '**********'
}
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
signingConfig signingConfigs.release
}
}
productFlavors {
}
sourceSets {
main {
java.srcDirs = ['src/main/java']
}
}
}
dependencies {
compile project(':library')
compile project(':AndroidBibleTools')
compile 'com.android.support:appcompat-v7:19.+'
}
【问题讨论】:
-
您要找的是build options menu吗?
-
不,我没有在该菜单中看到任何更改构建变体的选项。
标签: android gradle android-studio