Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

    }
}
like image 327
Gaurav Avatar asked May 28 '26 14:05

Gaurav


1 Answers

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
        }
    }
like image 200
akshay_shahane Avatar answered May 30 '26 07:05

akshay_shahane



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!