【发布时间】:2020-02-25 06:33:15
【问题描述】:
执行任务:项目 C:\Users\Zebranic\AndroidStudioProjects\Atoz 中的 [:app:assembleDebug]
配置项目:app registerResGeneratingTask 已弃用,使用 registerGeneratedResFolders(FileCollection) registerResGeneratingTask 已弃用,请使用 registerGeneratedResFolders(FileCollection)
任务:app:preBuild UP-TO-DATE 任务 :app:preDebugBuild UP-TO-DATE 任务:app:checkDebugManifest 任务:app:compileDebugAidl NO-SOURCE 任务 :app:compileDebugRenderscript 无源 任务:app:generateDebugBuildConfig 任务:app:mainApkListPersistenceDebug 任务:app:generateDebugResValues 任务:app:generateDebugResources 任务:app:writeDebugApplicationId
任务:app:processDebugGoogleServices 解析json文件:C:\Users\Zebranic\AndroidStudioProjects\Atoz\app\google-services.json
任务:app:javaPreCompileDebug 任务:app:createDebugCompatibleScreenManifests
任务:app:processDebugManifest C:\Users\Zebranic\AndroidStudioProjects\Atoz\app\src\main\AndroidManifest.xml:24:9-31:50 警告: activity#com.google.firebase.auth.internal.FederatedSignInActivity@android:launchMode 在 AndroidManifest.xml:24 被标记以替换其他声明,但没有其他声明存在
任务:app:mergeDebugShaders 任务:app:compileDebugShaders 任务:app:generateDebugAssets 任务:app:mergeDebugAssets 任务:app:mergeDebugResources
任务:app:processDebugResources 失败 AGPBI: {"kind":"error","text":"Android 资源链接失败","sources":[{"file":"C:\Users\Zebranic\AndroidStudioProjects\Atoz\app\src\main\ res\drawable\btntrail.xml"}],"original":"C:\Users\Zebranic\AndroidStudioProjects\Atoz\app\src\main\res\drawable\btntrail.xml:AAPT:错误:元素需要 sdk 版本至少 26 个。\n ","tool":"AAPT"}
FAILURE:构建失败并出现异常。
-
出了什么问题: 任务 ':app:processDebugResources' 执行失败。
执行 com.android.build.gradle.internal.tasks.Workers$ActionFacade 时发生故障 Android资源链接失败 C:\Users\Zebranic\AndroidStudioProjects\Atoz\app\src\main\res\drawable\btntrail.xml:AAPT:错误:元素需要至少 26 的 sdk 版本。
尝试: 使用 --stacktrace 选项运行以获取堆栈跟踪。使用 --info 或 --debug 选项运行以获得更多日志输出。运行 --scan 以获得完整的见解。
通过https://help.gradle.org获得更多帮助
在 12 秒内构建失败 14 个可操作的任务:14 个已执行
【问题讨论】:
-
你能发布你的应用级 build.gradle 文件吗?
-
android { compileSdkVersion 28 buildToolsVersion "29.0.2" defaultConfig { applicationId "vasantham.infotech.atoz" minSdkVersion 19 targetSdkVersion 28 versionCode 1 versionName "1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" }
-
您可以再次编辑问题并将其添加到问题下方。
-
我尝试了 2 天,但仍然无法获得结果,所以请帮我解决这个问题。
-
您最近几天提高了目标 SDK 版本吗?