android - 清理项目时自动创建已签名的 APK

标签 android android-studio android-gradle-plugin apk

我使用的是 Android Studio 1.5.0。我在项目中没有问题。项目编译成功,运行没有问题。

But problem is when i try to clean my project, it automatically generates signed APK. No matter how many times i clean, it always generates a signed APK. I'm not aware how does this happen. And also when i click on any options under build it automatically generates the Signed APK.

但之前我使用的是 1.3 android studio 版本。一切正常的地方。

这是IDE的bug还是需要配置一些设置。任何帮助表示赞赏。

已编辑:添加了 Gradle 信息

apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'


android {
    compileSdkVersion 23
    buildToolsVersion "23.0.3"
    defaultConfig {
        applicationId "com.example.com"
        minSdkVersion 15
        targetSdkVersion 22
        versionCode 6
        versionName "1.5"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    productFlavors
            {
            }

    packagingOptions {
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:23.0.1'
    compile 'com.android.support:design:23.0.1'
}

最佳答案

这不是错误。您的构建变体设置为发布,因此您必须将其设置回 Debug模式,如下图所示

从 Android Studio 屏幕的左下方访问构建变体选项。

关于android - 清理项目时自动创建已签名的 APK,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36420795/

相关文章:

android - 如何在 Android Studio 中生成具有自定义名称的输出 APK 文件?

android - 如何在 Android Studio 中的文件中搜索方法

Android Studio 3.0.1 显示模拟器 : Process finished with exit code 1

android - Jenkins 提供的 SDK 目录不存在

android - 使用新的 Camera API 捕捉高帧率视频

android - Android Studio 中的错误,除非我每次都构建/清理

android - 无法添加 FCM : failed to resolve com. google.firebase :firebase-auth:9. 0.2,尽管我已经更新了我的 google play 服务

java - 如何为Android Activity制作图标?

Android SoundPool 在播放另一种声音之前不会第二次播放相同的声音

java - 删除 View 列表中的特定 View