黑莓运行时错误:FRIDG:找不到IMG / logo.png [英] Blackberry runtime error: FRIDG: could not find img/logo.png

查看:375
本文介绍了黑莓运行时错误:FRIDG:找不到IMG / logo.png的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近不得不prepare提交给BB应用世界BB的应用程序,但在运行应用程序时,我有一个问题。基本上,我创建了一个新的BlackBerry项目,使用利用现有的源文件选项指向我从实际开发的这个应用程序开发者得到了来源。构建应用程序只是工作,但是当我想要启动它马上用一个NullPointerException异常退出的应用程序。

在调试应用程序,调试器停止在以下行:

 位图bitmaplogo = EN codedImage.getEn codedImageResource(IMG / logo.png)getBitmap();

通过以​​下错误:

  [0.0] FRIDG:找不到IMG / logo.png

我有一个img / logo.png,它位于/res/img/logo.png。指定路径为RES / IMG / logo.png,/res/img/logo.png,为Logo.png的尝试都没有奏效。我个人不认为这是这里的问题,这个确切code碱基完全适用于其他开发商。我更倾向于开始寻找到工装,JDK / JRE版本,项目设置。也许资源文件应该被明确列入构建?

其他的一些信息:


  • 我的黑莓手机项目使用黑莓JRE 5.0.0的JRE系统库

  • 我有甲骨文的Java SDK 6更新26安装

  • 使用BlackBerry Java插件为Eclipse 1.3.0

  • 在Windows XP SP2中

有没有人遇到过同样的问题之前?


解决方案

  1. 文件名和扩展名是区分大小写的。 logo.png和logo.PNG是从应用的角度不同的文件。所以,要小心命名文件和文件夹。


  2. 为你在你的应用程序中获取图像的根文件夹是源文件包的根文件夹中。


例如,如果您有以下文件夹结构:

  YourProject
   SRC \\
      COM \\
        公司\\
             等等\\
   IMG \\

那么图片的根文件夹为: YourProject的\\ src

位于 YourProject \\ IMG 文件夹

图像文件是为您的应用程序code看不见的,除非 IMG 文件夹位于 YourProject的\\ src 和完整路径是:

  YourProject的\\ src \\ IMG

和图像文件有这样的完整路径:

  YourProject的\\ src \\ IMG \\ logo.png

在这种情况下,你可以通过指定它的路径加载图像: IMG \\ logo.png

和无它,只是通过指定: logo.png

指定如果你有多个图像具有类似的文件名,建议的完整路径。

如果你有多个文件 logo.png 在您的项目,并通过您从您的项目只指定文件名为Logo.png,那么第一个找到的图像加载它将被载入。

简历:将您的 IMG 文件夹到的src 文件夹

I recently had to prepare a BB app for submission to the BB app world, but I have an issue when running the app. Basically, I've created a new Blackberry project, using the "use existing source" option to point to the sources I've got from the developer that actually developed this app. Building the application just works, but when I want to start the app it immediately quits with a NullPointerException.

When debugging the application, the debugger halts at the following line:

Bitmap bitmaplogo = EncodedImage.getEncodedImageResource("img/logo.png").getBitmap();

With the following error:

[0.0] FRIDG: could not find img/logo.png

I do have an img/logo.png, which is located in /res/img/logo.png. Attempts of specifying the path as "res/img/logo.png", "/res/img/logo.png", "logo.png" have not worked. I personally don't think that's the issue here, this exact code base works perfectly for another developer. I'm more inclined to start looking into tooling, JDK/JRE versions, project settings. Maybe resource files should be explicitly included in the build?

Some other information:

  • My Blackberry project uses Blackberry JRE 5.0.0 as the JRE system library
  • I have Oracle Java SDK 6 Update 26 installed
  • Using Blackberry Java Plugin for Eclipse 1.3.0
  • On Windows XP SP2

Has anyone encountered the same issue before?

解决方案

  1. Filenames and extensions are case sensitive. logo.png and logo.PNG are different files from application's point of view. So, be careful with naming files and folders.

  2. The root folder for images you get in your application is the root folder of your source files package.

For instance, if you have the following folder structure:

YourProject
   src\
      com\
        company\
             etc\
   img\

Then the root folder for your images will be: YourProject\src

Image files located in YourProject\img folder are invisible for your application code, unless img folder is located in YourProject\src and the full path is:

YourProject\src\img

and your image file has the full path like that:

YourProject\src\img\logo.png

In this case you can load the image via specifying it's path: img\logo.png

and without it, just via specifying: logo.png

Specifying the full path is recommended if you have several images with similar filenames.

If you have several files logo.png in your project, and you load it via specifying only file name "logo.png" then the first found image from your project will be loaded.

Resume: transfer your img folder into the src folder.

这篇关于黑莓运行时错误:FRIDG:找不到IMG / logo.png的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆