Search code examples
androidandroid-emulatorasp.net-apicontroller

Android Emulator - Connection Refused


I've tried so many different methods and have made no progress.

I'm using: Windows 8.1, VS 2015, VS Emulator for Android, Xamarin Forms, Android 6.0 (API Level 23 - Marshmallow), and IIS v8.5.9600.16384

From the emulator's browser, I can get a response from IIS. But from the app I get connection refused.

I've tried disabling my Firewall and AV completely. Tried using PC's machine name, PC's IP address, and 10.0.2.2. Tried ports 80, 56739, 5555, 9999

In Command Prompt (Admin) I ran netsh http add urlacl url=http://*:%Port%/ user=everyone for each port (where %port% is the actual port)

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="auto">
    <uses-sdk android:minSdkVersion="23" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <application android:label="EventPlanner.Droid"></application>
</manifest>

I don't know what else to try...


Solution

  • Apparently the AndroidManifest file was corrupt even though it opened and appeared just find. I previously ran a clean and rebuild on the entire solution but I ran a clean and rebuild on the Android project and its PCL. Now it works... An entire week lost...