AndEngine Error with PhysicsWorld - andengine

i am new with java and andengine and try to make the released jumper game to learn how it works. all fine now but if i try to load the PhysicsWorld i will get as follow errors:
E/AndroidRuntime: FATAL EXCEPTION: UpdateThread
Process: com.alex.neuertest, PID: 15463
java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.alex.neuertest-1/base.apk", zip file "/data/app/com.alex.neuertest-1/split_lib_dependencies_apk.apk", zip file "/data/app/com.alex.neuertest-1/split_lib_slice_0_apk.apk", zip file "/data/app/com.alex.neuertest-1/split_lib_slice_1_apk.apk", zip file "/data/app/com.alex.neuertest-1/split_lib_slice_2_apk.apk", zip file "/data/app/com.alex.neuertest-1/split_lib_slice_3_apk.apk", zip file "/data/app/com.alex.neuertest-1/split_lib_slice_4_apk.apk", zip file "/data/app/com.alex.neuertest-1/split_lib_slice_5_apk.apk", zip file "/data/app/com.alex.neuertest-1/split_lib_slice_6_apk.apk", zip file "/data/app/com.alex.neuertest-1/split_lib_slice_7_apk.apk", zip file "/data/app/com.alex.neuertest-1/split_lib_slice_8_apk.apk", zip file "/data/app/com.alex.neuertest-1/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/com.alex.neuertest-1/lib/x86, /data/app/com.alex.neuertest-1/base.apk!/lib/x86, /data/app/com.alex.neuertest-1/split_lib_dependencies_apk.apk!/lib/x86, /data/app/com.alex.neuertest-1/split_lib_slice_0_apk.apk!/lib/x86, /data/app/com.alex.neuertest-1/split_lib_slice_1_apk.apk!/lib/x86, /data/app/com.alex.neuertest-1/split_lib_slice_2_apk.apk!/lib/x86, /data/app/com.alex.neuertest-1/split_lib_slice_3_apk.apk!/lib/x86, /data/app/com.alex.neuertest-1/split_lib_slice_4_apk.apk!/lib/x86, /data/app/com.alex.neuertest-1/split_lib_slice_5_apk.apk!/lib/x86, /data/app/com.alex.neuertest-1/split_lib_slice_6_apk.apk!/lib/x86, /data/app/com.alex.neuertest-1/split_lib_slice_7_apk.apk!/lib/x86, /data/app/com.alex.neuertest-1/split_lib_slice_8_apk.apk!/lib/x86, /data/app/com.alex.neuertest-1/split_lib_slice_9_apk.apk!/lib/x86, /system/lib, /vendor/lib]]] couldn't find "libandenginephysicsbox2dextension.so"
at java.lang.Runtime.loadLibrary0(Runtime.java:972)
at java.lang.System.loadLibrary(System.java:1530)
at org.andengine.extension.physics.box2d.PhysicsWorld.<clinit>(PhysicsWorld.java:35)
at com.alex.neuertest.GameScene.createPhysics(GameScene.java:345)
at com.alex.neuertest.GameScene.createScene(GameScene.java:96)
at com.alex.neuertest.BaseScene.<init>(BaseScene.java:41)
at com.alex.neuertest.GameScene.<init>(GameScene.java:0)
at com.alex.neuertest.Core.SceneManager$1.onTimePassed(SceneManager.java:148)
at org.andengine.engine.handler.timer.TimerHandler.onUpdate(TimerHandler.java:94)
at org.andengine.engine.handler.UpdateHandlerList.onUpdate(UpdateHandlerList.java:47)
at org.andengine.engine.Engine.onUpdateUpdateHandlers(Engine.java:618)
at org.andengine.engine.Engine.onUpdate(Engine.java:605)
at org.andengine.engine.LimitedFPSEngine.onUpdate(LimitedFPSEngine.java:57)
at org.andengine.engine.Engine.onTickUpdate(Engine.java:568)
at org.andengine.engine.Engine$UpdateThread.run(Engine.java:858)
maybe anyone can help me whats there wrong? how i said, iam new on this system xD

This error means that the library for physics box was not found. You have to add physicsbox2dextenstion.so file in app folder as shown in picture. You may be clear after watching picture. Hope this help you.

Project not able to find libandenginephysicsbox2dextension.so. Check do you have .so files inside your project. For different cpu architecture there are three .so file inside AndEnginePhysicsBox2DExtension.

Related

Creating and loading AssetBundle manifest in Unity

I am loading some assets from assetBundles that I store online. I want to cash some of them but I need a bundle manifest for That.I am using this to build the bundle.
BuildPipeline.BuildAssetBundles(assetBundleDirectory, BuildAssetBundleOptions.None, BuildTarget.Android);
This gives me enter image description here, first file is assetBundle, the secound is manifest for that assetbundle. Based on what I found online I think it should also create a manifest named atlases (for the folder), but it doesnt.
If i try to load one of the assetBundle manifests using this
AssetBundle manifestBundle = AssetBundle.LoadFromFile(Path.Combine(Application.streamingAssetsPath, "atlases/atlascity1") //fails with error: "Unable to open archive file: C:/ProjectPath/StreamingAssets/atlases/atlascity1"
//ver. B:
AssetBundle manifestBundle = AssetBundle.LoadFromFile(Path.Combine(Application.streamingAssetsPath, "atlases/atlascity1.manifest") //fails with error: "Unable to read header from archive file: C:/ProjectPath/StreamingAssets/atlases/atlascity1.manifest"
What am I missing?

Unable to find file under resources folder

When I run my app in sbt console my-app/run (my-app is a module), I get this error
java.io.FileNotFoundException: file:.../target/bg-jobs/sbt_eea980c4/job-3/target/aaa32a5e/b2227e4f/my-app_2.13-0.1.0-SNAPSHOT.jar!/my_file.csv
My directory structure is my-app->src->main->resources->my_file.csv. The way I am accessing the file in my code is:
val file = new File(getClass.getResource("/my_file.csv").getPath)
What am I missing here?
sbt stuck your resources in a jar, so you can't access them as a file. You can use getClass().getResourceAsStream("/my_file.csv") instead.

Google OR tools

I am learning to solve some optimisation programs using google or-tools.
I started with their example code and I an trying to run it in intellij.
But when I write the code and compile I get the following error.
Exception in thread "main" java.lang.UnsatisfiedLinkError: com.google.ortools.linearsolver.operations_research_linear_solverJNI.MPSolver_CLP_LINEAR_PROGRAMMING_get()I
at com.google.ortools.linearsolver.operations_research_linear_solverJNI.MPSolver_CLP_LINEAR_PROGRAMMING_get(Native Method)
at com.google.ortools.linearsolver.MPSolver$OptimizationProblemType.<clinit>(MPSolver.java:221)
I searched for some answers and I found that it requires jniortools.dll .
But I am working with ubuntu. Hence i assume i need to load the libjniortools.so file , am I right?.
So I included the line
static {
System.loadLibrary("libjniortools");
}
and I have a lib folder wherein I have put both com.google.ortools.jar and protobuf.jar along with all the other lib files that were present when I extracted the zip file(basically copy pasted the lib folder from extracted zip file).
I have added the jar paths in intellij as shown in figure
enter image description here
*the last 2 line of dependency in image
Then I have also tried giving the lib path in VM-options:
-Djava.library.path=/home/surajvashistha/IdeaProjects/LPModel/lib
After all this, I get the following error
Exception in thread "main" java.lang.UnsatisfiedLinkError: no libjniortools in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1860)
at java.lang.Runtime.loadLibrary0(Runtime.java:871)
at java.lang.System.loadLibrary(System.java:1124)
at LP.<clinit>
I am stuck here and not able to move forward. Can anyone help?

pyinstaller Adafruit DHT library raspberry_Pi_Driver.so: cannot open shared object

I'm using Adafruit_DHT library in a file and when I try to use pyinstaller to compile, I get an error that Raspberry_Pi_Driver.so: cannot open shared object file
I'm using normal RPi (not model 2) and raspbian. The file that I'm trying to compile works by itself fine. The Raspberry_Pi_Driver.so is there I did find ./ | grep Raspberry_Pi_Driver.so and it existed. I tried also to use the --hidden-import=Adafruit_DHT when compiling the pyinsatller and that did not work too. When compiling it does not give any error.
I noticed after compilation and in the build folder thee is an Adafruit_DHT folder that has the driver and etc.
Any idea what's going on? Could it be that the library has been recreated under build folder and this is confusing when executing the file?
I found a resolution for this (thanks to: k4ml.me/posts/pyinstaller.html) I just added '-p /path/to/mylib' when creating the exe file and mylib was the directory that Adafruit_DHT folder was (that Adafruit_DHT_Driver.so file was there).

Error reading manifest file "...datanucleus-core-3.0.0-release.jar!/plugin.xml"

I got a very strange error. This what I've done:
I create a project (with Netbeans) which include datanucleuse-core-3.0.0-release.jar. The project can be built successfully. It also ran smoothly when I tried to run it with Netbeans or running 'java -jar <.jar bundle>' in dist folder via command prompt.
The problem is, when I copy that dist folder into another location and tried to run it again with command prompt, it gave these errors:
Exception in thread "main" Error reading manifest file
"jar:file:/E:/!new/BTJ/NCRServer/lib/datanucleus-core-3.0.0-release.jar!/plugin.xml"
org.datanucleus.exceptions.NucleusException: Error reading manifest
file "jar:fi
le:/E:/!new/BTJ/NCRServer/lib/datanucleus-core-3.0.0-release.jar!/plugin.xml"
at org.datanucleus.plugin.NonManagedPluginRegistry.registerBundle(NonMan
agedPluginRegistry.java:481)
at org.datanucleus.plugin.NonManagedPluginRegistry.registerExtensions(No
nManagedPluginRegistry.java:219)
at org.datanucleus.plugin.NonManagedPluginRegistry.registerExtensionPoin
ts(NonManagedPluginRegistry.java:160)
at org.datanucleus.plugin.PluginManager.(PluginManager.java:62)
at org.datanucleus.NucleusContext.(NucleusContext.java:211)
at org.datanucleus.NucleusContext.(NucleusContext.java:166)
at org.datanucleus.api.jdo.JDOPersistenceManagerFactory.(JDOPersis
tenceManagerFactory.java:360)
at org.datanucleus.api.jdo.JDOPersistenceManagerFactory.createPersistenc
eManagerFactory(JDOPersistenceManagerFactory.java:290)
at org.datanucleus.api.jdo.JDOPersistenceManagerFactory.getPersistenceMa
nagerFactory(JDOPersistenceManagerFactory.java:191)
at com.ncr.server.Server.(Server.java:68)
at com.ncr.server.Server.main(Server.java:91) Caused by: java.io.FileNotFoundException: E:\ (The system cannot find the path s
pecified)
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.(ZipFile.java:114)
at java.util.jar.JarFile.(JarFile.java:135)
at java.util.jar.JarFile.(JarFile.java:99)
at org.datanucleus.plugin.NonManagedPluginRegistry.registerBundle(NonMan
agedPluginRegistry.java:390)
... 10 more Nested Throwables StackTrace: java.io.FileNotFoundException: E:\ (The system cannot find the path
specified)
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.(ZipFile.java:114)
at java.util.jar.JarFile.(JarFile.java:135)
at java.util.jar.JarFile.(JarFile.java:99)
at org.datanucleus.plugin.NonManagedPluginRegistry.registerBundle(NonMan
agedPluginRegistry.java:390)
at org.datanucleus.plugin.NonManagedPluginRegistry.registerExtensions(No
nManagedPluginRegistry.java:219)
at org.datanucleus.plugin.NonManagedPluginRegistry.registerExtensionPoin
ts(NonManagedPluginRegistry.java:160)
at org.datanucleus.plugin.PluginManager.(PluginManager.java:62)
at org.datanucleus.NucleusContext.(NucleusContext.java:211)
at org.datanucleus.NucleusContext.(NucleusContext.java:166)
at org.datanucleus.api.jdo.JDOPersistenceManagerFactory.(JDOPersis
tenceManagerFactory.java:360)
at org.datanucleus.api.jdo.JDOPersistenceManagerFactory.createPersistenc
eManagerFactory(JDOPersistenceManagerFactory.java:290)
at org.datanucleus.api.jdo.JDOPersistenceManagerFactory.getPersistenceMa
nagerFactory(JDOPersistenceManagerFactory.java:191)
at com.ncr.server.Server.(Server.java:68)
at com.ncr.server.Server.main(Server.java:91)
Anybody got clue ?
I am really sorry for everyone, especially for datanucleus members in StackOverflow.
Apparently the problem is me, not the netbeans, datanucleus API, nor anyone.
As you can see from "jar:file:/E:/!new/BTJ/NCRServer/lib/datanucleus-core-3.0.0-release.jar!/plugin.xml", I put the "dist" folder from Netbeans in "E:/!new" folder. I don't know why but the "!new" folder seems to cause the extra exclamation mark(!) in "release.jar!".
I move the dist folder into D:/ and it worked !!
So, if anyone ever experience this problem (precedence a folder's name with exclamation mark and accidentally put a project with datanucleus-core-3.0.0-release.jar inside it), that's the solution.
Thank you.