Base solution for your next web application
Open Closed

call fail when run xamarin app #7488


User avatar
0
majid created

Hello The xamarin application in the mobile app gives the following error when running

But it receives the data correctly when calling from the browser

please follow up this issue

<br> <br>


10 Answer(s)
  • User Avatar
    0
    majid created

    I'm working with Visual Studio 2019 version 16.1.6 . This seems to be the problem with Visual Studio 2019 . According to the link below: https://support.aspnetzero.com/QA/Questions/7132

    To fix the above problem, it was recommended to change modernhttpclient to modernhttpclient-updated . According to the link below: https://github.com/tmenier/Flurl/issues/453

    But I get the following error when calling the mobile app :

    When calling the following address, it executes correctly in the browser: http://192.168.1.103:8088/abpuserconfiguration/getall

    Do I have to change anything?

  • User Avatar
    0
    ryancyq created
    Support Team

    Hi, the error might be caused by the default settings on android.

    https://stackoverflow.com/q/45940861/6856176

    Are you using Android 9 and above?

  • User Avatar
    0
    majid created

    I tested with different api:

    I had even added the code on the stackoverflow site to the project But it didn't :(

  • User Avatar
    0
    ryancyq created
    Support Team

    Hi, when you are trying with android lower than android 9.

    Did the same error occur? it will be helpful if you can share the error with us as you debugging.

  • User Avatar
    0
    majid created

    Thank you for your follow up Yes,I tested with different api (26,23,22,16). I have the same problem for all of them.

    More explanation With each client request (such as a browser request) the request information is logged on the server side. But when calling xamarin, no data is logged on the server side. (With the documentation mentioned in previous posts)

  • User Avatar
    0
    ismcagdas created
    Support Team
  • User Avatar
    0
    alper created
    Support Team

    Hi,

    I've tried with the latest AspNet Zero (dev branch) without any issues.

    See this thread #5655

  • User Avatar
    0
    alper created
    Support Team

    Also see my *.Mobile.Droid properties. Set Linking=None and Uncheck Use Fast Development

  • User Avatar
    0
    majid created

    After several days of trying, the problem was fixed by updating the Visual Studio version. Upgrade to version 16.2.3

    To inform the app development team: Upgrading the Visual Studio version works well without errors. Upgrading the ModernHttpClient version through the nugget from (modernhttpclient Version 2.4.2) to (modernhttpclient-updated Version 3.4.4) gives the following error: call failed : cleartext communication not enabled for client

    thanks :)

  • User Avatar
    0
    ryancyq created
    Support Team

    To inform the app development team: Upgrading the Visual Studio version works well without errors. Upgrading the ModernHttpClient version through the nugget from (modernhttpclient Version 2.4.2) to (modernhttpclient-updated Version 3.4.4) gives the following error: call failed : cleartext communication not enabled for client

    Thanks for let us know. We will handle this while upgrading the nuget package.

    https://github.com/aspnetzero/aspnet-zero-core/pull/2590