Android Studio 3.0 最新版本运行报错: Task 'package' is ambiguous in root project 'MyRobot'. Candidates are: 'packageDebug', 'packageDebugAndroidTest', 'packag

简介: 09:52:22.876 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]09:52:22.

09:52:22.876 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
09:52:22.877 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] FAILURE: Build failed with an exception.
09:52:22.877 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
09:52:22.877 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * What went wrong:
09:52:22.877 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Task 'package' is ambiguous in root project 'MyRobot'. Candidates are: 'packageDebug', 'packageDebugAndroidTest', 'packageRelease'.
09:52:22.877 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
09:52:22.877 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Try:
09:52:22.878 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Run gradle tasks to get a list of available tasks. Run with --stacktrace option to get the stack trace.
09:52:22.878 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
09:52:22.878 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Get more help at https://help.gradle.org
09:52:22.879 [ERROR] [org.gradle.internal.buildevents.BuildResultLogger]
09:52:22.879 [ERROR] [org.gradle.internal.buildevents.BuildResultLogger] BUILD FAILED in 1m 2s
09:52:22.914 [DEBUG] [org.jetbrains.kotlin.gradle.plugin.KotlinGradleBuildServices] [KOTLIN] Skipping kotlin cleanup since compiler wasn't called
09:52:22.944 [DEBUG] [org.jetbrains.kotlin.gradle.plugin.KotlinGradleBuildServices] [KOTLIN] Disposed KotlinGradleBuildServices
09:52:22.945 [DEBUG] [org.gradle.internal.work.DefaultWorkerLeaseService] Worker lease root.1 completed (0 worker(s) in use)

$ gradle tasks

Task :tasks


All tasks runnable from root project

Android tasks

androidDependencies - Displays the Android dependencies of the project.
signingReport - Displays the signing info for each variant.
sourceSets - Prints out all the source sets defined in this project.

Build tasks

assemble - Assembles all variants of all applications and secondary packages.
assembleAndroidTest - Assembles all the Test applications.
assembleDebug - Assembles all Debug builds.
assembleRelease - Assembles all Release builds.
build - Assembles and tests this project.
buildDependents - Assembles and tests this project and all projects that depend on it.
buildNeeded - Assembles and tests this project and all projects it depends on.
clean - Deletes the build directory.
cleanBuildCache - Deletes the build cache directory.
compileDebugAndroidTestSources
compileDebugSources
compileDebugUnitTestSources
compileReleaseSources
compileReleaseUnitTestSources
mockableAndroidJar - Creates a version of android.jar that's suitable for unit tests.

Build Setup tasks

init - Initializes a new Gradle build.
wrapper - Generates Gradle wrapper files.

Help tasks

buildEnvironment - Displays all buildscript dependencies declared in root project 'MyRobot'.
components - Displays the components produced by root project 'MyRobot'. [incubating]
dependencies - Displays all dependencies declared in root project 'MyRobot'.
dependencyInsight - Displays the insight into a specific dependency in root project 'MyRobot'.
dependentComponents - Displays the dependent components of components in root project 'MyRobot'. [incubating]
help - Displays a help message.
model - Displays the configuration model of root project 'MyRobot'. [incubating]
projects - Displays the sub-projects of root project 'MyRobot'.
properties - Displays the properties of root project 'MyRobot'.
tasks - Displays the tasks runnable from root project 'MyRobot' (some of the displayed tasks may belong to subprojects).

Install tasks

installDebug - Installs the Debug build.
installDebugAndroidTest - Installs the android (on device) tests for the Debug build.
uninstallAll - Uninstall all applications.
uninstallDebug - Uninstalls the Debug build.
uninstallDebugAndroidTest - Uninstalls the android (on device) tests for the Debug build.
uninstallRelease - Uninstalls the Release build.

Verification tasks

check - Runs all checks.
connectedAndroidTest - Installs and runs instrumentation tests for all flavors on connected devices.
connectedCheck - Runs all device checks on currently connected devices.
connectedDebugAndroidTest - Installs and runs the tests for debug on connected devices.
deviceAndroidTest - Installs and runs instrumentation tests using all Device Providers.
deviceCheck - Runs all device checks using Device Providers and Test Servers.
lint - Runs lint on all variants.
lintDebug - Runs lint on the Debug build.
lintRelease - Runs lint on the Release build.
lintVitalRelease - Runs lint on just the fatal issues in the release build.
test - Run unit tests for all variants.
testDebugUnitTest - Run unit tests for the debug build.
testReleaseUnitTest - Run unit tests for the release build.

To see all tasks and more detail, run gradle tasks --all

To see more detail about a task, run gradle help --task <task>

BUILD SUCCESSFUL in 2s
1 actionable task: 1 executed

相关文章
|
30天前
|
算法 数据处理 Android开发
掌握安卓性能优化的秘诀:电池寿命与运行效率的提升
【10月更文挑战第6天】 本文深入探讨了安卓应用开发中的性能优化技巧,重点分析了影响电池寿命和运行效率的关键因素,并提供了针对性的优化策略。通过代码优化、资源管理、后台任务处理等方法,开发者可以显著提升应用的续航能力和流畅度。同时,结合具体案例,展示了如何在实际开发中应用这些技巧,确保应用在各种场景下都能保持高效运行。本文旨在为安卓开发者提供实用的性能优化指导,助力其打造更优质的应用体验。
37 2
|
3月前
|
Java Android开发 C++
Android Studio JNI 使用模板:c/cpp源文件的集成编译,快速上手
本文提供了一个Android Studio中JNI使用的模板,包括创建C/C++源文件、编辑CMakeLists.txt、编写JNI接口代码、配置build.gradle以及编译生成.so库的详细步骤,以帮助开发者快速上手Android平台的JNI开发和编译过程。
223 1
|
1月前
|
Java Unix Linux
Android Studio中Terminal运行./gradlew clean build提示错误信息
遇到 `./gradlew clean build`命令执行出错时,首先应检查错误信息的具体内容,这通常会指向问题的根源。从权限、环境配置、依赖下载、版本兼容性到项目配置本身,逐一排查并应用相应的解决措施。记住,保持耐心,逐步解决问题,往往复杂问题都是由简单原因引起的。
178 2
|
2月前
|
XML IDE 开发工具
🔧Android Studio高级技巧大公开!效率翻倍,编码不再枯燥无味!🛠️
【9月更文挑战第11天】在软件开发领域,Android Studio凭借其强大的功能成为Android开发者的首选IDE。本文将揭示一些提升开发效率的高级技巧,包括自定义代码模板、重构工具、高级调试技巧及多模块架构。通过对比传统方法,这些技巧不仅能简化编码流程,还能显著提高生产力。例如,自定义模板可一键插入常用代码块;重构工具能智能分析并安全执行代码更改;高级调试技巧如条件断点有助于快速定位问题;多模块架构则提升了大型项目的可维护性和团队协作效率。掌握这些技巧,将使你的开发之旅更加高效与愉悦。
63 5
|
3月前
|
编解码 Android开发
【Android Studio】使用UI工具绘制,ConstraintLayout 限制性布局,快速上手
本文介绍了Android Studio中使用ConstraintLayout布局的方法,通过创建布局文件、设置控件约束等步骤,快速上手UI设计,并提供了一个TV Launcher界面布局的绘制示例。
54 1
|
3月前
|
Android开发
Android Studio: 解决Gradle sync failed 错误
本文介绍了解决Android Studio中出现的Gradle同步失败错误的步骤,包括从`gradle-wrapper.properties`文件中获取Gradle的下载链接,手动下载Gradle压缩包,并替换默认下载路径中的临时文件,然后重新触发Android Studio的"Try Again"来完成同步。
1209 0
Android Studio: 解决Gradle sync failed 错误
|
3月前
|
Java Android开发 芯片
使用Android Studio导入Android源码:基于全志H713 AOSP,方便解决编译、编码问题
本文介绍了如何将基于全志H713芯片的AOSP Android源码导入Android Studio以解决编译和编码问题,通过操作步骤的详细说明,展示了在Android Studio中利用代码提示和补全功能快速定位并修复编译错误的方法。
116 0
使用Android Studio导入Android源码:基于全志H713 AOSP,方便解决编译、编码问题
|
3月前
|
Dart 开发工具 Android开发
Android Studio导入Flutter项目提示Dart SDK is not configured
Android Studio导入Flutter项目提示Dart SDK is not configured
282 4
|
3月前
|
Java 开发工具 Android开发
Android Studio利用Build.gradle导入Git commit ID、Git Branch、User等版本信息
本文介绍了在Android Studio项目中通过修改`build.gradle`脚本来自动获取并添加Git的commit ID、branch名称和用户信息到BuildConfig类中,从而实现在编译时将这些版本信息加入到APK中的方法。
65 0
|
6月前
|
Java Android开发
Android Studio的使用导入第三方Jar包
Android Studio的使用导入第三方Jar包
44 1
下一篇
无影云桌面