【发布时间】:2018-09-23 17:37:54
【问题描述】:
对于新的 Android 应用更新,我必须将 compileSdkversion 设置为 26。
当我这样做时,我会在以下函数 (ServerManagedPolicy.java) 中遇到自动售货许可证库的问题:
private Map<String, String> decodeExtras(String extras) {
Map<String, String> results = new HashMap<String, String>();
try {
URI rawExtras = new URI("?" + extras);
List<**NameValuePair**> extraList =
**URLEncodedUtils**.parse(rawExtras, "UTF-8");
for (**NameValuePair** item : extraList) {
results.put(item.getName(), item.**getValue**());
}
} catch (URISyntaxException e) {
Log.w(TAG, "Invalid syntax error while decoding extras data
from server.");
}
return results;
}
我知道这些功能已经过时,但没有更新版本的 Android Vending Licensing 库,我无法找到如何使其适用于 Oreo,或者通常适用于高于 Android 19 的版本,即compileSdkversion我现在用。
谁能帮忙解决这个问题?
PS。 useLibrary 'org.apache.http.legacyuseLibrary 'org.apache.http.legacy 不工作。应用会直接崩溃。
【问题讨论】:
标签: android licensing android-lvl