简体   繁体   English

我的新版本变体的APK在哪里?

[英]Where is the apk for my new build variant?

I read the "Build System" section of the android docs: http://developer.android.com/sdk/installing/studio-build.html 我阅读了android文档的“构建系统”部分: http : //developer.android.com/sdk/installing/studio-build.html

So a build variant is composed of a product_flavor-build_type. 因此,构建变体由product_flavor-build_type组成。 I have this build.gradle: 我有这个build.gradle:

buildTypes {
    debug {
        applicationIdSuffix '.debug'
        debuggable true
        minifyEnabled !skipProguard
        shrinkResources true
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        signingConfig signingConfigs.debug
        zipAlignEnabled false
    }
    debugtest {
        // unit tests
        applicationIdSuffix '.test'
        debuggable true
        minifyEnabled false
        shrinkResources true
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        signingConfig signingConfigs.debug
        zipAlignEnabled false
    }
    release {
        minifyEnabled true
        shrinkResources true
        debuggable false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        signingConfig signingConfigs.release
    }
}

productFlavors {
    internal {
        applicationId "${project.applicationId}.internal"
        buildConfigField 'boolean', 'EXPERIMENTAL', 'true'
        buildConfigField 'boolean', 'FAKE_HTTP_RESPONSE', 'false'
    }
    production {
        applicationId project.applicationId
        buildConfigField 'boolean', 'EXPERIMENTAL', 'false'
        buildConfigField 'boolean', 'FAKE_HTTP_RESPONSE', 'false'
    }
    automation {
        applicationId "${project.applicationId}.automation"
        buildConfigField 'boolean', 'EXPERIMENTAL', 'true'
        buildConfigField 'boolean', 'FAKE_HTTP_RESPONSE', 'true'
    }
}

I'd like to create mobile-debug-automation-unaligned.apk so that I can use the "FAKE_HTTP_RESPONSE" BuildConfig variable in a dagger module. 我想创建mobile-debug-automation-unaligned.apk,以便可以在Dagger模块中使用“ FAKE_HTTP_RESPONSE” BuildConfig变量。

But when I click on "Build Variants" in Android Studio I see one build variant-"internalDebug". 但是,当我在Android Studio中单击“构建变体”时,我看到一个构建变体-“ internalDebug”。 I expected to see 9 build variants(buildType * productFlavor). 我希望看到9个构建变体(buildType * productFlavor)。

Looking in my project directories, I see the following apks: 在我的项目目录中,我看到以下apk:

MY_APP/mobile: mobile-release.apk, mobile-debug-unaligned.apk MY_APP /移动设备:mobile-release.apk,mobile-debug-unaligned.apk

MY_APP/mobile/build/outputs/apk: mobile-internal-debug-unaligned.apk MY_APP / mobile / build / outputs / apk:mobile-internal-debug-unaligned.apk

How do I generate my new "automation" apk? 如何生成新的“自动化” apk?

Plz click on it to change: 请点击以更改:

在此处输入图片说明

If it doesn't work, rebuild your project. 如果不起作用,请重新构建您的项目。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Flutter 仅构建一个 apk 变体 - Flutter only build one apk variant 可以构建自动生成的调试构建变体 apk,但不能构建自定义构建变体 apk - Can build auto generated debug build variant apk, but not a custom build variant apk 使用 ./addSecurityExceptions.sh 后我的新 apk 在哪里? - Where is my new apk after using ./addSecurityExceptions.sh? Android Studio陈旧APK for xml更改后的构建变体 - Android Studio stale APK for build variant after xml changes 在Android中发布使用Proguard和build-variant构建APK时出现错误 - Getting error when build apk using proguard and build-variant is release in android 我的设备上的APK安装在哪里? - where is my apk installed on my device? 无法引用在Android中的新构建变体下添加的字符串 - Unable to reference strings added under a new build variant in Android Firebase 应用分发 - 找不到 APK。 确保首先通过运行构建。/gradlew assemble[Variant] - Firebase App Distribution - Could not find the APK. Make sure you build first by running ./gradlew assemble[Variant] 使用 maven-publish 发布 Android apk 和 aar with build variant (Android Gradle plugin 4.0) - Use maven-publish to publish Android apk and aar with build variant (Android Gradle plugin 4.0) 尝试为我的应用程序构建apk时出错 - error when trying to build the apk for my app
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM