首页 > 解决方案 > 如何使用 Android 版本构建具有更高 minSdkVersion 的排毒测试 - - React-Native

问题描述

我想使用 Detox 进行 React-native e2e 测试,这需要 minSdkVersion 为 18,但我的应用程序是 16。我还没有准备好为我的应用程序升级到 18,所以我想使用 android 风格为排毒测试和另一个用于生产。这是我到目前为止所做的:在 app/build.gradle 中:

flavorDimensions "version"
    productFlavors {
        detox {
            // Assigns this product flavor to the "version" flavor dimension.
            // If you are using only one dimension, this property is optional,
            // and the plugin automatically assigns all the module's flavors to
            // that dimension.
            dimension "version"
            versionNameSuffix "-detox"
            minSdkVersion 18
        }
        prod {
            dimension "version"
            versionNameSuffix "-prod"
            minSdkVersion 16
        }
    }

现在在 android studio 我有 4 个构建变体: detoxDebug 正在同步,但 productionDebug 给出了这个错误:

在此处输入图像描述

谢谢!

标签: androidreact-nativebuild.gradledetoxandroid-flavors

解决方案


推荐阅读