?Android studio?离线打包uniapp( HbuilderX版本3.1.22.20210709)
报错:
Execution failed for task ':app:mergeReleaseResources'.
> A failure occurred while executing com.android.build.gradle.internal.res.Aapt2CompileRunnable
> Could not isolate value com.android.build.gradle.internal.res.Aapt2CompileRunnable$Params_Decorated@5d480023 of type Aapt2CompileRunnable.Params
> Could not resolve all files for configuration ':app:detachedConfiguration1'.
> Could not download aapt2-4.2.1-7147631-windows.jar (com.android.tools.build:aapt2:4.2.1-7147631): No cached version available for offline mode
解决办法:
build.gradle(:app)中添加
aaptOptions.cruncherEnabled = false
aaptOptions.useNewCruncher = false
android {
compileSdkVersion 30
buildToolsVersion '30.0.3'
defaultConfig {
applicationId "xxxx"
minSdkVersion 21
targetSdkVersion 30
//解决Execution failed for task ':app:mergeReleaseResources'.
aaptOptions.cruncherEnabled = false
aaptOptions.useNewCruncher = false
}
|