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