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

Compiling issue with Picasso #2

Open
streinhard opened this issue Aug 11, 2015 · 14 comments
Open

Compiling issue with Picasso #2

streinhard opened this issue Aug 11, 2015 · 14 comments

Comments

@streinhard
Copy link

When I include your Picasso binding and use it in my app, I get the following compilation errors:

error: package com.squareup.picasso does not exist
    com.squareup.picasso.Callback

com.squareup.picasso.Picasso does not exist
    com.squareup.picasso.Picasso.Listener

com.squareup.picasso does not exist
    public void onImageLoadFailed (com.squareup.picasso.Picasso p0, android.net.Uri p1, java.lang.Exception p2)

com.squareup.picasso does not exist
    private native void n_onImageLoadFailed (com.squareup.picasso.Picasso p0, android.net.Uri p1, java.lang.Exception p2);

Any idea how to solve this?

@mattleibow
Copy link
Owner

@monostefan That might be the linker removing members. If you turn off the linker, does the issue persist? If it goes away, then could you create a small sample project that produces this, or a similar, error? Does this same issue occur when you build the sample app?

@streinhard
Copy link
Author

Hmm, after switching to UrlImageViewHelper I tried the same Version of your Picasso Bindings again. Linking was and is disabled in Debug Config. However, now I get a completely different error:

/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets: Error: Tool exited with code: 2. Output: Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/squareup/okhttp/Address;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/squareup/okhttp/Authenticator;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/squareup/okhttp/Cache$1;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/squareup/okhttp/Cache$2;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/squareup/okhttp/Cache$CacheRequestImpl$1;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/squareup/okhttp/Cache$CacheRequestImpl;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/squareup/okhttp/Cache$CacheResponseBody$1;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/squareup/okhttp/Cache$CacheResponseBody;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/squareup/okhttp/Cache$Entry;

UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.RuntimeException: Translation has been interrupted
    at com.android.dx.command.dexer.Main.processAllFiles(Main.java:608)
    at com.android.dx.command.dexer.Main.runMonoDex(Main.java:311)
    at com.android.dx.command.dexer.Main.run(Main.java:277)
    at com.android.dx.command.dexer.Main.main(Main.java:245)
    at com.android.dx.command.Main.main(Main.java:106)
Caused by: java.lang.InterruptedException: Too many errors
    at com.android.dx.command.dexer.Main.processAllFiles(Main.java:600)
    ... 4 more

Not really sure what is going on here and I have to investigate further.

Good news though: It works if I set up a new project and embed the bindings there.

@streinhard
Copy link
Author

Okay, the error above comes from modernhttpclient, which brings it's own version of OkHttp. Hence the namespaces collide. Any Idea how this collision could be avoided?

@lukax
Copy link

lukax commented Aug 30, 2015

I`m having the same issue

@mattleibow
Copy link
Owner

Unfortunately at this time there is no workaround. However this has been fixed in ModernHttpClient for the next release. anaisbetts/ModernHttpClient#177
I would suggest not using ModernHttpClient temporarily, and then after the release, you can switch it back on. Performance may not be as great as it could be, but HttpClient can still work using the default implementation.

@beeradmoore
Copy link

Hey @mattleibow , I can see your successful merge here, anaisbetts/ModernHttpClient#177 however I am unsure how to get both ModernHttpClient and Picasso working together. I have tried using both from nuget and using both from source but I can't seem to figure it out. Any tips/suggestions/examples?

EDIT: Hmmm... I made a sample project, added ModernHttpClient as new project, added Square.Picasso as new project. Updated the nuget packages in ModernHttpClient Square.OkHttp to 2.7.2.0" and Square.OkIO to 1.6.0.0. Seems to compile and run. Got it to load an image into an image view with Picasso and download data with ModernHttpClient. Not sure why it was not working in my other project.

@jzeferino
Copy link

jzeferino commented May 30, 2016

Why is this closed? I have the same problem when using Picasso with ModernHttp.
Why don't you guys remove the .dll from the binding and replaced it with a nuget?

There exists a PR fix for this.
Why @jacksierkstra don't you release this?

@jacksierkstra
Copy link

@jzeferino I've already merged the pull request. What more do you expect from me? Be more specific please.

@jzeferino
Copy link

When this fix will be released? Thanks.

@jacksierkstra
Copy link

@jzeferino Again. Be more specific. What do you want me to do?

@jzeferino
Copy link

jzeferino commented May 30, 2016

@jacksierkstra i need you to publish that fix in the next version of the picasso because now it has de okhttp.ddl attached to it.

@jacksierkstra do you understand it?

@josephkandi
Copy link

This library requires OkHttp and modernhttp client requires OkHttp as well, instead you can just use the Glide library which does not have a dependency with OkHttp and have the same API interface. Here is the , Glide library. Its also available on nuget.

Here is how am using it in my viewhlder :

Glide.With(context).Load(movie.Image.Url).Placeholder(Resource.Drawable.placeholder).Into(vh.ThumbNail);

@jzeferino
Copy link

@josephkandi thank you for that port.

@jonathanantoine
Copy link

Hello,

Any updater on this ? Does this library can use the okHttp nuget package instead of bringing it's own implementation ?

Regards.

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

8 participants