Android报错 Executing tasks: [:app:assembleDebug] 解决

本文详细介绍了在软件开发过程中遇到的一个常见问题:应用程序在打包后无法正常运行的情况。文章指出,在尝试运行已打包的应用时,可能会遇到Executing tasks: [:app:assembleDebug]的错误提示。为了解决这一问题,作者建议检查IDE中是否选择了正确的运行配置,通常情况下,将运行配置从打包任务改为应用运行即可解决问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

打包前可正常运行,打包后不能运行了,报错Executing tasks: [:app:assembleDebug]:
看一下右上角是不是跑成打包任务了:
在这里插入图片描述
(这是打包任务,要改成app运行你原来的程序)

在这里插入图片描述
(下拉改成app,就可以正常运行了)

: /home/dxdragon/AndroidStudioProjects/AIDL_Test/app/src/main/java/com/example/mainapp/MainAppService.java使用或覆盖了已过时的 API。 注: 有关详细信息, 请使用 -Xlint:deprecation 重新编译。 > Task :app:processDebugJavaRes > Task :app:dexBuilderDebug > Task :app:bundleDebugClassesToCompileJar > Task :app:bundleDebugClassesToRuntimeJar > Task :app:mergeProjectDexDebug > Task :app:mergeDebugJavaResource > Task :otherapp:mergeLibDexDebugAndroidTest > Task :otherapp:mergeLibDexDebug > Task :app:mergeExtDexDebug > Task :app:compileDebugUnitTestKotlin > Task :app:compileDebugUnitTestJavaWithJavac NO-SOURCE > Task :app:assembleDebugUnitTest > Task :app:compileDebugAndroidTestKotlin > Task :app:compileDebugAndroidTestJavaWithJavac NO-SOURCE > Task :app:processDebugAndroidTestJavaRes > Task :app:dexBuilderDebugAndroidTest > Task :app:mergeProjectDexDebugAndroidTest > Task :app:mergeDebugAndroidTestJavaResource > Task :app:packageDebug > Task :app:createDebugApkListingFileRedirect > Task :app:assembleDebug > Task :app:packageDebugAndroidTest > Task :app:createDebugAndroidTestApkListingFileRedirect > Task :app:assembleDebugAndroidTest > Task :otherapp:mergeExtDexDebug FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':otherapp:processDebugResources'. > A failure occurred while executing com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask$TaskAction > Unable to make AAPT link command ERROR: AAPT: * Try: > Run with --stacktrace option to get the stack trace. > Run with --info or --debug option to get more log output. > Run with --scan to get full insights. > Get more help at https://help.gradle.org. BUILD FAILED in 4s 110 actionable tasks: 108 executed, 2 up-to-date
最新发布
06-27
Executing tasks: [:app:assembleDebug] in project D:\Users\lenovo\AndroidStudioProjects\Pinduoduo WARNING: The specified Android SDK Build Tools version (27.0.0) is ignored, as it is below the minimum supported version (28.0.3) for Android Gradle Plugin 3.5.2. Android SDK Build Tools 28.0.3 will be used. To suppress this warning, remove "buildToolsVersion '27.0.0'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools. > Task :app:preBuild UP-TO-DATE > Task :app:preDebugBuild UP-TO-DATE > Task :app:checkDebugManifest UP-TO-DATE > Task :app:generateDebugBuildConfig UP-TO-DATE > Task :app:javaPreCompileDebug UP-TO-DATE > Task :app:mainApkListPersistenceDebug UP-TO-DATE > Task :app:generateDebugResValues UP-TO-DATE > Task :app:createDebugCompatibleScreenManifests UP-TO-DATE > Task :app:mergeDebugShaders UP-TO-DATE > Task :app:compileDebugShaders UP-TO-DATE > Task :app:generateDebugAssets UP-TO-DATE > Task :app:compileDebugRenderscript NO-SOURCE > Task :app:compileDebugAidl NO-SOURCE > Task :app:generateDebugResources UP-TO-DATE > Task :app:mergeDebugResources UP-TO-DATE > Task :app:processDebugManifest > Task :app:processDebugResources FAILED AGPBI: {"kind":"error","text":"Android resource linking failed","sources":[{"file":"D:\\Users\\lenovo\\AndroidStudioProjects\\Pinduoduo\\app\\src\\main\\res\\layout\\activity_main.xml","position":{"startLine":34}}],"original":"D:\\Users\\lenovo\\AndroidStudioProjects\\Pinduoduo\\app\\src\\main\\res\\layout\\activity_main.xml:35: AAPT: error: '#875ale' is incompatible with attribute textColor (attr) reference|color.\n ","tool":"AAPT"} FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:processDebugResources'. > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade > Android resource linking failed D:\Users\lenovo\AndroidStudioProjects\Pinduoduo\app\src\main\res\layout\activity_main.xml:35: AAPT: error: '#875ale' is incompatible with attribute textColor (attr) reference|color. * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. * Get more help at https://help.gradle.org BUILD FAILED in 3s 11 actionable tasks: 2 executed, 9 up-to-date
06-07
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值