Closed anonyein closed 2 days ago
flavorDimensions = ["abi"]
productFlavors { private final NamedDomainObjectContainer<ProductFlavor> _productFlavors ->
universal { private final ProductFlavor _productFlavor ->
isDefault true
dimension "abi"
//If you want to have a universal fat apk, you NEED to put the abiFilters here and not in the defaultConfig.
//Otherwise, all assets for all ABIs will be included in all other specialized product flavors.
//I had this configuration unknowingly for the past year (even thought it was a bug in Chaquopy, check my other issues)
//It was a nightmare to finally figure it out, so I am really glad to be able to help here
ndk { private final NdkOptions _ndkOptions ->
abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64"
}
}
arm32 { private final ProductFlavor _productFlavor ->
dimension "abi"
ndk { private final NdkOptions _ndkOptions ->
//noinspection ChromeOsAbiSupport
abiFilters "armeabi-v7a"
}
}
arm64 { private final ProductFlavor _productFlavor ->
dimension "abi"
ndk { private final NdkOptions _ndkOptions ->
//noinspection ChromeOsAbiSupport
abiFilters "arm64-v8a"
}
}
x86 { private final ProductFlavor _productFlavor ->
dimension "abi"
ndk { private final NdkOptions _ndkOptions ->
//noinspection ChromeOsAbiSupport
abiFilters "x86"
}
}
amd64 { private final ProductFlavor _productFlavor ->
dimension "abi"
ndk { private final NdkOptions _ndkOptions ->
//noinspection ChromeOsAbiSupport
abiFilters "x86_64"
}
}
}
Hope that solves it for you :) Oh and by the way, you can remove the whole sourceSets
block and the --extra-index-url
argument since you're just redefining the Chaquopy defaults there. I wish you all the best bro
it seems that in the gradle-7.5.1, class "ProductFlavor" and "ProductFlavor" can not be found
You can just add this at the top of the file or remove those variables entirely:
import com.android.build.gradle.internal.dsl.NdkOptions
import com.android.build.gradle.internal.dsl.ProductFlavor
You can just add this at the top of the file or remove those variables entirely:
import com.android.build.gradle.internal.dsl.NdkOptions import com.android.build.gradle.internal.dsl.ProductFlavor
Thanks for your help!
Chaquopy version
15.0.1
Relevant parts of your build.gradle file
Describe your issue
Could the assets files be abi filtered? The size of app is too large when the requirement file contains many modules?
the requirements imys could be abi filtered?