Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby-on-rails-4/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android Dex:[项目名称]无法创建classes.Dex文件_Android_Dex - Fatal编程技术网

Android Dex:[项目名称]无法创建classes.Dex文件

Android Dex:[项目名称]无法创建classes.Dex文件,android,dex,Android,Dex,我使用IntelliJ IDEA 12.1.4,在我的项目中,我使用了几个库/项目: ActionBarSherlock ViewPagerIndicator 截击 夏洛克碎片 谷歌游戏服务 滑动菜单 epublib.jar gson.jar 我检查了SVN中的所有项目,并修复了依赖项或丢失的库,但当我尝试创建我的项目时,我总是得到: Android Dex: [Project name] Cannot create classes.dex file 没有其他警告/错误。这个项目可以在另外

我使用IntelliJ IDEA 12.1.4,在我的项目中,我使用了几个库/项目:

  • ActionBarSherlock
  • ViewPagerIndicator
  • 截击
  • 夏洛克碎片
  • 谷歌游戏服务
  • 滑动菜单
  • epublib.jar
  • gson.jar
我检查了SVN中的所有项目,并修复了依赖项或丢失的库,但当我尝试创建我的项目时,我总是得到:

Android Dex: [Project name] Cannot create classes.dex file
没有其他警告/错误。这个项目可以在另外两台电脑上运行,但在我的笔记本电脑上却不行。我无法检查其他计算机上的设置,因为我现在无法访问它们

如何解决此问题或获取更多详细信息?我不知道怎么了。 我试过:

  • 删除模块设置中的错误/警告
  • 在每个projet上设置相同的API
  • 从源代码和maven导入它们两次
  • 以管理员身份运行IntelliJ

如果项目中有工件,请尝试删除它,然后重新创建。编译签名的apk后,有时会出现相同的错误。我查看了IntelliJ使用的DX包装器代码。该代码可在上查看

查看引发错误的位置,显示以下代码块

String outFile = outputDir + File.separatorChar + "classes.dex";


if (new File(outFile).isFile()) {
    // if compilation finished correctly, show all errors as warnings
    messages.get(CompilerMessageCategory.WARNING).addAll(errors);
    errors.clear();
}
else if (errors.size() == 0) {
    errors.add("Cannot create classes.dex file");
}

问题似乎是
outputDir
没有写入classes.dex的权限。我进入了我的
项目结构
,将输出路径从
/target/idea classes
更改为
/target
,效果非常好。

找到了一个适合我的解决方案:


从项目文件夹以及内部文件夹和文件中删除“只读”属性

同一问题。不知道怎么了