android - 包org.apache.http不存在sdk 23

时间:2015-08-30 11:21:42

标签: android

我升级到最新的sdk版本23.现在我的一些代码不再工作了。 这是我以前获得json的课程:

foreach (PropertyInfo propertyInfo in potato.GetType().GetProperties())
{
    if (propertyInfo.CanRead)
    {
          string val= propertyInfo.GetValue(potato, null).ToString();
    }
}

}

有替代品吗?如果是的话,它应该替换什么?

谢谢

1 个答案:

答案 0 :(得分:28)

作为解决方法,将其添加到您的应用程序build.gradle

android {
    useLibrary 'org.apache.http.legacy'
}

https://developer.android.com/preview/behavior-changes.html#behavior-apache-http-client

相关问题