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

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

 

 

 






 

posted @ 2018-08-30 15:17  Sharley  阅读(444)  评论(0编辑  收藏  举报