Name Not Found Even if Exists in the JSON file Updated - json

There is a runtime error which keeps telling me that the name have not been found. Take a look at this error:
Exception in thread "LWJGL Application" com.badlogic.gdx.utils.GdxRuntimeException: java.lang.RuntimeException: Name 'lame' was not found.
at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:111)
Caused by: java.lang.RuntimeException: Name 'lame' was not found.
at aurelienribon.bodyeditor.BodyEditorLoader.attachFixture(BodyEditorLoader.java:79)
at com.bodapps.shootme.physics.controller.BodyPhysicsSettings.setGoalPostBody(BodyPhysicsSettings.java:32)
at com.bodapps.shootme.view.GameScreen.show(GameScreen.java:273)
at com.badlogic.gdx.Game.setScreen(Game.java:59)
at com.bodapps.shootme.Start.create(Start.java:11)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:125)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:108)
This error came from this code. Take a look and see comment on code below.
goalPost1 = wc.getWorld().createBody(def1);
goalPost1.setActive(true);
goalPost1.setGravityScale(0);
goalPostLoader1.attachFixture(goalPost1, "lame", fixtures1, 5); // --> Under the same JSON filenamename and added and updated this name "lame." However, this is where it stops here.
goalPost2 = wc.getWorld().createBody(def2);
goalPost2.setActive(true);
goalPost2.setGravityScale(0);
goalPostLoader2.attachFixture(goalPost2, "soccer ball", fixtures2, 5); // --> This name, also in the same JSON filename. Even it has a space, it should be worked too.
The JSON filename "ball physics.json" and this is where I took it from the Physics Body Editor engine.
Here's the code from the JSON file.
{
"rigidBodies":
[
{
"name":"soccer ball",
"imagePath":"../images/soccer ball.png",
"origin":{"x":0,"y":0},"polygons":[],
"circles":[{"cx":0.5,"cy":0.5,"r":0.4756574332714081}],
"shapes":[{"type":"CIRCLE","vertices":[{"x":0.5,"y":0.5},{"x":0.5250000357627869,"y":0.02500000037252903}]}]
},
{
"name":"lame",
"imagePath":null,
"origin":{"x":0,"y":0},
"polygons":[[{"x":0.625,"y":0.05000000074505806},{"x":0.625,"y":0.949999988079071},{"x":0.3499999940395355,"y":0.949999988079071},{"x":0.3499999940395355,"y":0.05000000074505806}]],
"circles":[],
"shapes":[{"type":"POLYGON","vertices":[{"x":0.3499999940395355,"y":0.05000000074505806},{"x":0.3499999940395355,"y":0.949999988079071},{"x":0.625,"y":0.949999988079071},{"x":0.625,"y":0.05000000074505806}]}]
}
],
"dynamicObjects":[]
}
I registered the name "lame" after editing from the Physics Body Editor that saves as JSON file. Unfortunatelly, the programming software cheats on me even if I'm correct. Please, help me fix it as soon as possible.
Updated question! (As of 4/11/2013)
I wonder if the assets in the Desktop starter project folder matches with or it has the same and directory with the Android starter project folder? If that case, does the updating files added in the assets folder in project folder (Android starter) automatically updates in the Desktop starter project folder or not?

Due to the problem in updating at the Desktop starter project folder, the image files and JSON file was not directly from Android's assests automatically copied to Desktop's assets! In case of this problem, I have to manually copy it. It's the only best thing I could ever do. From the Android assets folder, select the specified file and directory (folder) and copy it to the assets folder in Desktop. Make sure that the directory and filename is correct.

Related

Android Studio Gradle error: Missing project_info object

basically opening this question again because the answer is outdated, as the link now redirects to Firebase:
Gradle fails building with "Missing project_info object"
I want to attach the google-services.json file to my Android Studio project, and every time I try to download it from the developers API from Google, it gives me a json file with a large name that does't correspond to the tutorial's simple "google-services" and renaming it won't work because of this error.
Downloading it creating a new project doesn't seem possible for me now as it the page gives me another error when I click Configure a Project (I already did that before but left the project there without downloading the json file directly from there, which seems to be the problem).
Where can I safely get this file, and should I rename it or? Thanks in advance.
Apparently the solution is just following the link and creating the project with Firebase:
Then create or select a project and fill it with your app data that shoul look like this (the SHA-1 key should be found in your console log when clicking the button in the image:
Then add the lines of code that should be in your build.gradle(app level one and project level one), editing them with notepadd. Finally you need to sync these Gradle files, in Android Studio : File->Sync project with Gradle Files
The tutorial is very self explatanory, but for beginners like me, this could help.

Gdx.files.internal not using android assets path

Whenever I try to use Gdx.files.internal to get a FileHandle, I am getting a FileNotFoundException like follows:
<PATH TO MY GAME>\desktop\xml\screen.xml (The system cannot find the path specified)
I set my project up using the libgdx project setup tool, and it seems that my asset folder within my desktop project is the same as my android project (they're linked). However, when I go to my desktop project there is a bin folder with my assets. If I change the path to "/bin/..." then I can run the project without any exceptions. However, I feel this may be a problem if I export as a JAR.
Code:
final FileHandle screenXML = Gdx.files.internal("xml/screen.xml");
My problem stemmed from the following (credit goes to the awesome and patient IRC community members for Libgdx):
// final Document screenDoc = docBuilder.parse(screenXML.file());
// Note: MUST use .read() here, not .file(), as we link from the android assets!
final Document screenDoc = docBuilder.parse(screenXML.read());

Deploy support files from secondary assembly

I'm, porting a phone application written using MVVMCross to Windows RT. The application uses SQLite and has a database that is not empty at deploy so I want it to be packaged in the installation folder anc copied to LacalFolder when the application starts.
The database really belongs to the "Core" assembly shared between phone and WinRT but if I put the file in the Core project (in a custom directory called Data), define it as Content and set the Copy Always flag the file does not get copied to the application installation folder.
If I put the file in a directory under the UI project the file gets copied as expected. Any suggestion to avoid keeping two files for the same resource (and the troubles this will cause) ?
Thanks for help
Windows 8 WinRT projects by default use the Content type which does loose packing of files (they are not included in the assembly). If your Core assembly is part of your solution as a project - VS will properly package it copying all the content to the "Core" subfolder of the appx. If you simply have the dll file referenced in your solution - the resource files will not be packaged. The solution in that case is to do something to get these additional files to deploy with the dll. One option is to package the dll as a .vsix together with the assets as described in Tim Heuer's blog post. Another is to do what you did and put the file in the app project. You can add the file to the app project "As Link" to avoid having a copy of the file - it makes Visual Studio create a sort of logical/symbolic link to the file instead of creating a copy - simply right click a folder in the Solution Explorer/app project, select "Add/Existing Item", browse to the file and instead of hitting the "Add" button - use the dropdown triangle on the button to select "Add As Link".

ZIP Embedding throws error

I want to embed a ZIP-file into my AS3/Air-application (with Flash Builder) and open it via FZip. For embedding, I use this code:
[Embed(source='../bin/art/resources.zip', mimeType="application/octet-stream")]
public static const rsClass:Class;
When I try to save the project the program chrashes and throws an error:
"Workspace is being build" has encountered a problem. During "Workspace is being build" an internal error has occured. (this is just a bad translation, not original) Java heap space
I click OK, the internal error appears:
The error "Disc space too low" has appeared. Look into the Readme-File at "Run Eclipse" you will find information [...] It is recommended to end the workbench. Do you want to end the workbench? yes/no
In an earlier version of this post I said, that the program doesnt start. That is not true. Only saving causes this error. Because of the saving errors, an earlier version of the program is started, but without errors. When I try to make a bytearray out of the zip, it causes an error (initial content not found), but I suppose the zip doesnt load, so this is not unusual.
you should NOT embed this ZIP but load it instead, you can add to the AIR package any files/folders.
To do it:
in Flash IDE go to "AIR for Android Settings" or "AIR for iOS Settings" and at the bottom of the dialogue box you have "Included files:" field then add folder or file you need,
for FlashDevelop what ever will be in bin folder will be packaged in air as described here
In Flex it will be the src folder and in the export wizzard you can select which files to include like described here.
Edit also you should consider for very large files following idea:
don't include big files (or just basic elements) and download big files and save on user device e.g. on sdcard, and then load it from there.
best regards

Getting Type not found error implementing source in as3

I am trying to just compile and run the demos from this article:
Flash talks to max msp via osc
I am using Flash Develop and Flex SDK with an up to date version of air.
When I run the demo: "as3_MaxFlashHarmony" I get an error I don't know how to fix. The source for the entire project is here:
the project
But specifically the error I am getting says:
col: 30 Error: Type was not found or was not a compile-time constant: OSCMessage.
here is the as3 file that it is specifically referencing:
//IHarmonyApp.as
package
{
import org.tuio.osc.OSCMessage;
public interface IHarmonyApp
{
function updateOSCData(msg:OSCMessage):void;
}
}
It uses the libraries Tuio, MinimalComps, and MonsterDebugger. The thing I don't get is that how can it not find OSCMessage if OSCMessage is properly imported? the IDE is making fine references to it and I can open it's declaration. OSCMessage is a public class. I don't get it.
To give some extra info for potential answers, the IDE flashdevelop can find the library org.tuio.osc.OSCMessage just fine, it gives the error regardless of if org.tuio... is a source path or not, and the overall path does not contain any special characters. I don't know if that might matter, but I feel like this is me making a stupid mistake somewhere. I can provide my project zipped if need be.
Thanks!
Edit 9:48, 8/25/12
I do have the file path org/tuio/osc/OSCMessage.as in my project, and the file OSCMessage exists. FlashDevelop can find it just fine and I can navigate to declaration at that location. This is why I got stumped.
Thanks again
In your AS3 folder apart of your de folder you would need to have org folder with relevant folders and classes.
For example to import org.tuio.osc.OSCMessage you would need a file:
../YourPackageRoot/org/tuio/osc/OSCMessage.as
The other way is including a SWC file (all folders and classes zipped into one swc file).
You can include the swc file in FlashDevelop by right clicking the swc file and selecting Add To Library