cant delete element in sqlite android - android

Hello i've been googling a lot today with no luck. The thing is that i'm trying to delete an element from my database but i only get 02-24 14:04:32.635: ERROR/AndroidRuntime(8823): android.database.sqlite.SQLiteException: bind or column index out of range: handle 0x327de0
The table in the database has only one column which is an INTEGER PRIMARY KEY and has a TRIGGER like this
CREATE TRIGGER "FavForeignKey" BEFORE INSERT ON Favorites WHEN (SELECT rowid FROM Sign Where Sign.rowid = NEW.ViewedImage) IS NULL BEGIN SELECT RAISE(ROLLBACK, 'insert on table "Favorites" violates foreign key constraint "Sign.rowid"'); END
i don't know why i'm getting this error, i need some help.
**Here is the query i'm using:**
public void deleteFavorite(int imageId){
m_db.delete(FAVORITE_TABLE, FAVORITES_COLUMN_VIEWED_IMAGE, new String[]{""+imageId});
}
And here's the error stack:
02-24 14:04:32.635: ERROR/AndroidRuntime(8823): android.database.sqlite.SQLiteException: bind or column index out of range: handle 0x327de0
02-24 14:04:32.635: ERROR/AndroidRuntime(8823): at android.database.sqlite.SQLiteProgram.native_bind_string(Native Method)
02-24 14:04:32.635: ERROR/AndroidRuntime(8823): at android.database.sqlite.SQLiteProgram.bindString(SQLiteProgram.java:241)
02-24 14:04:32.635: ERROR/AndroidRuntime(8823): at android.database.DatabaseUtils.bindObjectToProgram(DatabaseUtils.java:191)
02-24 14:04:32.635: ERROR/AndroidRuntime(8823): at android.database.sqlite.SQLiteDatabase.delete(SQLiteDatabase.java:1669)
02-24 14:04:32.635: ERROR/AndroidRuntime(8823): at com.enea.takk.database.DBManager.deleteFavorite(DBManager.java:161)
02-24 14:04:32.635: ERROR/AndroidRuntime(8823): at com.enea.takk.views.ShowImage$1.onClick(ShowImage.java:82)
02-24 14:04:32.635: ERROR/AndroidRuntime(8823): at com.android.internal.app.AlertController$ButtonHandler.handleMessage(AlertController.java:158)
02-24 14:04:32.635: ERROR/AndroidRuntime(8823): at android.os.Handler.dispatchMessage(Handler.java:99)
02-24 14:04:32.635: ERROR/AndroidRuntime(8823): at android.os.Looper.loop(Looper.java:144)
02-24 14:04:32.635: ERROR/AndroidRuntime(8823): at android.app.ActivityThread.main(ActivityThread.java:4937)
02-24 14:04:32.635: ERROR/AndroidRuntime(8823): at java.lang.reflect.Method.invokeNative(Native Method)
02-24 14:04:32.635: ERROR/AndroidRuntime(8823): at java.lang.reflect.Method.invoke(Method.java:521)
02-24 14:04:32.635: ERROR/AndroidRuntime(8823): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
02-24 14:04:32.635: ERROR/AndroidRuntime(8823): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
02-24 14:04:32.635: ERROR/AndroidRuntime(8823): at dalvik.system.NativeStart.main(Native Method)
Some help will be appreciated.
Thanks in advance

try this
public void deleteFavorite(int imageId){
m_db.delete(FAVORITE_TABLE, FAVORITES_COLUMN_VIEWED_IMAGE + "=" +imageId,null);
}

Related

Service runs in Emulator but gives sqliteError in Android Device

I am trying to create a service in which i want to upload image to server in background but when try to execute it in the emulator ti runs perfectly but when i try to run the same in device it gives sqlite lite error. The code is return in the phonegap but the service code is return in native.
here is the logacat Error:
02-24 13:04:21.988: I/System.out(1160): call after 2 minutes
02-24 13:04:21.992: I/System.out(1160): Your connection succeed
02-24 13:04:21.992: I/System.out(1160): Check Database Exist or not?
02-24 13:04:21.992: I/(1160): database exists
02-24 13:04:21.996: I/System.out(1160): my path in db helper data/data/com.sacpl.nesso`/app_database/file__0/0000000000000001.db
02-24 13:04:21.996: I/System.out(1160): path of the database: /data/data/com.sacpl.nesso/databases/0000000000000001.db
02-24 13:04:21.996: I/System.out(1160): Database already Exist
02-24 13:04:21.996: I/(1160): --------------------Call get master `Entry----------------------
02-24 13:04:22.000: I/Database(1160): sqlite returned: error code = 1, msg = no such table: android_metadata
02-24 13:04:22.000: E/Database(1160): SELECT locale FROM android_metadata failed
02-24 13:04:22.007: E/Database(1160): Failed to setLocale() when constructing, closing the database
02-24 13:04:22.007: E/Database(1160): android.database.sqlite.SQLiteException: no such table: android_metadata
02-24 13:04:22.007: E/Database(1160): at android.database.sqlite.SQLiteDatabase.native_setLocale(Native Method)
02-24 13:04:22.007: E/Database(1160): at android.database.sqlite.SQLiteDatabase.setLocale(SQLiteDatabase.java:1987)
02-24 13:04:22.007: E/Database(1160): at android.database.sqlite.SQLiteDatabase.<init>(SQLiteDatabase.java:1855)
02-24 13:04:22.007: E/Database(1160): at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:820)
02-24 13:04:22.007: E/Database(1160): at com.sacpl.nesso.MyService.getNewMasterEntry(MyService.java:441)
02-24 13:04:22.007: E/Database(1160): at com.sacpl.nesso.MyService.onStartCommand(MyService.java:111)
02-24 13:04:22.007: E/Database(1160): at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2043)
02-24 13:04:22.007: E/Database(1160): at android.app.ActivityThread.access$2800(ActivityThread.java:117)
02-24 13:04:22.007: E/Database(1160): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:998)
02-24 13:04:22.007: E/Database(1160): at android.os.Handler.dispatchMessage(Handler.java:99)
02-24 13:04:22.007: E/Database(1160): at android.os.Looper.loop(Looper.java:123)
02-24 13:04:22.007: E/Database(1160): at android.app.ActivityThread.main(ActivityThread.java:3687)
02-24 13:04:22.007: E/Database(1160): at java.lang.reflect.Method.invokeNative(Native Method)
02-24 13:04:22.007: E/Database(1160): at java.lang.reflect.Method.invoke(Method.java:507)
02-24 13:04:22.007: E/Database(1160): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:842)
02-24 13:04:22.007: E/Database(1160): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
02-24 13:04:22.007: E/Database(1160): at dalvik.system.NativeStart.main(Native Method)
02-24 13:04:22.007: W/System.err(1160): android.database.sqlite.SQLiteException: no such table: android_metadata
02-24 13:04:22.007: W/System.err(1160): at android.database.sqlite.SQLiteDatabase.native_setLocale(Native Method)
02-24 13:04:22.007: W/System.err(1160): at android.database.sqlite.SQLiteDatabase.setLocale(SQLiteDatabase.java:1987)
02-24 13:04:22.007: W/System.err(1160): at android.database.sqlite.SQLiteDatabase.<init>(SQLiteDatabase.java:1855)
02-24 13:04:22.007: W/System.err(1160): at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:820)
02-24 13:04:22.007: W/System.err(1160): at com.sacpl.nesso.MyService.getNewMasterEntry(MyService.java:441)
02-24 13:04:22.007: W/System.err(1160): at com.sacpl.nesso.MyService.onStartCommand(MyService.java:111)
02-24 13:04:22.007: W/System.err(1160): at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2043)
02-24 13:04:22.007: W/System.err(1160): at android.app.ActivityThread.access$2800(ActivityThread.java:117)
02-24 13:04:22.007: W/System.err(1160): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:998)
02-24 13:04:22.007: W/System.err(1160): at android.os.Handler.dispatchMessage(Handler.java:99)
02-24 13:04:22.007: W/System.err(1160): at android.os.Looper.loop(Looper.java:123)
02-24 13:04:22.007: W/System.err(1160): at android.app.ActivityThread.main(ActivityThread.java:3687)
02-24 13:04:22.007: W/System.err(1160): at java.lang.reflect.Method.invokeNative(Native Method)
02-24 13:04:22.007: W/System.err(1160): at java.lang.reflect.Method.invoke(Method.java:507)
02-24 13:04:22.007: W/System.err(1160): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:842)
02-24 13:04:22.015: W/System.err(1160): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
02-24 13:04:22.015: W/System.err(1160): at dalvik.system.NativeStart.main(Native Method)
Any Idea is appreciated
thanks in advance

Opencv on android and video record

I'm trying to process camera image on opencv(2.4.8) and record video together on android.
In the middle of just camera preview, video record is done successfully, however, after starting
image process on opencv, there is EXCEPTION like below. It is not functional videowriter API in opnecv on android, so I used MediaRecorder that is android API to record video.
Is there any way I can solve the problems were occurred by when trying to process image and video record at the same time?
Thanks!
02-24 16:38:50.071: E/AndroidRuntime(8117): FATAL EXCEPTION: main
02-24 16:38:50.071: E/AndroidRuntime(8117): java.lang.RuntimeException: Method called after release()
02-24 16:38:50.071: E/AndroidRuntime(8117): at android.hardware.Camera.setHasPreviewCallback(Native Method)
02-24 16:38:50.071: E/AndroidRuntime(8117): at android.hardware.Camera.access$600(Camera.java:133)
02-24 16:38:50.071: E/AndroidRuntime(8117): at android.hardware.Camera$EventHandler.handleMessage(Camera.java:815)
02-24 16:38:50.071: E/AndroidRuntime(8117): at android.os.Handler.dispatchMessage(Handler.java:99)
02-24 16:38:50.071: E/AndroidRuntime(8117): at android.os.Looper.loop(Looper.java:137)
02-24 16:38:50.071: E/AndroidRuntime(8117): at android.app.ActivityThread.main(ActivityThread.java:4961)
02-24 16:38:50.071: E/AndroidRuntime(8117): at java.lang.reflect.Method.invokeNative(Native Method)
02-24 16:38:50.071: E/AndroidRuntime(8117): at java.lang.reflect.Method.invoke(Method.java:511)
02-24 16:38:50.071: E/AndroidRuntime(8117): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1004)
02-24 16:38:50.071: E/AndroidRuntime(8117): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:771)
02-24 16:38:50.071: E/AndroidRuntime(8117): at dalvik.system.NativeStart.main(Native Method)

OutOFMemory error in volley library

This is what I am doing, Firstly into the constructor of Customadapter, I have initilize image cache and image loader
imageCache = new BitmapLruCache();
mImageLoader = new ImageLoader(newRequestQueue(context), imageCache);
then into the getView() method I have done...
String url = imgs[position];
image.setImageUrl(url, mImageLoader);
image.setDefaultImageResId(R.drawable.no_image);
image.setErrorImageResId(R.drawable.error_image);
Where imgs is the array for bitmaps url and image is the object of NetworkImageView. When I execute it, I got error of OutOfMemory. This is my logcat o/p :-
02-24 12:08:08.845: E/dalvikvm-heap(6288): Out of memory on a 144636048-byte allocation.
02-24 12:08:08.845: I/dalvikvm(6288): "main" prio=5 tid=1 RUNNABLE
02-24 12:08:08.845: I/dalvikvm(6288): | group="main" sCount=0 dsCount=0 obj=0x41767b50 self=0x417571d0
02-24 12:08:08.845: I/dalvikvm(6288): | sysTid=6288 nice=0 sched=0/0 cgrp=apps handle=1075191004
02-24 12:08:08.845: I/dalvikvm(6288): | state=R schedstat=( 0 0 0 ) utm=116 stm=35 core=1
02-24 12:08:08.845: I/dalvikvm(6288): at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
02-24 12:08:08.855: I/dalvikvm(6288): at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:502)
02-24 12:08:08.855: I/dalvikvm(6288): at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:355)
02-24 12:08:08.855: I/dalvikvm(6288): at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:815)
02-24 12:08:08.855: I/dalvikvm(6288): at android.content.res.Resources.loadDrawable(Resources.java:1992)
02-24 12:08:08.855: I/dalvikvm(6288): at android.content.res.Resources.getDrawable(Resources.java:666)
02-24 12:08:08.855: I/dalvikvm(6288): at android.widget.ImageView.resolveUri(ImageView.java:616)
02-24 12:08:08.855: I/dalvikvm(6288): at android.widget.ImageView.setImageResource(ImageView.java:349)
02-24 12:08:08.855: I/dalvikvm(6288): at com.android.volley.toolbox.NetworkImageView$1.onResponse(NetworkImageView.java:177)
02-24 12:08:08.855: I/dalvikvm(6288): at com.android.volley.toolbox.NetworkImageView$1$1.run(NetworkImageView.java:168)
02-24 12:08:08.855: I/dalvikvm(6288): at android.os.Handler.handleCallback(Handler.java:725)
02-24 12:08:08.855: I/dalvikvm(6288): at android.os.Handler.dispatchMessage(Handler.java:92)
02-24 12:08:08.855: I/dalvikvm(6288): at android.os.Looper.loop(Looper.java:137)
02-24 12:08:08.855: I/dalvikvm(6288): at android.app.ActivityThread.main(ActivityThread.java:5099)
02-24 12:08:08.855: I/dalvikvm(6288): at java.lang.reflect.Method.invokeNative(Native Method)
02-24 12:08:08.865: I/dalvikvm(6288): at java.lang.reflect.Method.invoke(Method.java:511)
02-24 12:08:08.865: I/dalvikvm(6288): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:803)
02-24 12:08:08.865: I/dalvikvm(6288): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:570)
02-24 12:08:08.865: I/dalvikvm(6288): at dalvik.system.NativeStart.main(Native Method)
02-24 12:08:08.865: D/skia(6288): --- decoder->decode returned false
02-24 12:08:08.865: D/AndroidRuntime(6288): Shutting down VM
02-24 12:08:08.865: W/dalvikvm(6288): threadid=1: thread exiting with uncaught exception (group=0x41766ae0)
02-24 12:08:08.875: E/AndroidRuntime(6288): FATAL EXCEPTION: main
02-24 12:08:08.875: E/AndroidRuntime(6288): java.lang.OutOfMemoryError
02-24 12:08:08.875: E/AndroidRuntime(6288): at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
02-24 12:08:08.875: E/AndroidRuntime(6288): at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:502)
02-24 12:08:08.875: E/AndroidRuntime(6288): at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:355)
02-24 12:08:08.875: E/AndroidRuntime(6288): at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:815)
02-24 12:08:08.875: E/AndroidRuntime(6288): at android.content.res.Resources.loadDrawable(Resources.java:1992)
02-24 12:08:08.875: E/AndroidRuntime(6288): at android.content.res.Resources.getDrawable(Resources.java:666)
02-24 12:08:08.875: E/AndroidRuntime(6288): at android.widget.ImageView.resolveUri(ImageView.java:616)
02-24 12:08:08.875: E/AndroidRuntime(6288): at android.widget.ImageView.setImageResource(ImageView.java:349)
02-24 12:08:08.875: E/AndroidRuntime(6288): at com.android.volley.toolbox.NetworkImageView$1.onResponse(NetworkImageView.java:177)
02-24 12:08:08.875: E/AndroidRuntime(6288): at com.android.volley.toolbox.NetworkImageView$1$1.run(NetworkImageView.java:168)
02-24 12:08:08.875: E/AndroidRuntime(6288): at android.os.Handler.handleCallback(Handler.java:725)
02-24 12:08:08.875: E/AndroidRuntime(6288): at android.os.Handler.dispatchMessage(Handler.java:92)
02-24 12:08:08.875: E/AndroidRuntime(6288): at android.os.Looper.loop(Looper.java:137)
02-24 12:08:08.875: E/AndroidRuntime(6288): at android.app.ActivityThread.main(ActivityThread.java:5099)
02-24 12:08:08.875: E/AndroidRuntime(6288): at java.lang.reflect.Method.invokeNative(Native Method)
02-24 12:08:08.875: E/AndroidRuntime(6288): at java.lang.reflect.Method.invoke(Method.java:511)
02-24 12:08:08.875: E/AndroidRuntime(6288): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:803)
02-24 12:08:08.875: E/AndroidRuntime(6288): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:570)
02-24 12:08:08.875: E/AndroidRuntime(6288): at dalvik.system.NativeStart.main(Native Method)
I cant find any solution that will work for me, So What should I do...
Thanks to Mr. Itai Hanski,
After your suggestion about OOM that OOM doesn't have to do with the network components, I had looked out on any other cause, Finally I found solution :
It was from layout file of listview item, I had set the android:src="" into the Imageview.
When I remove this xml attribute from ImageView, The OOM problem resolve out.
But one thing I still not found that when I set a image for error or loading condition the error again comes out, still I cant uderstand what the real cause of it.
Bitmaps are a real issue in android.
First off - I really recommend you read this post on the developer site.
How is your BitmapLruCache implemented? Here are a few pointers (you can use only some of them):
Limit the number of bitmaps the cache can hold.
Limit the size of the cache itself. The Android guys provide a nice algorithm to decide how large to make it in the linked article.
When possible, call bitmap.recycle().
Use weak / soft references to the Bitmaps in your cache instead of strong one.
Check out this SO answer to a similar question (shameless self plug, but relevant).
You probably don't need to implement all of these at the same time. Choose the ones that work for you.

Selecting an item in ListFragment list programmatically

I've made my Android app tablet optimized and I followed the tutorial here:
Everything is great, but I am trying to select an item (say, the 1st item) with a button in the ActionBar.
I tried this answer to use performItemClick but on I've got error reports of java.lang.IllegalStateException
in android.support.v4.app.ListFragment.ensureList, java.lang.IllegalStateException: Content view not yet created, and java.lang.NullPointerException
in android.content.ComponentName.<init>
I've tried checking if the ListView is null and still get the error reports on the Play Store. How do I properly select an item in my list programmatically?
Update to add logcat and the code is virtually identical to the tutorials in the links:
Logcat A:
java.lang.IllegalStateException: Content view not yet created
at android.support.v4.app.ListFragment.ensureList(ListFragment.java:328)
at android.support.v4.app.ListFragment.getListView(ListFragment.java:222)
at com.ccwilcox.meteorshower.MeteorList.showMeteorDetails(MeteorList.java:69)
at com.ccwilcox.meteorshower.MeteorList.onListItemClick(MeteorList.java:62)
at android.support.v4.app.ListFragment$2.onItemClick(ListFragment.java:58)
at android.widget.AdapterView.performItemClick(AdapterView.java:298)
at android.widget.AbsListView.performItemClick(AbsListView.java:1280)
at com.ccwilcox.meteorshower.MainActivity.viewUpcomingEvent(MainActivity.java:648)
at com.ccwilcox.meteorshower.MainActivity.onOptionsItemSelected(MainActivity.java:534)
at android.app.Activity.onMenuItemSelected(Activity.java:2606)
at android.support.v4.app.FragmentActivity.onMenuItemSelected(FragmentActivity.java:361)
at com.android.internal.policy.impl.PhoneWindow.onMenuItemSelected(PhoneWindow.java:1045)
at com.android.internal.view.menu.MenuBuilder.dispatchMenuItemSelected(MenuBuilder.java:735)
at com.android.internal.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:149)
at com.android.internal.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:874)
at com.android.internal.view.menu.ActionMenuView.invokeItem(ActionMenuView.java:592)
at com.android.internal.view.menu.ActionMenuItemView.onClick(ActionMenuItemView.java:149)
at android.view.View.performClick(View.java:4222)
at android.view.View$PerformClick.run(View.java:17273)
at android.os.Handler.handleCallback(Handler.java:615)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4895)
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:994)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:761)
at dalvik.system.NativeStart.main(Native Method)
Logcat B:
java.lang.NullPointerException
at android.content.ComponentName.<init>(ComponentName.java:75)
at android.content.Intent.<init>(Intent.java:2874)
at com.ccwilcox.meteorshower.MeteorList.showMeteorDetails(MeteorList.java:86)
at com.ccwilcox.meteorshower.MeteorList.onListItemClick(MeteorList.java:62)
at android.support.v4.app.ListFragment$2.onItemClick(ListFragment.java:58)
at android.widget.AdapterView.performItemClick(AdapterView.java:284)
at android.widget.ListView.performItemClick(ListView.java:3701)
at com.ccwilcox.meteorshower.MainActivity.viewUpcomingEvent(MainActivity.java:648)
at com.ccwilcox.meteorshower.MainActivity.onOptionsItemSelected(MainActivity.java:534)
at android.app.Activity.onMenuItemSelected(Activity.java:2205)
at android.support.v4.app.FragmentActivity.onMenuItemSelected(FragmentActivity.java:361)
at com.android.internal.policy.impl.PhoneWindow.onMenuItemSelected(PhoneWindow.java:779)
at com.android.internal.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:143)
at com.android.internal.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:861)
at com.android.internal.view.menu.IconMenuView.invokeItem(IconMenuView.java:532)
at com.android.internal.view.menu.IconMenuItemView.performClick(IconMenuItemView.java:122)
at android.view.View$PerformClick.run(View.java:9152)
at android.os.Handler.handleCallback(Handler.java:587)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:3687)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:842)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
at dalvik.system.NativeStart.main(Native Method)
Update 2
And here is the code that is causing the problem:
if (mListFragment.listView != null) {
mListFragment.listView.performItemClick(mListFragment.listView.getAdapter().getView(position, null, null), position, mListFragment.listView.getAdapter().getItemId(position));
}

android-opencv sample crash - tutorial2 Advanced

I have a problem running tutorial2 (Advanced - Mix java 9+ native
opencv) sample on HTC incredible S.
Other samples work great.
The app terminates immediately with this message: "The application
Tutorial 2 Advanced - 2. Mix Java + Native OpenCV( process
org.opencv.samples.tutorial4) has expired unexpectedly. Please try
again."
Any help or suggestion?
02-24 22:27:12.083: I/Process(2212): Sending signal. PID: 2212 SIG: 9
02-24 23:15:34.915: I/Sample::Activity(2296): Instantiated new class
org.opencv.samples.tutorial4.Sample4Mixed
02-24 23:15:34.935: I/Sample::Activity(2296): onCreate
02-24 23:15:34.935: W/dalvikvm(2296): Exception Ljava/lang/
UnsatisfiedLinkError; thrown while initializing Lorg/opencv/samples/
tutorial4/Sample4View;
02-24 23:15:34.935: D/AndroidRuntime(2296): Shutting down VM
02-24 23:15:34.935: W/dalvikvm(2296): threadid=1: thread exiting with
uncaught exception (group=0x4001d5a0)
02-24 23:15:34.945: E/AndroidRuntime(2296): FATAL EXCEPTION: main
02-24 23:15:34.945: E/AndroidRuntime(2296):
java.lang.ExceptionInInitializerError
02-24 23:15:34.945: E/AndroidRuntime(2296): at
org.opencv.samples.tutorial4.Sample4Mixed.onCreate(Sample4Mixed.java:
35)
02-24 23:15:34.945: E/AndroidRuntime(2296): at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:
1072)
02-24 23:15:34.945: E/AndroidRuntime(2296): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
1785)
02-24 23:15:34.945: E/AndroidRuntime(2296): at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
1842)
02-24 23:15:34.945: E/AndroidRuntime(2296): at
android.app.ActivityThread.access$1500(ActivityThread.java:132)
02-24 23:15:34.945: E/AndroidRuntime(2296): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1038)
02-24 23:15:34.945: E/AndroidRuntime(2296): at
android.os.Handler.dispatchMessage(Handler.java:99)
02-24 23:15:34.945: E/AndroidRuntime(2296): at
android.os.Looper.loop(Looper.java:150)
02-24 23:15:34.945: E/AndroidRuntime(2296): at
android.app.ActivityThread.main(ActivityThread.java:4263)
02-24 23:15:34.945: E/AndroidRuntime(2296): at
java.lang.reflect.Method.invokeNative(Native Method)
02-24 23:15:34.945: E/AndroidRuntime(2296): at
java.lang.reflect.Method.invoke(Method.java:507)
02-24 23:15:34.945: E/AndroidRuntime(2296): at
com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:839)
02-24 23:15:34.945: E/AndroidRuntime(2296): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
02-24 23:15:34.945: E/AndroidRuntime(2296): at
dalvik.system.NativeStart.main(Native Method)
02-24 23:15:34.945: E/AndroidRuntime(2296): Caused by:
java.lang.UnsatisfiedLinkError: Couldn't load mixed_sample:
findLibrary returned null
02-24 23:15:34.945: E/AndroidRuntime(2296): at
java.lang.Runtime.loadLibrary(Runtime.java:429)
02-24 23:15:34.945: E/AndroidRuntime(2296): at
java.lang.System.loadLibrary(System.java:554)
02-24 23:15:34.945: E/AndroidRuntime(2296): at
org.opencv.samples.tutorial4.Sample4View.<clinit>(Sample4View.java:91)
02-24 23:15:34.945: E/AndroidRuntime(2296): ... 14 more
02-24 23:20:35.008: I/Process(2296): Sending signal. PID: 2296 SIG: 9
seems like a linking error due to
02-24 23:15:34.935: W/dalvikvm(2296): Exception Ljava/lang/UnsatisfiedLinkError; thrown while initializing Lorg/opencv/samples/tutorial4/Sample4View;
check your project settings for the toolchain for the build settings.
this might bring you more information:
http://opencv.itseez.com/doc/tutorials/introduction/android_binary_package/android_binary_package_using_with_NDK.html

Categories

Resources