Textures don't work in jre using libgdx and java - loading

Edit:
It looks like eclipse couldn't synchronize folders between projects, I had to clean projects and refresh asset folders.
i'm trying to make a game in Java using libgdx. Everything works fine in Eclipse debug, but when I export it to JRE it can't load my textures(standard libgdx.png texture works great). I add texture to project by dragging and dropping it to data folder, selecting "copy" option. In code i'm loading it using this code:
texture = new Texture(Gdx.files.internal("data/player.png"));
In eclipse's debug it works. Project exported to jre can't load textures(all textures are in jar file), it shows those errors:
Exception in thread "LWJGL Application" com.badlogic.gdx.utils.GdxRuntimeExcepti
on: com.badlogic.gdx.utils.GdxRuntimeException: Couldn't load file: data/player.
png
at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplicati
on.java:113)
Caused by: com.badlogic.gdx.utils.GdxRuntimeException: Couldn't load file: data/
player.png
at com.badlogic.gdx.graphics.Pixmap.<init>(Pixmap.java:140)
at com.badlogic.gdx.graphics.glutils.FileTextureData.prepare(FileTexture
Data.java:64)
at com.badlogic.gdx.graphics.Texture.load(Texture.java:175)
at com.badlogic.gdx.graphics.Texture.create(Texture.java:159)
at com.badlogic.gdx.graphics.Texture.<init>(Texture.java:133)
at com.badlogic.gdx.graphics.Texture.<init>(Texture.java:122)
at com.me.mygdxgame.MyGdxGame.create(MyGdxGame.java:29)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplic
ation.java:127)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplicati
on.java:110)
Caused by: java.io.IOException: couldn't load pixmap 8bit only
at com.badlogic.gdx.graphics.g2d.Gdx2DPixmap.<init>(Gdx2DPixmap.java:57)
at com.badlogic.gdx.graphics.Pixmap.<init>(Pixmap.java:138)
... 8 more
My launch configuration is just like a normal configuration but with main class set as Main from desktop project.

There is no such thing as reserved Texture names. If you got it working only changing the png image name. Then, your problem was that eclipse and your assets folder weren't correctly synchronized.
If you edit, delete or add a file into your project folders from outside eclipse (for example Windows Explorer), eclipse won't know till you refresh it.

Related

is it possible to configure custom mac osx app icon set with client-maven-plugin of gluon?

I'm experimenting with the client-maven-plugin from Gluon. The output of mvn client:build generates an mac osx app having a default set of icons on the appiconset.
My Question : Is it possible to configure a custom app icon using the gluon client-maven-plugin ?
If you build a JavaFX project with the Client plugin for Mac OS or iOS, by default it generates a gensrc folder in the build folder, where a set of default assets is copied.
You can see a comment printed out:
Default Mac resources generated in .
Consider copying them to before performing any modification
This means that you should copy the mac folder from gensrc to your src folder (so you should have src/mac/Info.plist, src/mac/assets, ...), so the next time you build your app, these assets will be used instead.
Once you have verified this works as expected, you can easily change the included assets with your own, or modify the default plist if needed.

Cannot run exported application

I've developed a simple MacOS application (i.e. a product consisting of main application and launch helper application) with Xcode 9.4. Application runs fine in Xcode. I've archived and exported the app (either "Export without re-signing" or "Development" using "Automatic signing"). The export process runs without errors.
However, it is not possible to the application. Upon starting outside of Xcode, nothing happens; no error message etc.
How can this be further diagnosed?
Finally found it thanks to #clemens. Embedded libraries have their place inside the generated package in /Contents/Frameworks. Since I had previously embedded a login item I had set a /Contents/Library/LoginItems target path that was used below Frameworks which is clearly not the expected place. Removing the library, cleaning the path and re-adding fixed it for me.

Building a specific Runtime image using Platform Builder 5.0

I am trying to create a run-time image using Platform Builder 5.0, I know how to make run-time images but I need specific modules and files to be inside the run-time image, I am basically trying to clone an original run-time image and I want to add some extra stuff such as drivers for an ethernet card that was incorrectly configured, by using viewbin I was able to obtain the following modules and files, if it is possible can someone tell me exactly what catalog items I should add because at the moment I am using trial and error and it is not working, the modules and files are as follows
Modules
nk.exe,GIISR.dll, isr16550.dll, coredll.dll, filesys.exe, gwes.exe, device.exe, devmgr.dll, regenum.dll, pm.dll, fatfsd.dll, diskcache.dll, fatutil.dll, shell.exe, shellcelog.dll, toolhelp.dll, cmd.exe, atapi.dll, udfs.dll, fsdmgr.dll, mspart.dll, ceddk.dll, ppp.dll, pppoe.dll, export.dll, iphlpapi.dll, mbridge.dll, winsock.dll, ws2.dll, wsinstl.dll, wspm.dll, nspm.dll, secur32.dll, ntlmssp.dll, credsvc.dll, credprov.dll, afd.dll, ndis.dll, dhcp.dll, tcpstk.dll, tapi.dll, unimodem.dll, netbios.dll, ping.exe, ipconfig.exe, ndisconfig.exe, route.exe, netstat.exe, tracert.exe, serial.dll, mmtimer.dll, ole32.dll, oleaut32.dll, services.exe, httpd.dll, telnetd.dll,PCIbus.dll, pcc_tipccard.dll, pcc_serv.dll, pcmcia.dll, kbdmouse.dll, com16550.dll, ssce20.dll, ssceca20.dll, e100ce.dll - this is the driver that I am replacing, micro.dll
Files
ceconfig.h, wince.nls, initobj.dat, boot.hv, default.hv, user.hv, cemgrc.exe, cetlkitl.dll, cetlstub.dll, tcpipc.dll,
tlcesrv.dll, httpd_default.htm, NTLMInit.exe, version.exe, HECImageInfo.exe-version.exe and HECImageInfo.exe are run from an app on the drive itself.
I have tried adding the above files and modules that were missing by using the project.bib files in the Parameter view, but still this does not help. I am using this system on a MSM586SEN board and there is problems with the ethernet not connecting to the computer.
You can't just go and add these modules and files into your own BIB files. It's unlikely to work, plus it's a bad idea as there's nothing telling the system to generate those files. Select what you need from the catalog, which will set the proper SYSGEN veriables. That, in turn, will build the proper pieces and include them into the OS.
If you want to "clone" what was in an image, but don't have the project file for it, then look in the \windows\ceconfig.h file of the running OS. It will list every SYSGEN set during the build process. You can then manually set them in your new project, or select the proper catalog items to set them (hover on a catalog item and it will tell you the SYSGEN it sets - alternately you might just manually edit your project file with a text editor and add them).
Once you have that, then you can add drivers, debug connectivity issues, etc.

Build error "The process cannot access the file because it is being used by another process" in WP7?

I guess we can add this question to the list. Basically It's been taking me twice the time to try something out because everytime I try to debug my app I have to wait about a minute to lauch the app. There are 3 files in order that it complains about.
Resources file (.g)
Program Debug Database
DLL (.dll)
I tried removing the first two, but then it complains about the DLL file. Strangely enough I have never encountered this and I've been using the the WP7 emulator in VS2010 for about a year. Any ideas? Is there possibly a setting or cache that can be deactivated?
Basically when you add images to your project, by default they are added as a resource. By doing this everytime you try to build the project the images are saved in the dll file thus the long wait time. I set 95% of my images to content and have not had the issue since.

Bundling images with Blackberry

How do I get bundled images with the BlackBerry Eclipse Plugin 1.1 Beta? I copied an image into "res/background.jpg" and tried to load it using Bitmap.getBitmapResource on background.jpg. Unfortunately, the image wasn't found (Illegal argument exception). I tried moving my image file into the src folder as per the advice here, but that didn't work either. I have opened up the .jar file and the background image is present at the root of the .jar file. The option to convert image files to .png isn't selected either.
Links
Could not find sample
Library Reference
Two things:
The res folder needs to be a "source directory" in Eclipse. You can achieve this by right-clicking on the folder and going to "Build Path" -> "Use As Source Folder".
When calling Bitmap.getBitmapResource(), like Michael B. said above, you shouldn't put the folder name in the path. Just call Bitmap.getBitmapResource("background.jpg");
Finally, I'm assuming that because your resource is called "background.jpg" you want it to be the background for a Screen. If this is the case, make sure to set the background using the Screen's Main Manager instead of on the screen itself. For example:
public class MyScreen extends MainScreen
{
public MyScreen() {
getMainManager().setBackground(
BackgroundFactory.createBitmapBackground(
Bitmap.getBitmapResource("background.jpg")));
}
}
When you added the resource to the res folder, did you perform a refresh of the project in Eclipse? If it doesn't 'see' it, the packager ignores it. If you restarted Eclipse, it would pick it up the next time, which might explain why it started working randomly.
This should be the code to load your image, without any directory in the path.
Bitmap.getBitmapResource("background.jpg")
Then put the image in any package of your src directory like in
com.rim.sample.resources
When you say it failed what do you mean? Does it throw an error?
I've found that when I add/change a resource it might not take affect immediately. What I found I need to do is to delete the cod file and run a clean on the project (not just build it), then run the packaging (rapc) command. This should make sure the image is there.

Resources