简体   繁体   English

Codename One应用程序适用于模拟器和Android,但在iPad和iphone上崩溃

[英]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. 我的代号为一个应用程序,在Android和模拟器上工作正常,但在我的iPad上却没有。 I've tested on iPad and iPhone devices, and it crashes. 我已经在iPad和iPhone设备上进行了测试,它崩溃了。

On the iPad (iPad3,4), I see JetsamEvent events generated after the crash. 在iPad(iPad3,4)上,我看到崩溃后生成的JetsamEvent事件。

This answer seems to indicate that it is a memory problem, but I'm experiencing the issue only on Apple devices (iPad and iPhone). 这个答案似乎表明这是一个内存问题,但我只在Apple设备(iPad和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. 在我测试的所有类型的Android设备中,应用程序从未像这样崩溃。

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. 经过大量的测试,我发现问题出在mapResponse对象中,以及它在iOS系统中的工作原理。 If the mapResponse is small, you can do this: String resResponse=(String)mapResponse.get("RES"); 如果mapResponse很小,你可以这样做: String resResponse=(String)mapResponse.get("RES"); with no problem in iOS. 在iOS中没有问题。

But if the response is big (4000 characters for example), the mapResponse.get("RES") is not a true String. 但是如果响应很大(例如4000个字符),则mapResponse.get("RES")不是真正的String。 Only work with that false String object crash the application, for example: 仅使用该假String对象使应用程序崩溃,例如:

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

So I have to check if the mapResponse Object is String or not like this: 所以我必须检查mapResponse对象是否是字符串,如下所示:

isError=(objResp instanceof String)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在iPad Simulator上可用,但在iPad上崩溃 - Works on iPad Simulator but crashes on iPad ImagePickerController在Ipad iOS 8.0.2上崩溃,但在iPhone上正常运行 - ImagePickerController crashes on Ipad ios 8.0.2 but works fine on iphones 带有iOS 9.3的XCode 7-约束在iPhone模拟器中有效,但在iPad模拟器中运行时会添加边距 - XCode 7 with iOS 9.3 - Constraints Works in iPhones Simulator But When Running in an iPad Simulator a Margin is Added 在drawAtPoint期间崩溃,代码在iPad Air,iPad模拟器上工作,在iPad 1和iPad mini上崩溃 - Crash during drawAtPoint, code works on iPad Air, iPad simulator, crashes on iPad 1 and iPad mini 应用程序在设备上崩溃 - 在Simulator上完美运行 - Application crashes on device - works perfectly on Simulator 应用程序在模拟器上正常运行,但在设备上崩溃 - Application works fine on the simulator but crashes on the device iOS-应用程序在预配置的iPad上崩溃,在模拟器中正常运行 - iOS - app crashes on provisioned iPad, works ok in simulator 应用程序在iPad上崩溃但在iPad模拟器中没有崩溃 - App crashes on iPad but not in iPad Simulator UIImagePickerController在iPad模拟器上崩溃 - UIImagePickerController crashes on iPad simulator AVExportSession可在Simulator,iPad 2而非iPad 4上运行 - AVExportSession works on Simulator, iPad 2 but not iPad 4
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM