Android app force stop on modelBatch.render - android

I'm trying to render a model in libgdx - everything runs perfectly on the desktop, but on android force stop on modelBatch.render(poleInstance, environment);
Log:
03-30 16:37:40.317 5249-5249/? E/cutils-trace﹕ Error opening trace file: No such file or directory (2)
03-30 16:37:42.621 5269-5269/? E/cutils-trace﹕ Error opening trace file: No such file or directory (2)
03-30 16:37:46.181 5283-5283/com.badlogic.gdx.tests E/OpenGLRenderer﹕ Getting MAX_TEXTURE_SIZE from GradienCache
03-30 16:37:46.209 5283-5283/com.badlogic.gdx.tests E/OpenGLRenderer﹕ Getting MAX_TEXTURE_SIZE from Caches::initConstraints()
03-30 16:37:46.533 5283-5297/com.badlogic.gdx.tests E/EGL_genymotion﹕ [getAttribValue] Bad attribute idx
03-30 16:37:46.533 5283-5297/com.badlogic.gdx.tests E/EGL_genymotion﹕ tid 5297: eglGetConfigAttrib(605): error 0x3004 (EGL_BAD_ATTRIBUTE)
03-30 16:37:46.533 5283-5297/com.badlogic.gdx.tests E/EGL_genymotion﹕ [getAttribValue] Bad attribute idx
03-30 16:37:46.533 5283-5297/com.badlogic.gdx.tests E/EGL_genymotion﹕ tid 5297: eglGetConfigAttrib(605): error 0x3004 (EGL_BAD_ATTRIBUTE)
03-30 16:37:46.825 5283-5297/com.badlogic.gdx.tests E/AndroidRuntime﹕ FATAL EXCEPTION: GLThread 168
com.badlogic.gdx.utils.GdxRuntimeException: File not found: com/badlogic/gdx/graphics/g3d/shaders/default.vertex.glsl (Classpath)
at com.badlogic.gdx.files.FileHandle.read(FileHandle.java:134)
at com.badlogic.gdx.backends.android.AndroidFileHandle.read(AndroidFileHandle.java:78)
at com.badlogic.gdx.files.FileHandle.length(FileHandle.java:548)
at com.badlogic.gdx.backends.android.AndroidFileHandle.length(AndroidFileHandle.java:167)
at com.badlogic.gdx.files.FileHandle.estimateLength(FileHandle.java:229)
at com.badlogic.gdx.files.FileHandle.readString(FileHandle.java:194)
at com.badlogic.gdx.files.FileHandle.readString(FileHandle.java:187)
at com.badlogic.gdx.graphics.g3d.shaders.DefaultShader.getDefaultVertexShader(DefaultShader.java:409)
at com.badlogic.gdx.graphics.g3d.shaders.DefaultShader.<init>(DefaultShader.java:504)
at com.badlogic.gdx.graphics.g3d.shaders.DefaultShader.<init>(DefaultShader.java:500)
at com.badlogic.gdx.graphics.g3d.utils.DefaultShaderProvider.createShader(DefaultShaderProvider.java:46)
at com.badlogic.gdx.graphics.g3d.utils.BaseShaderProvider.getShader(BaseShaderProvider.java:34)
at com.badlogic.gdx.graphics.g3d.ModelBatch.render(ModelBatch.java:269)
at com.badlogic.gdx.tests.PathTest.render(PathTest.java:221)
at com.badlogic.gdx.backends.android.AndroidGraphics.onDrawFrame(AndroidGraphics.java:391)
at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1523)
at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1240)
03-30 16:37:51.401 5283-5283/com.badlogic.gdx.tests E/AndroidGraphics﹕ waiting for pause synchronization took too long; assuming deadlock and killing
03-30 16:37:51.521 475-517/system_process E/InputDispatcher﹕ channel '528ce2b4 com.badlogic.gdx.tests/com.badlogic.gdx.tests.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
Yes, my question is similar to this, but updating the library didn't helped
And yes, file com/badlogic/gdx/graphics/g3d/shaders/default.vertex.glsl in place
My code place here

The error is File not found, so apparently it cannot find the file. If you are sure the file is included, this might be caused by duplicate references (although it doesn't have to). For example if you include (and export) the gdx library in both your core and android project. You could check this by right clicking each project, click on Java Build Path and then the Order and Export tab. Make sure that the gdx project (or jar, depending if you work from source or nightly/stable) is only included (and exported by clicking the checkbox) in the core project.
However, having assets (which the shader files are) on the classpath is merely to support out-of-box rendering for libgdx. In your case would advise to copy the shader files to (a subfolder of) your assets folder and use those instead. That makes managing your assets a lot cleaner. You can load the shaders using the constructor of ModelBatch, e.g.:
modelbatch = new ModelBatch(Gdx.files.internal("data/default.vertex.glsl"), Gdx.files.internal("data/default.fragment.glsl"));
Of course, you still might want to double check your project configuration.

Please install Arm Transition on your Genymotion Emulator
Here is a detailed guide on How to install this transition :
How to install Google Play Services in a Genymotion VM (with no drag and drop support)?
I hope this helps.

Related

Android SDL2 Startup Crash

Can somebody please help me? I have a test SDL2 application which runs on my phone just fine. I took a copy of the sample app and began porting in code from my own application which builds and links just fine.
My application crashes on startup with the below error in the log (last line):
05-22 16:24:48.271 14834-14834/org.libsdl.app D/dalvikvm: Trying to load lib /data/app-lib/org.libsdl.app-13/libSDL2.so 0x42b0fb20
05-22 16:24:48.271 14834-14834/org.libsdl.app D/dalvikvm: Added shared lib /data/app-lib/org.libsdl.app-13/libSDL2.so 0x42b0fb20
05-22 16:24:48.271 14834-14834/org.libsdl.app D/dalvikvm: Trying to load lib /data/app-lib/org.libsdl.app-13/libmain.so 0x42b0fb20
05-22 16:24:48.281 14834-14834/org.libsdl.app A/libc: Fatal signal 11 (SIGSEGV) at 0x0000000c (code=1), thread 14834 (org.libsdl.app)
I have commented out my main() code and replaced this content with the main() from the sample app and it still crashes.
I'm faced with the long-winded task of incrementally including source files and components until I can identify the cause.
Does anybody know of a common cause for this please?
I am doing a clean build and run each time.
It looks like you have logcat's output filtering on. There should be a stack trace in the output after the 'fatal signal' line, which is visible if you select 'No filters' in logcat. Decoding that stack trace will hopefully make your search a bit narrower.

Is adding a libjitsi dependency to an Android project feasible?

I am actually working on an Android VOIP application that let user create conference with other users. My constraints are to avoid any use of a server like SIP servers to realise it and if I have to use a external library, it should be under LGPL license. I have succesfully done it in a peer-to-peer fashion using the AudioGroup and AudioStream classes of the android RTP stack.
My problem occurs in a 3-peers conference. Using AudioGroup, I have enabled the MODE_ECHO_SUPPRESSION but the results are very poor and I can hear my echo after 3 seconds. I came to conclusion that the Android RTP stack was not a good solution to my problem beacause using AudioGroup make impossible to tweek the sound and echo suppression seems to function badly.
By testing VOIP applications, I discovered a lot that were working pretty weel and more precisely Jitsi (homepage) which use a java library based on native code for the RTP stuff under the LGPL licence. I tried to follow this tutorial to use libjitsi but unfortunatly it gives me an error... At this time, I'm not sure that it is possible to use Libjitsi on an android project as it is normally used in Java projects.
Steps I went trough to get the error (using Android Studio)
I have compiled libjitsi from the build.xml contained in the sources and putted the resulting jar directly in the lib/ folder of my project.
I have added a dependency to libjitsi.jar in my build.gradle file
Called the static method Libjitsi.start() in the onCreate method of an activity
Error log
01-02 17:06:48.304 1523-1523/com.test.example I/LibJitsi﹕
Failed to initialize LibJitsi backend
org.jitsi.impl.libjitsi.LibJitsiOSGiImpl. (Exception stack trace
follows.) Will try an alternative.
java.lang.NoClassDefFoundError: org.osgi.framework.FrameworkUtil
at org.jitsi.impl.libjitsi.LibJitsiOSGiImpl.(LibJitsiOSGiImpl.java:34)
at java.lang.Class.newInstanceImpl(Native Method)
at java.lang.Class.newInstance(Class.java:1319)
at org.jitsi.service.libjitsi.LibJitsi.start(LibJitsi.java:227)
at org.jitsi.service.libjitsi.LibJitsi.start(LibJitsi.java:171)
at com.test.example.ui.createconf.CreateConfActivity.onCreate(CreateConfActivity.java:76)
at android.app.Activity.performCreate(Activity.java:4465)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1931)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1992)
at android.app.ActivityThread.access$600(ActivityThread.java:127)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1158)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4441)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native
Now if anyone already tried to use libjitsi on an AndroidProject or if you know it's not feasible, I would really be gratefull if you share your experience with me.
Thanks
Yes libjitsi dependency can be added to android, you can try jitsi-android which is an Android port of the Jitsi project . I have tried to run their sample app and it compiled fine.
However , I have shared 5 different libraries for VOIP calling on android in another answer you can have a look and try them.
Njoy!

Huawei Y300-0100 debugging issue

I am experiencing problems in order to see in Logcat the information related with the debug of my applications.
I never had that problem before, but when I recently purchased a Huawei Y300-0100 for developing I faced that issue. This problem doesn't appear using other devices.
A snapshot of the LogCat:
11-08 01:32:24.960: E/Trace(24713): error opening trace file: No such file or directory (2)
11-08 01:04:53.290: W/dalvikvm(23882): Refusing to reopen boot DEX '/system/framework/hwframework.jar'
11-08 01:04:55.570: I/Adreno200-EGL(23882): <qeglDrvAPI_eglInitialize:299>: EGL 1.4 QUALCOMM build: AU_LINUX_ANDROID_JB_REL_2.0.3.04.01.01.21.010_msm8625_JB_REL_2.0.3_Merge_release_AU (Merge)
11-08 01:04:55.570: I/Adreno200-EGL(23882): Build Date: 10/26/12 Fri
11-08 01:04:55.570: I/Adreno200-EGL(23882): Local Branch:
11-08 01:04:55.570: I/Adreno200-EGL(23882): Remote Branch: quic/jb_rel_2.0.3
11-08 01:04:55.570: I/Adreno200-EGL(23882): Local Patches: NONE
I tryied to find a solution but I have not been able to figure out what's wrong and how can I fix that.
Anybody has this smartphone and is not having issues? I would appretiate any comment.
Thank you.
Ok, after a long search on the web I finally encountered [that answer][1]: Huawei Ideos - LogCat not responding . Following the same instruction now I can see the debug messages like:
Log.d("hello","that's a probe")
On logcat, the "error opening trace file: No such file or directory (2)" has not disappeared.
Do you use the NDK library .so files in the application,I confront the same problem,I solve this problem just by fix the name of the library,Maybe that your application could not find the .so libarary.Hope it give some ideas.

Step by Step Tic Tac Toe Android sample failure

After reading a zillion posts on how to make a referenced library work with Android-Eclipse I must declare failure to run the provided sample tic-tac-toe, which is split into two projects TicTacToeLib (marked as library) and TicTacToeMain (which uses TicTacToeLib)
I first imported created TicTacToeLib into Eclipse (File->New->Other->Android->Android sample project->TicTacToeLib)
Then imported created TicTacToeMain into Eclipse (File->New->Other->Android->Android sample project->TicTacToeMain)
Followed the instructions on the Android Developers site on how to setup and reference a library project
Here I encounter the first obstacle, because on one hand the site mentions that <user-library> should be used, but the example Manifest for TicTacToeMain does not contain any <uses-library> element.
Either way the example does not run.
Without <user-library> element the project does not even compile:
If I add the tictactoelib.jar to the build path manually (Add JARs...), which is not part of the instructed steps in the Android Developers page, the errors dissapear, only the warnings remain. Running the app exits with failure (" Unfortunately Tic Tac Toe Sample has stopped "):
04-08 16:05:24.762: E/dalvikvm(3741): Could not find class 'com.example.android.tictactoe.library.GameActivity', referenced from method com.example.android.tictactoe.MainActivity.startGame
04-08 16:05:24.762: W/dalvikvm(3741): VFY: unable to resolve const-class 17 (Lcom/example/android/tictactoe/library/GameActivity;) in Lcom/example/android/tictactoe/MainActivity;
04-08 16:05:24.767: D/dalvikvm(3741): VFY: replacing opcode 0x1c at 0x0002
04-08 16:05:24.877: V/PhoneStatusBar(166): setLightsOn(true)
04-08 16:05:24.937: D/gralloc_goldfish(3741): Emulator without GPU emulation detected.
04-08 16:05:25.017: I/Process(89): Sending signal. PID: 3741 SIG: 3
04-08 16:05:25.027: I/dalvikvm(3741): threadid=3: reacting to signal 3
04-08 16:05:25.037: I/dalvikvm(3741): Wrote stack traces to '/data/anr/traces.txt'
04-08 16:05:25.058: I/ActivityManager(89): Displayed com.example.android.tictactoe/.MainActivity: +1s368ms
04-08 16:05:25.317: W/NetworkManagementSocketTagger(89): setKernelCountSet(10013, 0) failed with errno -2
04-08 16:05:27.857: D/AndroidRuntime(3741): Shutting down VM
04-08 16:05:27.857: W/dalvikvm(3741): threadid=1: thread exiting with uncaught exception (group=0x409c01f8)
04-08 16:05:27.918: E/AndroidRuntime(3741): FATAL EXCEPTION: main
04-08 16:05:27.918: E/AndroidRuntime(3741): java.lang.NoClassDefFoundError: com.example.android.tictactoe.library.GameActivity
04-08 16:05:27.918: E/AndroidRuntime(3741): at com.example.android.tictactoe.MainActivity.startGame(MainActivity.java:51)
04-08 16:05:27.918: E/AndroidRuntime(3741): at com.example.android.tictactoe.MainActivity.access$0(MainActivity.java:50)
04-08 16:05:27.918: E/AndroidRuntime(3741): at com.example.android.tictactoe.MainActivity$1.onClick(MainActivity.java:38)
04-08 16:05:27.918: E/AndroidRuntime(3741): at android.view.View.performClick(View.java:3511)
04-08 16:05:27.918: E/AndroidRuntime(3741): at android.view.View$PerformClick.run(View.java:14105)
Adding the following line to the TicTacToeMain manifest:
<uses-library android:name="com.example.android.tictactoe.library"/>
does not even launch the app:
[2013-04-08 19:13:03 - TicTacToeMain] Android Launch!
[2013-04-08 19:13:03 - TicTacToeMain] adb is running normally.
[2013-04-08 19:13:03 - TicTacToeMain] Performing com.example.android.tictactoe.MainActivity activity launch
[2013-04-08 19:13:03 - TicTacToeMain] Automatic Target Mode: using existing emulator 'emulator-5554' running compatible AVD 'Smartphone_ics'
[2013-04-08 19:13:03 - TicTacToeMain] Uploading TicTacToeMain.apk onto device 'emulator-5554'
[2013-04-08 19:13:03 - TicTacToeMain] Installing TicTacToeMain.apk...
[2013-04-08 19:13:06 - TicTacToeMain] Installation error: INSTALL_FAILED_MISSING_SHARED_LIBRARY
[2013-04-08 19:13:06 - TicTacToeMain] Please check logcat output for more details.
[2013-04-08 19:13:06 - TicTacToeMain] Launch canceled!
I tried other things, none solved the problem:
Changed the target TicTacToeMain version to 15, to 10
Added the TicTacToeLib as User Library in the build path
Created a libs folder for TicTacToeMain, and copied tictactoelib.jar, did not solve, imported the tictactoelib.jar uising Import..., no sugar
The reason I want this sample to work, besides understadning how to the mechnaism for referenced libraries work, is that I want to create a complex app, using many referenced libraries and if I cannot make this silly sample work, then I will not be able to.
One more point, adding the reference library project to TicTacToeMain:
It does not stick, I press Apply as instructed, then OK. But when I open the Project's properties again (no run, no compile, just reopen):
Maybe this is the real symptom, but I don't know what else to try.
I use Eclipse 4.2.1, Android SDK 21.1, Java IDE 1.5.1
Target Java Compliance level is 1.6
I tried several AVDs emulators, all show the same problem.
about the reference library
This error means that your TicTacToLib is using from another project, to solve this error you have to :
copy the tictactolib.
delete that project which is using the tictactolib and check the remove from the hard disk.
past the tictactolib to the old path.
try again and the error will be gone.
Note:ofc, you can just un import the library from the project which is using it right now without deleting that project.
It is just to do a new-project-android->Android Sample Project->Tictactoemain/lib. Do not import, just a new project and it works. In any case right click on project name -> Android Tools -> Fix Project Properties and in the menu Project-> Clean.
Maybe another clean workspace or new emulator device (is it correctly setup?)? You have all java, android sdk, adt and so on? I have no such problems.
This voodoo process finally got the project to compile and run properly.
I still don't know what is it that made the difference, so if you understand, please edit this asnwer and complete the explanation.
Process:
After many unsuccsessful tries I decided to export the JAR file from TicTacToeLib project and add the exported JAR to the TicTacToeMain project. Doing that solved the ClassNotFound exception but created a new problem: duplicates resource IDs (see this post).
So I deleted the imported JAR from the libs directory and from the build path and just by a desperate act I went to TicTacToeMain propeties->Android and added TicTacToeLib as reference. I've done this before at least 4 times and it did not work. I don't know why I even tried it again.
This time I noticed at the edge of my vision that something changed in the Package Explorer pane in Eclipse. I discovered that something was added under TicTactToeMain/gen. A com.example.tictactoe.library folder containing a R.java file with renumbered ID's that do not conflict with the main project's IDs. This has never happened before in my other attemps to add a reference library. So I run the app and this time it ran OK.
As I said, at this point this is voodoo to me, I don't know what I did different now than in the previous 4 times I tried the same.

Android ndk 8b Cannot load library

Upgrading to ndk 8b I receiving some crash report (most of them are Galaxy SII with Android 4.03)
java.lang.UnsatisfiedLinkError: Cannot load library: reloc_library[1286]: 1836 cannot locate '__gnu_thumb1_case_uqi'...
at java.lang.Runtime.loadLibrary(Runtime.java:370)
at java.lang.System.loadLibrary(System.java:535)
at com.iuculano.fplayer.SDLActivity.void onCreate(android.os.Bundle)(SourceFile:324)
at android.app.Activity.performCreate(Activity.java:4465)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1052)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1932)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1993)
at android.app.ActivityThread.access$600(ActivityThread.java:127)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1159)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4507)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:790)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:557)
at dalvik.system.NativeStart.main(Native Method)
The exception is caused by a simple System.loadLibrary("main");
What does it mean? cannot locate '__gnu_thumb1_case_uqi'
The __gnu_thumb1_case_uqi is a helper which does an indexed jump on a densely packed switch table; quickly implements the switch. You have two options: avoid it or link with it.
If you increase an optimization level (by using -O3) you might not need this symbol. Also, changing the CPU may help as well as using thumb2 instructions. Compiling with the -ffreestanding option may also avoid this symbol. If you have control over the switch statement, you can replace it with an array of function pointers.
This routine is inside libgcc. You can statically link libgcc. Somewhere in the Android SDK/compiler, there must be a libgcc.a. Link with libgcc.a, using -L and -l or use -static-libgcc linker option to get the code (see http://gcc.gnu.org/onlinedocs/gcc/Link-Options.html).
Edit: If you aren't compiling anything, then you can find libgcc.so on your system. It might be in /lib or /usr/lib or perhaps some place weird for Android devices. Adding the directory where the libgcc.so is located to the environment variable LD_LIBRARY_PATH could also fix the problem. It maybe unfortunate that Samsung released incompatible binaries and you have no way to fix the issue if you aren't compiling your own code. The correct libgcc.so maybe inside something like /usr/lib/thumb for multi-lib distributions. I don't know much about the Davlik stuff, but the Android JVM might not pointing to the right set of libraries when it runs.
Are you compiling for armv7? If you're not, try compiling for armv7.
Producing optimised NDK code for multiple architectures?
read about 'arm' vs 'thumb' in the accepted answer in the above link.
then, remove your config instructions to build for thumb and verify that you are building for arm...
OR...
ill make a wild guess ... its the library order you have in the linker statement in your 'Android.mk'
try the google forum for ndk ... searching for 'cannot locate symbol'...
Really desperate?
see 'Runtime errors' section here

Categories

Resources