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

FlurlHttpException with Xamarin Forms 4 and VS 2019 #453

Closed
ricavir11 opened this issue Jun 12, 2019 · 9 comments
Closed

FlurlHttpException with Xamarin Forms 4 and VS 2019 #453

ricavir11 opened this issue Jun 12, 2019 · 9 comments

Comments

@ricavir11
Copy link

Please provide a complete description of the bug and a code sample (or better yet, a unit test) that reproduces it.
Hi,

Some users have reported a FlurlException with XF 4 and VS 2019.
Exception is : Java.Lang.ClassNotFoundException: Didn't find class "md53445bfa005abb70b0a2fcd6c25bc64be.AwaitableOkHttp_OkTaskCallback" on path: DexPathList[[zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file

When trying the same project with VS 2017, no error is thrown.

You can have a look to the same exception here : https://support.aspnetzero.com/QA/Questions/7132

@ricavir11 ricavir11 added the bug label Jun 12, 2019
@TobiasBuchholz
Copy link

I'm having a similar issue but with the FFImageLoading library. It appeared after I updated my Visual Studio for Mac to the newest version (8.1 build 2472). Running the same project with a lower version of Visual Studio for Mac doesn't have any problems. So maybe this issue actually is not related to Flurl at all.

Exception:
Java.Lang.ClassNotFoundException: Didn't find class "md53445bfa005abb70b0a2fcd6c25bc64be.AwaitableOkHttp_OkTaskCallback" on path: DexPathList[[directory "."],nativeLibraryDirectories=[/system/lib, /system/vendor/lib, /system/lib, /system/vendor/lib]]
at Java.Interop.JniEnvironment+Types.FindClass (System.String classname) [0x00114] in <9ed4c1a7b8844cdcb5330cc881c1cd6a>:0
at Java.Interop.JniType..ctor (System.String classname) [0x00006] in <9ed4c1a7b8844cdcb5330cc881c1cd6a>:0
at Java.Interop.JniPeerMembers+JniInstanceMethods..ctor (System.Type declaringType) [0x0005b] in <9ed4c1a7b8844cdcb5330cc881c1cd6a>:0
at Java.Interop.JniPeerMembers+JniInstanceMethods.GetConstructorsForType (System.Type declaringType) [0x00031] in <9ed4c1a7b8844cdcb5330cc881c1cd6a>:0
at Java.Interop.JniPeerMembers+JniInstanceMethods.StartCreateInstance (System.String constructorSignature, System.Type declaringType, Java.Interop.JniArgumentValue* parameters) [0x00038] in <9ed4c1a7b8844cdcb5330cc881c1cd6a>:0
at Java.Lang.Object..ctor () [0x0001f] in /Users/builder/jenkins/workspace/monodroid-multibranch_d16-1/monodroid/external/xamarin-android/src/Mono.Android/obj/Release/android-28/mcw/Java.Lang.Object.cs:30
at ModernHttpClient.AwaitableOkHttp+OkTaskCallback..ctor () [0x00000] in /Users/paul/code/paulcbetts/modernhttpclient/src/ModernHttpClient/Android/OkHttpNetworkHandler.cs:175
at ModernHttpClient.AwaitableOkHttp.EnqueueAsync (OkHttp.Call This) [0x00000] in /Users/paul/code/paulcbetts/modernhttpclient/src/ModernHttpClient/Android/OkHttpNetworkHandler.cs:167
at ModernHttpClient.NativeMessageHandler.SendAsync (System.Net.Http.HttpRequestMessage request, System.Threading.CancellationToken cancellationToken) [0x002f1] in /Users/paul/code/paulcbetts/modernhttpclient/src/ModernHttpClient/Android/OkHttpNetworkHandler.cs:121
at System.Net.Http.HttpClient.SendAsyncWorker (System.Net.Http.HttpRequestMessage request, System.Net.Http.HttpCompletionOption completionOption, System.Threading.CancellationToken cancellationToken) [0x000ca] in <162fad71ed6e4a3cb7598d196d170e1b>:0
at FFImageLoading.Cache.DownloadCache.DownloadAsync (System.String url, System.Threading.CancellationToken token, System.Net.Http.HttpClient client, FFImageLoading.Work.TaskParameter parameters, FFImageLoading.DownloadInformation downloadInformation) [0x00138] in C:\projects\ffimageloading\source\FFImageLoading.Common\Cache\DownloadCache.cs:109
at FFImageLoading.Cache.DownloadCache+<>c__DisplayClass16_0.b__0 () [0x00050] in C:\projects\ffimageloading\source\FFImageLoading.Common\Cache\DownloadCache.cs:59
at FFImageLoading.Retry.DoAsync[T] (System.Func`1[TResult] action, System.TimeSpan retryInterval, System.Int32 retryCount, System.Action onRetry) [0x00047] in C:\projects\ffimageloading\source\FFImageLoading.Common\Helpers\Retry.cs:18
--- End of managed Java.Lang.ClassNotFoundException stack trace ---
java.lang.ClassNotFoundException: Didn't find class "md53445bfa005abb70b0a2fcd6c25bc64be.AwaitableOkHttp_OkTaskCallback" on path: DexPathList[[directory "."],nativeLibraryDirectories=[/system/lib, /system/vendor/lib, /system/lib, /system/vendor/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:125)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)

@tmenier
Copy link
Owner

tmenier commented Jun 17, 2019

I'll probably need help investigating this one. My dev environment isn't well equipped to repro, and I've honestly never done any Xamarin dev. Somebody here mentioned he's been able to isolate it a bit. If anyone can post some minimal code to repro with just Flurl, that might be a good start.

There's a lot of moving parts here, and it should be noted that Flurl delegates calls to HttpClient and HttpMessageHandler, and any exceptions thrown at those levels will get wrapped in a FlurlHttpException. So, if someone is able to repro with a trivial Flurl call, the next step will be to take Flurl out of the equation and see if the same exception is thrown when using a "raw" HttpClient.

@andrewndavis
Copy link

I don't have time at this moment to get a reproduction of the issue created, but if one hasn't been created when I get the time to do so(probably a week from now). I will create one. Thanks for your response, and from the sound of things I have a feeling we will be creating an issue on the Xamarin.Android repository to actually get this issue resolved.

@rotorgames
Copy link

I don't think this issue is related to Flurl. I get the same issue with ModernHttpClient after updating VSfMac to 8.1

@tmenier
Copy link
Owner

tmenier commented Jun 22, 2019

I don't know if this is the same issue, but someone here reported they were able to get past a similar error by upgrading to modernhttpclient-updated. Could someone give that a try and report back on whether it fixes this?

@rotorgames
Copy link

@tmenier it helped me definitely. But be careful when you remove an old version of modernhttpclient you have to be sure that you have removed all references. For example OkHttp.dll reference was not removed from csproj automatically and I got an error because of it.

@tuando1993
Copy link

I don't know if this is the same issue, but someone here reported they were able to get past a similar error by upgrading to modernhttpclient-updated. Could someone give that a try and report back on whether it fixes this?

Works for me. Thank you.

@ricavir11
Copy link
Author

I don't know if this is the same issue, but someone here reported they were able to get past a similar error by upgrading to modernhttpclient-updated. Could someone give that a try and report back on whether it fixes this?

Also worked on my side, tks !

@tmenier
Copy link
Owner

tmenier commented Sep 12, 2020

Looks like this is effectively resolved and I forgot to close it :)

@tmenier tmenier closed this as completed Sep 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants