runTime error in libGDX - android

in past i worked with my projects and everything was good. but recently, i have this errors:
06-02 04:52:27.954: W/dalvikvm(344): Exception Ljava/lang/UnsatisfiedLinkError; thrown while initializing Lcom/badlogic/gdx/backends/android/AndroidApplication;
06-02 04:52:27.954: W/dalvikvm(344): Class init failed in newInstance call (Lcom/Jumper/ProjectAndroidActivity;)
06-02 04:52:27.963: D/AndroidRuntime(344): Shutting down VM
06-02 04:52:27.963: W/dalvikvm(344): threadid=1: thread exiting with uncaught exception (group=0x40015560)
06-02 04:52:27.993: E/AndroidRuntime(344): FATAL EXCEPTION: main
06-02 04:52:27.993: E/AndroidRuntime(344): java.lang.ExceptionInInitializerError
06-02 04:52:27.993: E/AndroidRuntime(344): at java.lang.Class.newInstanceImpl(Native Method)
06-02 04:52:27.993: E/AndroidRuntime(344): at java.lang.Class.newInstance(Class.java:1409)
06-02 04:52:27.993: E/AndroidRuntime(344): at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
06-02 04:52:27.993: E/AndroidRuntime(344): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1561)
06-02 04:52:27.993: E/AndroidRuntime(344): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
06-02 04:52:27.993: E/AndroidRuntime(344): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
06-02 04:52:27.993: E/AndroidRuntime(344): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
06-02 04:52:27.993: E/AndroidRuntime(344): at android.os.Handler.dispatchMessage(Handler.java:99)
06-02 04:52:27.993: E/AndroidRuntime(344): at android.os.Looper.loop(Looper.java:123)
06-02 04:52:27.993: E/AndroidRuntime(344): at android.app.ActivityThread.main(ActivityThread.java:3683)
06-02 04:52:27.993: E/AndroidRuntime(344): at java.lang.reflect.Method.invokeNative(Native Method)
06-02 04:52:27.993: E/AndroidRuntime(344): at java.lang.reflect.Method.invoke(Method.java:507)
06-02 04:52:27.993: E/AndroidRuntime(344): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
06-02 04:52:27.993: E/AndroidRuntime(344): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
06-02 04:52:27.993: E/AndroidRuntime(344): at dalvik.system.NativeStart.main(Native Method)
06-02 04:52:27.993: E/AndroidRuntime(344): Caused by: java.lang.UnsatisfiedLinkError: Couldn't load gdx: findLibrary returned null
06-02 04:52:27.993: E/AndroidRuntime(344): at java.lang.Runtime.loadLibrary(Runtime.java:429)
06-02 04:52:27.993: E/AndroidRuntime(344): at java.lang.System.loadLibrary(System.java:554)
06-02 04:52:27.993: E/AndroidRuntime(344): at com.badlogic.gdx.utils.GdxNativesLoader.load(GdxNativesLoader.java:116)
06-02 04:52:27.993: E/AndroidRuntime(344): at com.badlogic.gdx.backends.android.AndroidApplication.<clinit>(AndroidApplication.java:59)
06-02 04:52:27.993: E/AndroidRuntime(344): ... 15 more
i think this errors are from my libs. but i change them with new ones. is there any solution for it?

This error occurs when the armeabi and armeabi-v7a directories cannot be found. Copy both of these directories and their contents into the libs directory of your project.
It should look something like this:

you copied the wrong .so files in the folders. I assume you extracted them from gdx-natives.jar. Instead directly copy the armeabi and armeabi-v7a folders from the release/nightly. Make sure to use jars and natives only from a single release, do not mix jars and natives from multiple releases.
Alternatively use the gdx-setup-ui, as described here http://code.google.com/p/libgdx/wiki/ProjectSetupNew

I got that same error on my VM and other emulators, and found it was because they ran x86 O/S'es, which libgdx does not support.
If it doesn't work on the device either, try this:
android-project -> properties -> java Build Path -> Order and Export.
Click the project you've linked to (your plain java-project or desktop-project) and click the "Up"-button until it is at the very top. Make sure it's ticked [V].
I did that with the jars too, just in case, and now it runs on my device. I still get that same error on my x86 VM, because libgdx does not support x86 Android devices.

Related

AVD crashes saying 'Unfortunately, libcocos2dx has crashed'

I just loaded my app created by cocos2dx-3.10 and when I open with it an AVD (again I haven't done any modifications to the app) the app crashes and gives the error: Unfortunately, libcocos2dx has crashed.
here is what I get in my android Monitor:
03-05 18:34:56.668 1435-1435/? D/dalvikvm: Not late-enabling CheckJNI (already on)
03-05 18:34:56.989 1435-1435/com.trying.name E/Trace: error opening trace file: No such file or directory (2)
03-05 18:34:57.419 1435-1435/com.trying.name D/AndroidRuntime: Shutting down VM
03-05 18:34:57.419 1435-1435/com.trying.name W/dalvikvm: threadid=1: thread exiting with uncaught exception (group=0xb2f2b288)
03-05 18:34:57.518 1435-1435/com.trying.name E/AndroidRuntime: FATAL EXCEPTION: main
java.lang.UnsatisfiedLinkError: Couldn't load cocos2dcpp: findLibrary returned null
at java.lang.Runtime.loadLibrary(Runtime.java:365)
at java.lang.System.loadLibrary(System.java:535)
at org.cocos2dx.lib.Cocos2dxActivity.onLoadNativeLibraries(Cocos2dxActivity.java:248)
at org.cocos2dx.lib.Cocos2dxActivity.onCreate(Cocos2dxActivity.java:263)
at android.app.Activity.performCreate(Activity.java:5008)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
at android.app.ActivityThread.access$600(ActivityThread.java:130)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4745)
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:786)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)
03-05 18:35:11.559 1435-1435/? I/Process: Sending signal. PID: 1435 SIG: 9

Cordova hello world app crashing

I am new in Android Development. I am working on cordova platform
I have created a sample hello world app and getting this error when i am trying to open it in genymotion. ALthough the app compile succesfully but when i run it in genymotion it just shows the prompt with text "Unfortunately "APP" has stopped."
The Error log shows.
01-12 08:16:04.867 2073-2073/com.technoserves.crudnew D/dalvikvm﹕ Late-enabling CheckJNI
01-12 08:16:06.107 2073-2073/com.technoserves.crudnew W/dalvikvm﹕ Unable to resolve superclass of Lcom/technoserves/crudnew/CordovaApp; (14)
01-12 08:16:06.119 2073-2073/com.technoserves.crudnew W/dalvikvm﹕ Link of class 'Lcom/technoserves/crudnew/CordovaApp;' failed
01-12 08:16:06.135 2073-2073/com.technoserves.crudnew D/AndroidRuntime﹕ Shutting down VM
01-12 08:16:06.135 2073-2073/com.technoserves.crudnew W/dalvikvm﹕ threadid=1: thread exiting with uncaught exception (group=0xa6142908)
01-12 08:16:06.155 2073-2073/com.technoserves.crudnew E/AndroidRuntime﹕ FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.technoserves.crudnew/com.technoserves.crudnew.CordovaApp}: java.lang.ClassNotFoundException: Didn't find class "com.technoserves.crudnew.CordovaApp" on path: /data/app/com.technoserves.crudnew-1.apk
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2106)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
at android.app.ActivityThread.access$600(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5041)
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:793)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.technoserves.crudnew.CordovaApp" on path: /data/app/com.technoserves.crudnew-1.apk
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:65)
at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
at android.app.Instrumentation.newActivity(Instrumentation.java:1054)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2097)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
            at android.app.ActivityThread.access$600(ActivityThread.java:141)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
            at android.os.Handler.dispatchMessage(Handler.java:99)
            at android.os.Looper.loop(Looper.java:137)
            at android.app.ActivityThread.main(ActivityThread.java:5041)
            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:793)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
            at dalvik.system.NativeStart.main(Native Method)
01-12 08:16:22.399 2073-2073/com.technoserves.crudnew I/Process﹕ Sending signal. PID: 2073 SIG: 9
I have updated my cordova to resolve but still same error however a few days ago it was working fine and i have build some apps.
First download Cordova jar file from following link:
http://www.java2s.com/Code/JarDownload/cordova/cordova-1.8.1.jar.zip
after that extract the folder and put cordova-1.8.1 inside your libs folder of project in eclipse
And right click on your project--> properties and Select Android from left pane and scroll to bottom remove the cordova library if added.
then clean and build your project.

Vuforia jPCT integration and build jni

I getting following error while running imagetarge vuforia jPCT project
W/dalvikvm(3469): threadid=1: thread exiting with uncaught exception (group=0xa4c4e648)
E/AndroidRuntime(3469): FATAL EXCEPTION: main
E/AndroidRuntime(3469): java.lang.UnsatisfiedLinkError: Native method not found: com.qualcomm.ar.pl.CameraPreview.newFrameAvailable:(IIII[B)V
E/AndroidRuntime(3469): at com.qualcomm.ar.pl.CameraPreview.newFrameAvailable(Native Method)
E/AndroidRuntime(3469): at com.qualcomm.ar.pl.CameraPreview.onPreviewFrame(CameraPreview.java:805)
E/AndroidRuntime(3469): at android.hardware.Camera$EventHandler.handleMessage(Camera.java:791)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime(3469): at android.app.ActivityThread.main(ActivityThread.java:5103)
E/AndroidRuntime(3469): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(3469): at java.lang.reflect.Method.invoke(Method.java:525)
E/AndroidRuntime(3469): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
E/AndroidRuntime(3469): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
E/AndroidRuntime(3469): at dalvik.system.NativeStart.main(Native Method)
I read all vuforia blog and google search but not able to solve problem
Please help me...
Used latest vaforia.jar to solve problem
Download latest sdk from https://developer.vuforia.com/resources/sdk/android

Having issues integrating Scandit SDK into my app

Decided to use Scandit SDK to get the barcode scanning feature in my app. Unfortunately, since I'm relatively new to Android development and Java in general I've run into a few issues that I can't seem to work out. The demo that Scandit provided doesn't give any errors(runs fine) but crashes when I try to start it up (pressing a button from one activity is meant to start it up). I've tried reading the logcat and googling a solution to the problems but I'm not getting the right solutions. Does anyone have an idea of what I'm doing wrong?
Logcat is provided below:
10-08 23:30:00.807 21563-21563/com.kwesimbia.management D/AndroidRuntime? Shutting down VM
10-08 23:30:00.807 21563-21563/com.kwesimbia.management W/dalvikvm? threadid=1: thread exiting with uncaught exception (group=0x40aa4228)
10-08 23:30:00.817 21563-21563/com.kwesimbia.management E/AndroidRuntime? FATAL EXCEPTION: main
java.lang.IllegalStateException: Could not execute method of the activity
at android.view.View$1.onClick(View.java:3082)
at android.view.View.performClick(View.java:3549)
at android.view.View$PerformClick.run(View.java:14393)
at android.os.Handler.handleCallback(Handler.java:605)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:4944)
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 Method)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at android.view.View$1.onClick(View.java:3077)
at android.view.View.performClick(View.java:3549)
at android.view.View$PerformClick.run(View.java:14393)
at android.os.Handler.handleCallback(Handler.java:605)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:4944)
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 Method)
Caused by: java.lang.NoClassDefFoundError: com.kwesimbia.management.ScanditSDKDemoSimple
at com.kwesimbia.management.Activity_D.initiateCodeScan(Activity_D.java:63)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at android.view.View$1.onClick(View.java:3077)
at android.view.View.performClick(View.java:3549)
at android.view.View$PerformClick.run(View.java:14393)
at android.os.Handler.handleCallback(Handler.java:605)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:4944)
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 Method)
10-08 23:30:00.817 32726-587/? E/EmbeddedLogger? App crashed!
Process: com.kwesimbia.management
10-08 23:30:00.817 32726-587/? E/EmbeddedLogger? App crashed!
Package: com.kwesimbia.management v1 (1.0)
10-08 23:30:00.817 32726-587/? E/EmbeddedLogger?
Application Label: firstapp
10-08 23:30:00.827 32726-587/? W/ActivityManager?
Force finishing activity com.kwesimbia.management/.Activity_D
I came across this problem as well, my solution was to extract the library files and put them as their files in the lib folder
The library basically isn't being exported with it
EDIT
So I checked out my project, basically I did these things:
In the libs folder I have a new folder called armeabi and inside that I have libscanditsdk-android-3.3.1.so
Then in my build path I have also referenced the jar file that they provide:
<classpathentry exported="true" kind="lib" path="C:/GIT/Android/FwayScannerProject/FwayScanner/libs/scanditsdk-barcodepicker-android-3.3.1.jar"/>

FC when looking for record in SQLite

I have several methods for getting a record in my app
But for some reason this one keeps giving me FC !
I'm using the following method to get the Cursor :
Cursor c=helper.getRecordById(num);
Which is implemented as follows :
public Cursor getRecordById(int rowId) {
String rowIDs=""+rowId;
String SelectById = "SELECT id, OrderName, OrderLink, DateYear, DateMonth, DateDay, OrderPrice FROM Orders WHERE id=?";
String[] args={rowIDs};
return(getReadableDatabase().rawQuery(SelectById, args));
}
I have tried also without converting the Int to String but i just left it this way.. get the same error for both ways.
Whenever i get to the following line :
String name=c.getString(c.getColumnIndexOrThrow("OrderName"));
I get the FC.
The GetColumnIndex works just fine... i've tested it exclusively.
But the getString throws the error. :
06-02 21:07:13.656: W/KeyCharacterMap(4329): Using default keymap: /system/usr/keychars/qwerty.kcm.bin
06-02 21:07:16.006: D/AndroidRuntime(4329): Shutting down VM
06-02 21:07:16.006: W/dalvikvm(4329): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
06-02 21:07:16.026: E/AndroidRuntime(4329): FATAL EXCEPTION: main
06-02 21:07:16.026: E/AndroidRuntime(4329): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.Sagi.MyOrders/com.Sagi.MyOrders.DisplayRecord}: android.database.CursorIndexOutOfBoundsException: Index -1 requested, with a size of 0
06-02 21:07:16.026: E/AndroidRuntime(4329): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
06-02 21:07:16.026: E/AndroidRuntime(4329): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
06-02 21:07:16.026: E/AndroidRuntime(4329): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
06-02 21:07:16.026: E/AndroidRuntime(4329): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
06-02 21:07:16.026: E/AndroidRuntime(4329): at android.os.Handler.dispatchMessage(Handler.java:99)
06-02 21:07:16.026: E/AndroidRuntime(4329): at android.os.Looper.loop(Looper.java:123)
06-02 21:07:16.026: E/AndroidRuntime(4329): at android.app.ActivityThread.main(ActivityThread.java:4627)
06-02 21:07:16.026: E/AndroidRuntime(4329): at java.lang.reflect.Method.invokeNative(Native Method)
06-02 21:07:16.026: E/AndroidRuntime(4329): at java.lang.reflect.Method.invoke(Method.java:521)
06-02 21:07:16.026: E/AndroidRuntime(4329): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
06-02 21:07:16.026: E/AndroidRuntime(4329): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
06-02 21:07:16.026: E/AndroidRuntime(4329): at dalvik.system.NativeStart.main(Native Method)
06-02 21:07:16.026: E/AndroidRuntime(4329): Caused by: android.database.CursorIndexOutOfBoundsException: Index -1 requested, with a size of 0
06-02 21:07:16.026: E/AndroidRuntime(4329): at android.database.AbstractCursor.checkPosition(AbstractCursor.java:580)
06-02 21:07:16.026: E/AndroidRuntime(4329): at android.database.AbstractWindowedCursor.checkPosition(AbstractWindowedCursor.java:214)
06-02 21:07:16.026: E/AndroidRuntime(4329): at android.database.AbstractWindowedCursor.getString(AbstractWindowedCursor.java:41)
06-02 21:07:16.026: E/AndroidRuntime(4329): at com.Sagi.MyOrders.DisplayRecord.onCreate(DisplayRecord.java:48)
06-02 21:07:16.026: E/AndroidRuntime(4329): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
06-02 21:07:16.026: E/AndroidRuntime(4329): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
06-02 21:07:16.026: E/AndroidRuntime(4329): ... 11 more
06-02 21:12:16.126: I/Process(4329): Sending signal. PID: 4329 SIG: 9
The funny thing is i copied the same exact Lookup method i used in another place which works just fine !, i even tried giving it a constant to look for which i know to exists just to check. but nothing. error over and over again !
Thanks !!!
A Cursor initially points to a record one before the start, to allow this kind of code:
final Cursor cursor = /* get cursor */;
while(cursor.moveToNext()) {
/* do something with cursor */
}
If you are only expecting one record, and you are sure there will be one record, then before accesing your Cursor do:
cursor.moveToNext();
or:
cursor.moveToFirst();

Categories

Resources