Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Okio 0.7.0 doesn't build in Android projects due to nio.File missing #42

Closed
robUx4 opened this issue Apr 19, 2014 · 11 comments
Closed

Okio 0.7.0 doesn't build in Android projects due to nio.File missing #42

robUx4 opened this issue Apr 19, 2014 · 11 comments

Comments

@robUx4
Copy link

robUx4 commented Apr 19, 2014

I tried to import okio-0.7.0.jar from Maven in my (eclipse) project but using Okio.source(InputStream) tells me it cannot compiled because of java.nio.file.Path cannot be resolved.

Switched to okio-0.6.1.jar and it's fine...

@swankjesse
Copy link
Member

Yup. We figured it was safe to link against JDK 1.7 APIs but to build a 1.6-compatible jar file. What's the upside of building Okio from source against Android? We want to balance broad compatibility with supporting the latest hotness.

@JakeWharton
Copy link
Member

These code paths are also impossible to invoke on Android so there's no
risk.
On Apr 19, 2014 8:53 AM, "Jesse Wilson" [email protected] wrote:

Yup. We figured it was safe to link against JDK 1.7 APIs but to build a
1.6-compatible jar file. What's the upside of building Okio from source
against Android? We want to balance broad compatibility with supporting the
latest hotness.


Reply to this email directly or view it on GitHubhttps://github.com//issues/42#issuecomment-40872862
.

@JakeWharton
Copy link
Member

Any updates? Why are you building from source?

@robUx4
Copy link
Author

robUx4 commented Apr 22, 2014

I am not building from source, I just put the jar in my /libs folder.

@JakeWharton
Copy link
Member

Eh, that's strange. The whole point of a jar is that it's already compiled! Eclipse shouldn't care what's inside.

@swankjesse
Copy link
Member

No action to take here.

@robUx4
Copy link
Author

robUx4 commented May 26, 2014

I made a fork removing the calls that will not be used in Android anyway, so I can use it in Eclipse (I make my public builds with Gradle though, it's only use for development)

https://github.com/robUx4/okio/releases

@robUx4
Copy link
Author

robUx4 commented May 27, 2014

For the record, even with Gradle there are issues when using Proguard. You need to add the following lines to your Proguard conf to be able to build:

-dontwarn java.nio.file.*
-dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement

@felipecsl
Copy link

Also had this problem when upgrading to picasso 2.3 and okhttp 2.0 on gradle. I guess these Proguard rules should go in the project readme...

@pocmo
Copy link

pocmo commented Jun 2, 2014

I'm running into the same problem and somehow the proguard rules do not help. The problem occurs as soon as I do the following in my code:

InputStream stream = ...
Source source = Okio.source(stream);

@smaspe
Copy link

smaspe commented Sep 17, 2014

I had to add the standard JRE to the classpath for Eclipse to stop complaining. Strangely enough, I marks an error, but sometimes still agrees to compile (but most of the time it does not).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants