Android studio导入eclipse项目遇到的错误解决方案

Error:Execution failed for task ':app:compileDebugJavaWithJavac'. > Compilation failed; see the compiler error output for details.

在控制台输入
gradlew compileDebugSources --stacktrace -info  

在打印的log中找到问题

Android studio导入eclipse项目遇到的错误解决方案

发现是缺少一些类的问题

Error running app: Default Activity Not Found

1、打开配置

Android studio导入eclipse项目遇到的错误解决方案

Android studio导入eclipse项目遇到的错误解决方案

将default Activity换成Nothing即可

Annotation processors must be explicitly declared now.

导入的项目中用到的butter knife报错

Error:Execution failed for task ':app:javaPreCompileDebug'.
> Annotation processors must be explicitly declared now. The following dependencies on the compile classpath are found to contain annotation processor. Please add them to the annotationProcessor configuration.
- butterknife-7.0..jar
Alternatively, set android.defaultConfig.javaCompileOptions.annotationProcessorOptions.includeCompileClasspath = true to continue with previous behavior. Note that this option is deprecated and will be removed in the future.
See https://developer.android.com/r/tools/annotation-processor-error-message.html for more details.

解决方法:

在build.gradle中添加如下配置

android {
...
defaultConfig {
...
javaCompileOptions { annotationProcessorOptions { includeCompileClasspath = true } }
}
...
}

上一篇:为Apache配置虚拟机Virtual Host


下一篇:Spring注解实例