У меня возникла странная проблема, которая только что началась с существующим проектом Android Studio 2.3.3.
Процесс сборки не генерирует автоматически APK, в данном случае приложение -debug.apk Журнал показывает, что сборка прошла успешно, но в дереве каталогов проекта нет APK. Однако выбор Build / Build APK вручную работает нормально.
Это проблема, когда я меняю источник и нажимаю «Выполнить». Процесс сборки прошел успешно, но затем в эмуляторе появляется сообщение «Ошибка установки APK» (поскольку APK не существует).
Эта проблема возникает только в одном проекте, и раньше я играл с Эспрессо. Я предполагаю, что я где-то изменил настройку, только не могу понять, какую именно. Что мне нужно изменить, чтобы APK снова создавался автоматически? build.gradle включен.
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
defaultConfig {
applicationId "com.example.myapp"
minSdkVersion 16
targetSdkVersion 25
versionCode 2
versionName "0.0.2"
vectorDrawables.useSupportLibrary = true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
signingConfigs {
release {
storeFile file("/home/user/keystore/keystore.jks")
storePassword "xxxxxxxxxxxxxxxxxx"
keyAlias "xxxxxxxxxxxxxxxxx"
keyPassword "xxxxxxxxxxxxxxxxxxx"
}
}
buildTypes {
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}
}
lintOptions {
abortOnError false
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.google.android.gms:play-services-ads:10.2.4'
compile 'com.google.android.gms:play-services-location:10.2.4'
testCompile 'junit:junit:4.12'
}
Подробнее здесь: https://stackoverflow.com/questions/462 ... rating-apk