uni-app 打包无法指定SDK
uni-app 打包无法指定SDK
产品分类:
uniapp/App
PC开发环境操作系统:
Windows
PC开发环境操作系统版本号:
11
HBuilderX类型:
正式
HBuilderX版本号:
3.99
手机系统:
Android
手机系统版本号:
Android 13
手机厂商:
小米
手机机型:
V1809T
页面类型:
vue
vue版本:
vue2
打包方式:
云端
项目创建方式:
HBuilderX
示例代码:
Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01
Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/03 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/03 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/03 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
Warning: unexpected element (uri:"", local:“extension-level”). Expected elements are {}codename,{}layoutlib,{}api-level
Warning: unexpected element (uri:"", local:“base-extension”). Expected elements are {}codename,{}layoutlib,{}api-level
FAILURE: Build failed with an exception.
- What went wrong: Execution failed for task ‘:app:checkReleaseAarMetadata’.
A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction
The minCompileSdk (34) specified in a
dependency’s AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
is greater than this module’s compileSdkVersion (android-33).
Dependency: androidx.core:core-ktx:1.12.0.
AAR metadata file: /srv/.gradle/caches/transforms-3/83dc013eb01532e7fc5e1200f187aa33/transformed/jetified-core-ktx-1.12.0/META-INF/com/android/build/gradle/aar-metadata.properties.
- Try:
Run with --debug option to get more log output.
Run with --scan to get full insights.
- Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ‘:app:checkReleaseAarMetadata’.
…
操作步骤:
重复打包一样
预期结果:
打包成功
实际结果:
打包失败
bug描述:
使用自定义原生插件的时候,引入某个依赖库后,打包出错
在使用 uni-app 进行打包时,如果你无法指定 SDK,可能是因为你没有正确配置相关的构建环境或参数。以下是一些可能的解决方案和建议,帮助你解决这个问题:
1. 检查 uni-app 版本
确保你使用的是最新版本的 uni-app。旧版本可能不支持某些配置或功能。你可以通过以下命令更新 uni-app:
npm update -g [@vue](/user/vue)/cli [@dcloudio](/user/dcloudio)/uni-cli