Android Studio中具有CPU体系结构的多个构建变体

时间:2019-05-27 09:31:40

标签: android build cpu-architecture abi

我正在Android Studio中设置Product Flavor,在Studio中创建了多个构建变体

喜欢

FlavourDebug1-armeabi-v7a

FlavourDebug1-arm64-v8a

FlavourDebug1-x86

FlavourDebug1-x86_64

FlavourRelease1-armeabi-v7a

FlavourRelease1-arm64-v8a

FlavourRelease1-x86

FlavourRelease1-x86_64

=============

如何删除并仅获取

调试

发布

android {
compileSdkVersion 28
defaultConfig {
    applicationId "com.xxx.smart.xx.launcher"
    minSdkVersion 21
    targetSdkVersion 28
    versionCode 1
    versionName "1.0"
    multiDexEnabled true
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    externalNativeBuild {
        cmake {
            cppFlags "-std=c++14"
        }
    }
    ndk {
        abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64"
    }
    javaCompileOptions {
        annotationProcessorOptions {
            arguments = ['objectbox.debug': 'true']
        }
    }
}

buildTypes {
    debug {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
    }
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
    }
}
externalNativeBuild {
    cmake {
        path "src/main/cpp/CMakeLists.txt"
    }
}
compileOptions {
    sourceCompatibility = '1.8'
    targetCompatibility = '1.8'
}


flavorDimensions "version"
productFlavors {
    ChoiceIPTVFlavour {
        applicationId 'com.xxx.smart.xx.launcher'
        minSdkVersion 21
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        vectorDrawables.useSupportLibrary = true
        multiDexEnabled true

    }
    PurpleIPTVFlavour {
        minSdkVersion 21
        applicationId 'com.xxx.smart.xx.launcher'
        targetSdkVersion 28
        versionCode 1
        versionName '1.0'
        vectorDrawables.useSupportLibrary = true
        multiDexEnabled true

    }
}

1 个答案:

答案 0 :(得分:0)

  

从gradle中删除这样的代码

 splits {
        abi {
            enable true
            reset()

            // Specifies a list of ABIs that Gradle should create APKs for.
            include "x86", "x86_64", "armeabi-v7a", "arm64-v8a", "armeabi", "mips", "mips64"
            universalApk true //generate an additional APK that contains all the ABIs
        }
    }