简体   繁体   中英

Codename One application works on simulator and Android but crashes on iPad and iphones

My codename one app, works fine on Android and on the simulator, but on my iPad it doesn't. I've tested on iPad and iPhone devices, and it crashes.

On the iPad (iPad3,4), I see JetsamEvent events generated after the crash.

This answer seems to indicate that it is a memory problem, but I'm experiencing the issue only on Apple devices (iPad and iPhone).

Anyone have any suggestion to manage or improve the memory of my app?

In all kind of Android devices that I tested, the application never crashed like this.

The crash is always aleatory. After the crash, I repeat the same actions and it doesn't crash. It's totally random.

Thanks in advance.

像这样的崩溃报告没什么可做的,我建议使用Log类来跟踪崩溃实际发生的位置,并使用消除过程来确定哪个代码片段导致崩溃。

After a lot of test, I find out that the problem is in the mapResponse object and how it works in the iOS systems. If the mapResponse is small, you can do this: String resResponse=(String)mapResponse.get("RES"); with no problem in iOS.

But if the response is big (4000 characters for example), the mapResponse.get("RES") is not a true String. Only work with that false String object crash the application, for example:

if (resResponse != null && resResponse.startsWith("SUP"))

So I have to check if the mapResponse Object is String or not like this:

isError=(objResp instanceof String)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM