Tôi vừa cập nhật Android Studio từ 0,6 lên 0,8,6 và có vẻ như khả năng chỉ định cấu hình "chạy" mặc định đã bị xóa (hoặc chuyển sang vị trí tôi cần giúp tìm). Tôi có thể tạo APK đã ký bằng chế độ gỡ lỗi hoặc chế độ phát hành (thuật sĩ tạo đã được thay đổi để cho phép tôi chọn biến thể xây dựng tại thời điểm này) nhưng dường như không thể tìm hiểu cách chọn biến thể xây dựng cho chung sử dụng. Nói cách khác, khi tôi nhấp vào "chạy" gradle thực hiện assembleRelease
khi tôi cần phải chạy assembleDebug
. Bất kỳ ý tưởng làm thế nào để thay đổi điều này?Android Studio 0.8.6 thay đổi biến thể xây dựng mặc định
EDIT: Khi tôi chọn "gỡ rối" thay vì "chạy" gradle vẫn chọn để chạy assembleRelease
, vì vậy tôi nhận được lỗi này
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.
Tuy nhiên, nếu tôi thêm các thuộc tính debuggable="true"
để biểu hiện của tôi, xây dựng không thành công. Build.gradle của tôi có đúng không?
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.+'
}
Đây có phải là [menu tùy chọn xây dựng] (http://prntscr.com/4i1h6j) mà bạn đang tìm kiếm không? – Zyerah
Không, tôi không thấy bất kỳ tùy chọn nào để thay đổi biến thể xây dựng trong menu đó. – cjbrooks12