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
}
}
Related
[][1]
{
android {
compileSdkVersion 31
buildToolsVersion "30.0.3"
defaultConfig {
applicationId "com.example.test"
minSdkVersion 19
targetSdkVersion 30
versionCode 64
if (taggedRelease == null) {
versionName "1.4.1-SNAPSHOT"
} else {
versionName = taggedRelease
}
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
signingConfigs {
release
}
flavorDimensions "abi"
productFlavors {
x64 {
dimension "abi"
versionCode 30000 + android.defaultConfig.versionCode
versionNameSuffix "-x86_64"
ndk {
abiFilters "x86_64","armeabi","arm64-v8a", "armeabi-v7a", "x86"
}
}
arm {
dimension "abi"
versionCode 10000 + android.defaultConfig.versionCode
versionNameSuffix "-arm"
ndk {
abiFilters "armeabi-v7a","armeabi","arm64-v8a", "armeabi-v7a", "x86"
}
}
arm64 {
dimension "abi"
versionCode 20000 + android.defaultConfig.versionCode
versionNameSuffix "-arm64"
ndk {
abiFilters "arm64-v8a","armeabi","arm64-v8a", "armeabi-v7a", "x86"
}
}
}
}
any one can you please help me to resolve this error
[1]: https://i.stack.imgur.com/hwYbM.png
I tried the traditional generation of app bundle (.aab) without signature like we do for '.apk' using android studio menu option : Build >> Build bundle(s)/Apk(s) >> Build bundle(s).
Normally, it should generate an '.aab' file and the name of the file should contains the prefix 'unsigned' like in the '.apk' file generated in same way but it doesn't exists.
When I deliver this .aab file to my client, he say to me that the file is signed.
My Gradle file :
android {
compileSdkVersion compile_sdk_version
buildToolsVersion build_tools_version
defaultConfig {
applicationId "com.**"
minSdkVersion min_sdk_version
targetSdkVersion compile_sdk_version
multiDexEnabled true
vectorDrawables.useSupportLibrary = true
renderscriptTargetApi min_sdk_version
renderscriptSupportModeEnabled true
dexOptions {
javaMaxHeapSize "4g"
}
}
kapt {
correctErrorTypes true
}
flavorDimensions "default"
productFlavors {
production {
dimension 'default'
versionCode rootProject.ext.version_code_production
versionName rootProject.ext.version_name_production
}
stagging {
dimension 'default'
versionCode rootProject.ext.version_code_stagging
versionName rootProject.ext.version_name_stagging
}
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
debug {
applicationIdSuffix ".debug"
}
qualif {
applicationIdSuffix ".re7"
}
}
compileOptions {
// Flag to enable support for the new language APIs
coreLibraryDesugaringEnabled true
// Sets Java compatibility to Java 11
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_11.toString()
}
buildFeatures {
dataBinding true
viewBinding true
}
}
dependencies {
..
}
}
How should I generate one without signature ?
Note: in gradle, I eleminate every signature declaration.
gradlew bundleRelease
Make sure that signingConfig in release build type is commented out
Everything compiled well and my apk is built, but at runtime I get this error:
java.lang.UnsatisfiedLinkError: dlopen failed: library "../../../../libs/x86/mylib.so" not found
I tried to extract the apk and check libs/x86 folder and the .so is there.
My android field at app/build.gradle is:
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.example.test"
minSdkVersion 21
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
externalNativeBuild {
cmake {
cppFlags ""
}
}
ndk {
abiFilters "x86"
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
sourceSets {
main {
jniLibs.srcDirs = ['libs']
}
}
externalNativeBuild {
cmake {
path "CMakeLists.txt"
}
}
}
I had a project with this package name : applicationId 'com.safa.auditzanjan'
Now I have created a flavour into other same project and I have added those project into this project. this new package name's project is:applicationId "com.safa.auditkhoramabad".
how could I set older package Name to this flavour?Thats mean I want to do override com.safa.auditkhoramabad for my new flavour to com.safa.auditzanjan?
***EDIT***********
this is my Independent gradle config project:
defaultConfig {
applicationId 'com.safa.auditzanjan'
minSdkVersion 15
targetSdkVersion 25
multiDexEnabled true
versionCode 56
versionName '1.8.56'
}
dexOptions {
jumboMode = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
applicationIdSuffix '.debug'
versionNameSuffix '-debug'
}
}
productFlavors {
main {
signingConfig signingConfigs.SigningConfig1
}
ts {
signingConfig signingConfigs.SigningConfig1
applicationIdSuffix ".ts"
versionNameSuffix "-ts"
}
}
this is flavour gradle config:
zanjan {
applicationId 'com.safa.auditzanjan'
signingConfig signingConfigs.SigningConfig1
applicationIdSuffix ".zanjan"
versionNameSuffix "-zanjan"
versionCode 56
versionName '1.8.56'
resValue( "string", "app_name", "ممیزی زنجان")
}
You should be able to do something like following
productFlavors {
flavor1 {
applicationId "com.safa.auditzanjan"
}
flavor2 {
applicationId "com.safa.auditkhoramabad"
}
If I have a build.gradle for an application:
android {
compileSdkVersion 24
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.ndkcmaketest.headwayent.ndkcmaketest"
minSdkVersion 19
targetSdkVersion 24
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
externalNativeBuild {
cmake {
cppFlags "-frtti -fexceptions"
arguments "-DANDROID_ARM_NEON=TRUE", "-DANDROID_TOOLCHAIN=gcc"//, "-DANDROID_ALLOW_UNDEFINED_SYMBOLS=TRUE"
}
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
externalNativeBuild {
cmake {
path "CMakeLists.txt"
}
}
}
How do I add cpufeatures as ldlibs? Adding ldLibs.addAll(["cpufeatures"]) in externalNativeBuild does not work. And neither adding in an ndk block.
Do you have to add this to build.gradle specifically? If not, add the following to one of your CMakeLists.txt files:
include(AndroidNdkModules)
android_ndk_import_module_cpufeatures()
Then you can target_link_libraries(<your target>, cpufeatures).
That macro and a couple of others are defined in $ANDROID_SDK/cmake/<cmake-version>/share/cmake-<version>/Modules/AndroidNdkModules.cmake.