Gradle dependencies not working (Cannot import)

2019-09-11 00:21发布

问题:

This screenshot shows my gradle build file

This one shows my main class, where im using the class

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.

回答1:

According to this link sourceCompatibility is a

Java version, compatibility to use when compiling Java source.

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