hello
i am getting this error when i added the xamarin chat sdk packages to my Android project, seems to be duplication of the okhttp/Adress any suggestions on the same.
Severity Code Description Project File Line Suppression State Error java.lang.IllegalArgumentException: already added : Lcom/squareup/okhttp/Address; NOOR.Sched.Mobile.Droid
Anwar
6 Answer(s)
-
0
hi,
As I understand, OkHttp cannot be used multiple in an application and both xamarin chat sdk and ModernHttpClientFactory uses OkHttp.
We use
ModernHttpClientFactory
as aFlurlHttpClientFactory
.As an alternative you can remove FlurlHttp and use another HttpClient.. see the alternatives https://dotnet.libhunt.com/flurl-alternatives
The checkpoints where you can see the usage of the library.
https://github.com/aspnetzero/aspnet-zero-core/blob/f72d4bf9ced778e06265f1c415a8553b10cbaf3d/aspnet-core/src/MyCompanyName.AbpZeroTemplate.Mobile.Droid/Activities/SplashActivity.cs#L82
https://github.com/aspnetzero/aspnet-zero-core/blob/fe85687cd6ff316fddd74e4b576765747819781f/aspnet-core/src/MyCompanyName.AbpZeroTemplate.Mobile.iOS/AppDelegate.cs#L74
https://github.com/aspnetzero/aspnet-zero-core/blob/f72d4bf9ced778e06265f1c415a8553b10cbaf3d/aspnet-core/src/MyCompanyName.AbpZeroTemplate.Application.Client/ApiClient/ModernHttpClientFactory.cs
-
0
thanks for the reply
which alternative to FlurlHttp do you recommend,
thanks and the last link "ModernHttpClient which uses OkHttp" i am not clear.
also will changing to an alternative http have consequences.
thanks Anwar
-
0
comment out these lines and try again
- https://github.com/aspnetzero/aspnet-zero-core/blob/f72d4bf9ced778e06265f1c415a8553b10cbaf3d/aspnet-core/src/MyCompanyName.AbpZeroTemplate.Mobile.Droid/Activities/SplashActivity.cs#L66
- https://github.com/aspnetzero/aspnet-zero-core/blob/fe85687cd6ff316fddd74e4b576765747819781f/aspnet-core/src/MyCompanyName.AbpZeroTemplate.Mobile.iOS/AppDelegate.cs#L42
-
0
I commented line 66 ConfigureFlurlHttp(); but still the same error alper
Severity Code Description Project File Line Suppression State Error java.lang.IllegalArgumentException: already added : Lcom/squareup/okhttp/Address; NOOR.Sched.Mobile.Droid
regards Anwar
-
0
any input on this