平时遇到的错误

Compilation failed; see the compiler error output for details.

使用 gradlew compileDebugSources 查看错误

1.Error:(1, 0) Your project path contains non-ASCII characters. This will most likely cause the build to fail on Windows. Please move your project to a different directory. See http://b.android.com/95744 for details. This warning can be disabled by using the command line flag -Dcom.android.build.gradle.overridePathCheck=true, or adding the line com.android.build.gradle.overridePathCheck=true' to gradle.properties file in the project directory.Open File


错误原因:引用项目的路径中包含中文,把项目路径换成英文就没有这个问题了。

解决方法:重新新建一个项目,项目的路径为英文。2:把现有的项目的路径修改为不包含英文的。

解决思路见:http://stackoverflow.com/questions/32171968/your-project-path-contains-non-ascii-characters-android-studio

翻译这个答案:I have the same problem.then I create a new project and the path only use English alphabet,the problem is resolved.

2.eclipse运行Android程序时出现:com.android.dx.cf.iface.ParseException: bad class file magic (cafebabe) or version

解决办法:找到Windows-->Preferences-->Java-->Compiler,修改jdk为1.7

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • Android 自定义View的各种姿势1 Activity的显示之ViewRootImpl详解 Activity...
    passiontim阅读 175,633评论 25 709
  • afinalAfinal是一个android的ioc,orm框架 https://github.com/yangf...
    passiontim阅读 15,692评论 2 45
  • Correctness AdapterViewChildren Summary: AdapterViews can...
    MarcusMa阅读 12,871评论 0 6
  • 今天天气非常晴朗,也很暖和。中午我的老奶奶来接我去她家吃饭了,老奶奶给我做的我最爱吃的馄饨,真是太美味了。在老奶奶...
    轩小豆阅读 1,703评论 0 1