gpt4 book ai didi

android - 仅在启用 proguard 时 JSONArray 不是字符串异常

转载 作者:行者123 更新时间:2023-12-03 14:59:47 26 4
gpt4 key购买 nike

JSONArray.getString(1);其中 ["n​​ame",null] 是 json 数组,抛出 JSONArray[1] not a string仅在启用 proguard 时异常(exception)。

我在我的 proguard 规则中遗漏了什么吗?

最佳答案

您是否尝试过这些方法:

/**
* Returns the value at {@code index} if it exists, coercing it if
* necessary. Returns the empty string if no such value exists.
*/
public String optString(int index)

或者
/**
* Returns the value at {@code index} if it exists, coercing it if
* necessary. Returns {@code fallback} if no such value exists.
*/
public String optString(int index, String fallback)

好像不返回 null对于字符串

关于android - 仅在启用 proguard 时 JSONArray 不是字符串异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39593619/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com