skip to Main Content

first I was trying my app on virtual emulator and every thing worked fine and the server at the backend received the requests ..but I wanna test on real phone but unfortunately the server doesn’t receive any requests

I think I need to change my URL which was used for virtual emulator
http://10.0.2.2
but change it to what ? i tired to change it to my pc ip address 192.168.1.2 but still doesn’t work
thanks in advance

2

Answers


  1. you can try this.

    Open the AndroidManifest.xml file located at <your_project>/android/app/src/main and add the following line:

    <manifest xmlns:android="...">
    <uses-permission android:name="android.permission.INTERNET"/> <!-- Add this -->
    </manifest>
    
    Login or Signup to reply.
  2. Possible that you are using Http only and Android is blocking an HTTP request
    You can get more ideas from this blog

    Please add the below code in your manifest file both

    main-AndroidManifest

     <application
            android:label="Test"
            android:usesCleartextTraffic="true"
            android:name="${applicationName}"
            android:icon="@mipmap/ic_launcher">
    

    debug-AndroidManifest

    <application android:usesCleartextTraffic="true" />
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search