android - 当我尝试运行 ionic cordova build --release android 时出现错误
问题描述
cmd中的错误
配置项目:“com.android.build.gradle.AppPlugin@1e44fb53”的“未指定”的应用程序错误“插件版本”不是有效的版本号
FAILURE:构建失败并出现异常。
- 出了什么问题:无法确定任务 ':app:lintVitalRelease' 的依赖关系。
此项目使用 AndroidX 依赖项,但未启用“android.useAndroidX”属性。在 gradle.properties 文件中将此属性设置为 true 并重试。检测到以下 AndroidX 依赖项:androidx.fragment:fragment:1.3.4、androidx.slidingpanelayout:slidingpanelayout:1.0.0、androidx.appcompat:appcompat:1.4.0-alpha03、androidx.annotation:annotation:1.3.0-alpha01 , androidx.versionedparcelable:versionedparcelable:1.1.1, androidx.customview:customview:1.0.0, androidx.swiperefreshlayout:swiperefreshlayout:1.0.0, androidx.emoji2:emoji2-views-helper:1.0.0-alpha03, androidx.lifecycle :lifecycle-viewmodel-savedstate:2.3.1, androidx.interpolator:interpolator:1.0.0, androidx.annotation:annotation-experimental:1.1.0, androidx.loader:loader:1.0.0, androidx.drawerlayout:drawerlayout:1.0 .0, androidx.collection:collection:1.1.0,
尝试:使用 --stacktrace 选项运行以获取堆栈跟踪。使用 --info 或 --debug 选项运行以获得更多日志输出。运行 --scan 以获得完整的见解。
在https://help.gradle.org获得更多帮助
BUILD FAILED in 10s Command failed with exit code 1: C:\Users\jupun\Documents\Codecanyon\ionic5GroceryeeFull_v9\done\ionic5GroceryeeFull_v9\App_code\User_app\platforms\android\gradlew cdvBuildRelease -b C:\Users\jupun\Documents\Codecanyon \ionic5GroceryeeFull_v9\done\ionic5GroceryeeFull_v9\App_code\User_app\platforms\android\build.gradle [错误] 运行子进程cordova时出错。
cordova.cmd build android --release exited with exit code 1.
这是离子 build.gradle
buildscript {
ext.kotlin_version = '1.3.50'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
//This replaces project.properties w.r.t. build settings
project.ext {
defaultBuildToolsVersion="29.0.2" //String
defaultMinSdkVersion=22 //Integer - Minimum requirement is Android 5.1
defaultTargetSdkVersion=29 //Integer - We ALWAYS target the latest by default
defaultCompileSdkVersion=29 //Integer - We ALWAYS compile with the latest by default
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
解决方案
推荐阅读
- python - 值大于范围 [-2,256] 的整数对象具有相同的“id”
- jquery - 如何在 Vue.js 3 / Vite 应用程序中将 jQuery 导入 $
- angular - 使用@truffle/contract 和 angular 连接到第三方以太坊合约
- python - 如何防止因 SSL 错误而终止
- html - 引导多个折叠项目
- php - 无法在codeigniter中使用ajax将数据保存在数据库中
- javascript - 向 API 发送数据时,为什么在 http 请求上收到错误 400?
- python - 我已经安装了 ffmpge,但得到以下 DownloadError: ERROR: ffprobe/avprobe and ffmpeg/avconv not found。请安装一个
- javascript - firebase 云消息传递在单击“允许”并手动添加服务工作人员后给出错误的 HTTP 响应代码 (404) 不起作用
- aframe - 如何在网页上嵌入 3D 模型?