简体   繁体   中英

Multiple build variants with cpu architectures in Android Studio

I'm setting up Product Flavor in Android Studio ,there is created multiple build variants in studio

like

FlavourDebug1-armeabi-v7a

FlavourDebug1-arm64-v8a

FlavourDebug1-x86

FlavourDebug1-x86_64

FlavourRelease1-armeabi-v7a

FlavourRelease1-arm64-v8a

FlavourRelease1-x86

FlavourRelease1-x86_64

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

How to remove that and only get

Debug

Release

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

    }
}

remove code like this from your 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
        }
    }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM