将新图像添加到资源文件夹后出现类未找到异常
该应用程序在模拟器和设备上运行得非常好。添加一组新图像后,它开始在每次运行时、在模拟器上和在设备上显示类未找到异常。
当尝试删除一些图像以查找原因时,我在运行时找不到不同的类。编译和打包应用程序不会生成警告或错误。他们甚至得到签名。我得到的一些“类未找到异常”:
java.lang.stringbuilder net.rim.device.api.ui.uiapplication
我猜它与总图像大小有关。每个图像的大小范围从 100KB 到 300KB,总共只有 25 到 30 个图像。在“res”文件夹之外添加图像不会生成错误,但图像不会添加到最终文件中。删除图像,刚刚添加的图像解决了问题,但我需要这些图像...
另外,这个应用程序并不大,但是在编译和打包应用程序时,它会生成并签名 125 个 cod 文件。这正常吗?
我正在 Win 7 上使用 Eclipse 3.6(Helios) 和 BlackBerry Eclipse Plugin SDK 5.0.0.25
任何帮助将不胜感激。谢谢。
The app works perfectly fine on the simulator and on the device. After adding a new set of images, it started to show on every run, on the simulator and on the device, a class not found exception.
When trying to delete some images to find the cause, I get different classes not found when running. Compiling and packaging the application generates no warning or error. They even get signed. Some of the "classes not found exception" I get:
java.lang.stringbuilder
net.rim.device.api.ui.uiapplication
I am guessing it has something to do with the total image size. The size of each image ranges from 100KB to 300KB, and we are talking of only 25 to 30 images in total. Adding the image outside of the 'res' folder doesn't generate the error, but the image isn't added to the final files. Deleting the images, the ones just added resolved the issue, but I need those images...
Also, this application is not big, but when compiling, and packaging the app, it generates and signes 125 cod files. Is that normal?
I am using Eclipse 3.6(Helios), and BlackBerry Eclipse Plugin SDK 5.0.0.25 on Win 7
Any help will be appreciated. Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
每个 .cod 文件的大小限制为大约 64K。如果你的 25-30 张图像平均大小约为 200K,那么 125 个 cod 文件并不会让我感到惊讶。
错误消息听起来 rapc 变得非常混乱。添加图像后,尝试刷新项目,甚至退出并重新启动 Eclipse,然后从头开始清理并构建项目。
对于 BB 来说,包含大量媒体通常不是一个好的应用程序设计。有一个很好的讨论 此处了解处理此问题的替代方法。
Each .cod file is limited to about 64K. If your 25-30 images average about 200K, the 125 cod files doesn't surprise me.
The error messages sound like rapc is getting very confused. After you add your images, try refreshing the project or even exiting and restarting Eclipse, then clean and build the project from scratch.
Including large amounts of media is generally not a good app design for the BB. There's a good discussion here about alternative ways to handle this.
事实证明,这个问题是由于我的图像总大小引起的,这反过来又创建了超过 127 个 .cod 文件。同级 .cod 文件的总数为 127,我的应用程序有这个限制,这就是为什么不包括一些基本类的原因。我仍然认为黑莓插件应该对此发出警告,因为它在编译、打包和签名应用程序时没有显示错误。以下是我从 BlackBerry 开发人员支持论坛获取此信息的链接:
http://supportforums.blackberry.com/t5/Testing-and-Deployment/The-maximum-size-of-a-BlackBerry-smartphone-application /ta-p/502534
因为我习惯了 iOS 世界,我可以在应用程序中添加任何我想要的内容,而且它对我可以添加的资源几乎没有限制,除了考虑到用户会下载应用程序需要等待很长时间,而且 2GB 的应用程序大小对于 99% 的应用程序来说确实很大。
因此,对于这个应用程序,我所做的就是仅添加必要的图像作为应用程序中的编译资源,其余图像会在应用程序第一次启动时自动下载。
It turns out this issue was caused because of the total size of my images, which in turn created more then 127 .cod files. Total number of siblings .cod files is 127, my app had that limit, and this is why some essential classes were not included. I still think the blackberry plugin should warn about this, because it showed no error when compiling, packaging and signing the application. Here is the link from the BlackBerry developer support forums where I got this information:
http://supportforums.blackberry.com/t5/Testing-and-Deployment/The-maximum-size-of-a-BlackBerry-smartphone-application/ta-p/502534
Since I am used to the iOS world, where I can add whatever I want to the app, and it has virtually no limit on the resources I can add, except to consider that the user would have to wait a good amount of time downloading the app, and the 2GB application size, which, really is a lot for 99% of the apps.
So for this app what I did was I added only the essential images as compiled resources in the app, and the rest of the images are downloaded automatically when the application launches the first time.