Closed EternalSoySauce closed 6 years ago
You have to build an APK for each architecture and exlude the unnecessary files for each architecture.
You can accomplish this with productFlavors. Checkout this gradle sample:
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "nl.bravobit.ffmpeg.test"
minSdkVersion 16
targetSdkVersion 27
versionCode 1
versionName "1.0.1"
}
flavorDimensions "abi"
productFlavors {
x86 {
dimension "abi"
versionCode 1001 // you need different version codes to support multiple APK's in Play Store
ndk {
abiFilter "x86"
}
aaptOptions {
ignoreAssetsPattern "!arm"
}
}
armv7a {
dimension "abi"
versionCode 2001 // you need different version codes to support multiple APK's in Play Store
ndk {
abiFilter "armeabi-v7a"
}
aaptOptions {
ignoreAssetsPattern "!x86"
}
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.0.2'
implementation 'nl.bravobit:android-ffmpeg:1.1.0'
}
thx, I'll try it. Happy new year, bro. (^_^)
well, ffmpeg needs arm and x86 to support multiple phones, but the files are too large. It builds apk more than 30M. If I delete the files, the apk becomes 2.1M. How can I sovle this problem?