Android(Java)的SignalR有问题 [英] SignalR with android(Java) having problem

查看:344
本文介绍了Android(Java)的SignalR有问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在android应用和.net核心服务器项目之间进行实时通信.我在stackoverflow中尝试了一个问题.

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

我遵循了这个一个. 在android方面,我使用了这些库

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

然后我根据 answer 添加了aar文件.此后,当尝试再次构建另一个显示的错误时, >

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

请告诉我如何解决此问题,或者您是否了解覆盖android和.net核心之间实时通信的任何文章.

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

更新: 我将android端的signalR库改为了这个

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

推荐答案

看来您引用的链接有些过时了.它们适用于仅适用于经典ASP.NET的专用客户端. SignalR团队最近发布了ASP.NET Core SignalR的Java客户端.以下是入门文档 https://docs.microsoft.com/zh-CN/aspnet/core/signalr/java-client?view=aspnetcore-2.2

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

如果您知道任何涉及android和.net之间实时通信的文章 核心.

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!

这篇关于Android(Java)的SignalR有问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆