Gradle依赖项不起作用(无法导入) [英] Gradle dependencies not working (Cannot import)

查看:1022
本文介绍了Gradle依赖项不起作用(无法导入)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此屏幕截图显示了我的gradle构建文件

这显示了我的主类,我正在使用该类

所以我想做的是通过gradle将OKHTTP客户端库导入到我的项目中,我已经包含了依赖项编译语句和mavencentral存储库,但是不知何故它没有显示在我的主文件中.似乎也正确的gradle文件.

So what im trying to do is import the OKHTTP client lib into my project via gradle, i've included the dependency compile statement and the mavencentral repository but somehow its not showing up in my main file. It seems like the right gradle file too.

推荐答案

根据此链接 sourceCompatibility是

According to this link sourceCompatibility is a

Java版本,在编译Java源代码时使用的兼容性.

Java version, compatibility to use when compiling Java source.

1.5是JAVA的旧版本,这就是为什么它会发出警告,将其更改为1.6或1.7

1.5 is a old version of JAVA that is why it is giving warning, change it with 1.6 or 1.7

这篇关于Gradle依赖项不起作用(无法导入)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆