Android Studio-任务':app:compileDebugJavaWithJavac'的执行失败 [英] Android Studio - Execution failed for task ':app:compileDebugJavaWithJavac'

查看:1732
本文介绍了Android Studio-任务':app:compileDebugJavaWithJavac'的执行失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行带有Android Studio 2.3.2和Gradle 3.3的Ubuntu 16.04.我刚刚下载了android studio并做了一个项目.该项目的目标是Android KitKat.当我尝试运行它时,它给出错误提示:任务':app:compileDebugJavaWithJavac'的执行失败..."

I am running Ubuntu 16.04 with Android Studio 2.3.2 and Gradle 3.3. i just downloaded android studio and made a project. The target of the project is Android KitKat. When I try to run it, it gives and error saying "Execution failed for task ':app:compileDebugJavaWithJavac'..."

我刚刚创建了这个项目,还没有添加任何代码.

I just created this project and have not added any code.

完整错误屏幕截图:

Full Error Screenshot:

推荐答案

经过长时间的搜索,我终于找到了原因和解决方法.

After a long search, I finally found the cause and the solution.

原因:

该问题是由自动安装的ntfs硬盘引起的.我将所有项目文件都保存在一个ntfs分区中,但是Ubuntu将该ntfs分区识别为可移动设备(例如USB).

Cause:

The problem was caused by an automatically mounted ntfs hard disk. I saved all my projects files in an ntfs partition, but Ubuntu recognized the ntfs partition as a removable device (e.g. USB).

解决方案:

1.运行sudo umount <name of the drive (e.g. /dev/sda1)>卸载有问题的驱动器.
2.运行sudo cp /etc/fstab /etc/fstab.backup备份fstab.
3.使用任何文本编辑器打开/etc/fstab.

在这里,找到指定您的ntfs分区的行. 该行应如下所示:

Solution:

1. Run sudo umount <name of the drive (e.g. /dev/sda1)> to unmount the drive in problem.
2. Run sudo cp /etc/fstab /etc/fstab.backup to make a backup of fstab.
3. Open /etc/fstab with any text editor.

Here, find the line that specifies your ntfs partition. The line should look like this:

UUID=<16 digit uuid>    <something>     ntfs    defaults,umask=007,gid=46              0      0

defaults,umask=007,gid=46之后添加errors=remount-ro,uid=1000
因此,更改后,它将如下所示:

Add errors=remount-ro,uid=1000 after defaults,umask=007,gid=46
So after the change, it will look like this:

UUID=<16 digit uuid>    <something>     ntfs    defaults,umask=007,gid=46,errors=remount-ro,uid=1000    0      0

  1. 重新启动系统

现在,gradle不再应该给出执行失败的错误.

Now, gradle should not give the execution failed error anymore.

这篇关于Android Studio-任务':app:compileDebugJavaWithJavac'的执行失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆