您的位置:首页 > 编程语言 > Java开发

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

2018-08-30 15:17 681 查看

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

在控制台输入

gradlew compileDebugSources --stacktrace -info

在打印的log中找到问题

发现是缺少一些类的问题

Error running app: Default Activity Not Found

1、打开配置

将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.1.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 } }
}
...
}

 

 

 






 

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐