Skip to content
This repository has been archived by the owner on Feb 14, 2020. It is now read-only.

Android Build Error #15

Closed
jzhouw opened this issue Sep 19, 2016 · 9 comments
Closed

Android Build Error #15

jzhouw opened this issue Sep 19, 2016 · 9 comments

Comments

@jzhouw
Copy link

jzhouw commented Sep 19, 2016

got below build error on my own project and reproduced with the PayPal.Forms.Test.PCL.Droid in this repo by adding the same nuget packages. Any idea what would cause the error?

the error:
2> Uncaught translation error: java.lang.IllegalArgumentException: already added: Lokio/AsyncTimeout$1;
2> Uncaught translation error: java.lang.IllegalArgumentException: already added: Lokio/AsyncTimeout$2;
2> Uncaught translation error: java.lang.IllegalArgumentException: already added: Lokio/AsyncTimeout$Watchdog;
2> Uncaught translation error: java.lang.IllegalArgumentException: already added: Lokio/AsyncTimeout;
2> Uncaught translation error: java.lang.IllegalArgumentException: already added: Lokio/Base64;
2> Uncaught translation error: java.lang.IllegalArgumentException: already added: Lokio/Buffer$1;
2> Uncaught translation error: java.lang.IllegalArgumentException: already added: Lokio/Buffer$2;
2> Uncaught translation error: java.lang.IllegalArgumentException: already added: Lokio/Buffer;
2> Uncaught translation error: java.lang.IllegalArgumentException: already added: Lokio/BufferedSink;
2>
2> UNEXPECTED TOP-LEVEL EXCEPTION:
2> java.lang.RuntimeException: Translation has been interrupted
2> at com.android.dx.command.dexer.Main.processAllFiles(Main.java:608)
2> at com.android.dx.command.dexer.Main.runMonoDex(Main.java:311)
2> at com.android.dx.command.dexer.Main.run(Main.java:277)
2> at com.android.dx.command.dexer.Main.main(Main.java:245)
2> at com.android.dx.command.Main.main(Main.java:106)
2> Caused by: java.lang.InterruptedException: Too many errors
2> at com.android.dx.command.dexer.Main.processAllFiles(Main.java:600)
2> ... 4 more
2>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(2159,3): error : java.lang.IllegalArgumentException: already added : Lokio/AsyncTimeout$1;

the packages.config:
packages.txt

@jzhouw
Copy link
Author

jzhouw commented Sep 19, 2016

@AlejandroRuiz I figured out the reason, my project installed modernhttpclient nugget (okhttp) while this plugin includes another version of okhttp, this is similar to this issue on another project anaisbetts/ModernHttpClient#181 (comment)
see the comment "OK, so both Picasso and ModernHttpClient should pull in OkHttp through a nuget, rather than both providing their own version of it.
For ModenHttpClient that is the case in new versions since August 24. For Picasso I have no idea. Talk to the author of Picasso to tell him to use the OkHttp nuget as well."

Can you use okhttp nuget instead of including your own one?

@jzhouw
Copy link
Author

jzhouw commented Sep 21, 2016

@AlejandroRuiz any timing update about fix for issue? thanks

@AlejandroRuiz
Copy link
Owner

Ill check it later today, meanwhile you can build by your own using the source code

AlejandroRuiz added a commit that referenced this issue Sep 21, 2016
@AlejandroRuiz
Copy link
Owner

install version 2.15.5 from here https://www.nuget.org/packages/PayPal.Forms/2.15.5

@jzhouw
Copy link
Author

jzhouw commented Sep 22, 2016

thanks for the quick fix

@gizmohd
Copy link

gizmohd commented Sep 2, 2017

This appears to be broken again in 2.16.1.... Im getting the same error/issue....

@amilici
Copy link

amilici commented Mar 12, 2019

This is still broken in 2.18.5. I am unable to use this package because of this.

@AlejandroRuiz
Copy link
Owner

@amilici this is solved to have direct dependency of Square.OkHttp3 (>= 3.5.0) so please make sure that any other nuget that you're using have dependency on that package if the package has internal reference of it you'll need to ask the library creator to use the reference nuget instead theres nothing to do in our side if any other library has a wrong reference implementation

@amilici
Copy link

amilici commented Mar 12, 2019

@AlejandroRuiz Thanks for the quick reply.

The problem for me is with ModernHttpClient, which hasn't been updated since 2015. I found a more up-to-date fork of the same library, https://github.com/Ideine/ModernHttpClient, which looks like it will work.

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

No branches or pull requests

4 participants