SignalR with android(Java) having problem

2020-04-20 12:13发布

问题:

I want to make a realtime-communication between android app and a .net core server project.I tried a question in stackoverflow.

I followed this one. In android side, I used these libraries

    implementation files('libs/signalr-client-sdk-android.jar')
    implementation files('libs/signalr-client-sdk.jar')

After that when try to install app,then it shown this message

Then I added aar file according to this answer.After that when try to build again another error shown,

Failed to resolved:signalr-client-sdk-android-release

After that I added this code into allprojects under repositories

 flatDir { dirs 'libs'} 

Then that error gone and after try to install,another error occurs

Please tell me how to fix this problem or if you know any article that covers realtime-communication between android and .net core.

Update: I changed the signalR library in android side to this one

com.microsoft.signalr:signalr:1.0.0

Now again another error occurs,

Error:Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'. > com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex

Please tell me how to fix this

回答1:

It's looks like the links you referenced are a little out of date. They are for the depricated client that only works for classic ASP.NET. The SignalR team recently released a Java client for ASP.NET Core SignalR. Here are the getting started docs https://docs.microsoft.com/en-us/aspnet/core/signalr/java-client?view=aspnetcore-2.2

if you know any article that covers realtime-communication between android and .net core.

The doc I linked above is exactly that! Hope this helps!