Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.

使用android studio 遇到了FAILURE: Build failed with an exception.* What went wrong:Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.> Could not create service of type AnnotationProcessorDetector using JavaGradleScopeServices.createAnnotationProcessorDetector().* Try:Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.BUILD FAILED in 1s请问这个怎么解决?

Android Studio使用中,我们可能会遇到这种问题:Error:Could not determine the dependencies of task ':app:transformClassesWithInstantRunForDebug'.

> In order to use Instant Run with this device running API 18, you must install platform 18 in your SDK。很多人一看到这个肯定要去下载API为18的SDK。如果我们拿不同版本的测试手机去安装编译apk时,同样也会出现叫你安装相对应的API,这样不符合我们想要的,不可能叫我们从最低版本一直下载到最高的版本啊!这个问题的解决办法是:打开你项目的Build.gradle中修改dependencies {classpath'com.android.tools.build:gradle:2.2.1'},我这里是2.2.1把这个值修改为2.0.0。再重新编译就会正常的运行安装App了。注意:打开的是你项目的Build.gradle,不是Module中的Build.gradle。

如果遇到不是关于需要下载对应的API的问题,只报':app:transformClassesWithInstantRunForDebug'.这个问题,那么它的解决办法是:打开File——>settings——>Build,Execution,Deplyoment——>Instant Run——>把第一个勾选的给去掉再重新编译。

去掉过后能正常的运行当前的项目,但是当你打开另外一个项目运行时有可能会运行失败。你们可以试试,如果失败的话再把这个给勾上就是了。

追问

额,我是新手,我问的和你说的还是有一点区别的
我问的是Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'

追答

嗯嗯,楼主可以参考一下我的这个,如果出入过大,我暂时也没法帮助楼主。

追问

大哥你是百度的还是真的自己会啊

温馨提示:答案为网友推荐,仅供参考
第1个回答  2017-12-13
我是用AndroidStudio 3.0.1创建新工程时创建了带有BottomNavigationLayout导致出现楼主所说问题的,as设定的编译sdk版本是27,后来又创建了一个新工程用的是EmptyActivity就可以了,compileSdkVersion是26,估计是新版as对27版本的编译工具还不兼容
第2个回答  2017-07-13
i cant help you
第3个回答  2018-03-14
试试在命令行执行
gradle --stop
有可能是之前有非正常退出

相关了解……

你可能感兴趣的内容

本站内容来自于网友发表,不代表本站立场,仅表示其个人看法,不对其真实性、正确性、有效性作任何的担保
相关事宜请发邮件给我们
© 非常风气网