Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java The import com.google.common.io.Files cannot be resolved

I am working on building and running an android application in Eclipse. I have successfully installed the Android kit, along with the google api. I went here: https://developers.google.com/maps/documentation/tracks/auth and followed the sample code.

However both com.google.common.io.Files and com.google.common.base.Preconditions are giving me an error.

any idea what I need to do next to get this issue resolved please?

like image 345
keith Spiteri Avatar asked Oct 16 '25 15:10

keith Spiteri


2 Answers

To Solve this issue,

I went to this link : https://code.google.com/p/guava-libraries/wiki/Release14, downloaded the guava jar file. Then I added it to the classpath and compiled successfully..

like image 146
keith Spiteri Avatar answered Oct 18 '25 04:10

keith Spiteri


If you are having a maven project you can add the dependency to the pom.xml as below.

<!-- https://mvnrepository.com/artifact/com.google.guava/guava -->
<dependency>
  <groupId>com.google.guava</groupId>
  <artifactId>guava</artifactId>
  <version>r05</version>
</dependency>

The above dependency would solve the problem. Please refer the maven repository for the latest versions Maven Repo

like image 30
Abhijit Bashetti Avatar answered Oct 18 '25 06:10

Abhijit Bashetti



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!