错误:NameResolutionFailure
public class JsonConverter
{
public async Task<string> GetStringbyJson(string link)
{
HttpClient client = new HttpClient ();
HttpResponseMessage message = await client.GetAsync (link);
return await message.Content.ReadAsStringAsync ();
}
}
public async override void OnActivityCreated (Bundle savedInstanceState)
{
base.OnActivityCreated (savedInstanceState);
lst = View.FindViewById<ListView> (Resource.Id.lstHome);
var result = await json.GetStringbyJson ("https://api-v2.soundcloud.com/explore/Popular+Music?tag=out-of-experiment&limit=30&linked_partitioning=1&client_id=9ac2b330e1b3&offset="+offset);
}
应用程序只在我删除&#34; var result&#34;时运行。我在设备上测试应用
答案 0 :(得分:2)
错误正是它所说的 - 它无法解析您提供的域名。
最可能的原因是忽略了在应用程序清单中启用INTERNET_PERMISSION。但它也可能是设备上的一般网络问题。您可以从设备的浏览器中解析域名吗?