android-opencv sample crash - tutorial2 Advanced - android

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

Related

Bad notification posted from package [Couldn't expand RemoteViews]

My app uses custom contentView and contentBigView. Essentially it supports expanding notifications. I have a bug that causes the app to crash and it is only happens on a few devices. I can not reproduce this issue myself however this issue is persistent on the listed devices below.
I can see this is only happening on Android 4.2.x. Anyone have any ideas of a potential bug on Android?
Devices
THL T100S [Android 4.2.2]
Lenovo P780 (P780_ROW) [Android 4.2.1]
Lenovo S820 (S820_ROW) [Android 4.2]
Lenovo A766 [Android 4.2]
Logcat
02-24 09:45:39.752 E/AndroidRuntime( 4281): FATAL EXCEPTION: main
02-24 09:45:39.752 E/AndroidRuntime( 4281): android.app.RemoteServiceException: Bad notification posted from package com.android.DroidLiveLite: Couldn't expand RemoteViews for: StatusBarNotification(pkg=com.android.DroidLiveLite id=2131165283 tag=null score=0 notn=Notification(pri=0 contentView=com.android.DroidLiveLite/0x7f03004d vibrate=null sound=null defaults=0x0 flags=0x62 kind=[null]) user=UserHandle{0})
02-24 09:45:39.752 E/AndroidRuntime( 4281): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1545)
02-24 09:45:39.752 E/AndroidRuntime( 4281): at android.os.Handler.dispatchMessage(Handler.java:107)
02-24 09:45:39.752 E/AndroidRuntime( 4281): at android.os.Looper.loop(Looper.java:194)
02-24 09:45:39.752 E/AndroidRuntime( 4281): at android.app.ActivityThread.main(ActivityThread.java:5405)
02-24 09:45:39.752 E/AndroidRuntime( 4281): at java.lang.reflect.Method.invokeNative(Native Method)
02-24 09:45:39.752 E/AndroidRuntime( 4281): at java.lang.reflect.Method.invoke(Method.java:525)
02-24 09:45:39.752 E/AndroidRuntime( 4281): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:838)
02-24 09:45:39.752 E/AndroidRuntime( 4281): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:605)
02-24 09:45:39.752 E/AndroidRuntime( 4281): at dalvik.system.NativeStart.main(Native Method)

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.

unfortunately application has stopped

I am getting error message on my AVD for my first android app named "My creativity".
Its showing:
Unfortunately My creativity has stopped
It has a simple text box and a button with background.
I am taking help of google.developers but getting above problem.
How to solve this?
Here's my LogCat:
02-24 10:18:48.624: I/Process(1068): Sending signal. PID: 1068 SIG: 9
02-24 10:18:51.654: W/Trace(1088): Unexpected value from nativeGetEnabledTags: 0
02-24 10:18:51.654: W/Trace(1088): Unexpected value from nativeGetEnabledTags: 0
02-24 10:18:52.194: D/dalvikvm(1088): GC_FOR_ALLOC freed 77K, 8% free 2513K/2708K, paused 52ms, total 56ms
02-24 10:18:52.534: I/dalvikvm-heap(1088): Grow heap (frag case) to 21.787MB for 20155408-byte allocation
02-24 10:18:52.674: D/dalvikvm(1088): GC_FOR_ALLOC freed 1K, 1% free 22194K/22392K, paused 137ms, total 137ms
02-24 10:18:52.784: D/dalvikvm(1088): GC_CONCURRENT freed <1K, 1% free 22194K/22392K, paused 9ms+21ms, total 109ms
02-24 10:18:55.204: D/dalvikvm(1088): GC_FOR_ALLOC freed <1K, 1% free 22194K/22392K, paused 41ms, total 41ms
02-24 10:18:55.204: I/dalvikvm-heap(1088): Forcing collection of SoftReferences for 45349648-byte allocation
02-24 10:18:55.284: D/dalvikvm(1088): GC_BEFORE_OOM freed 9K, 1% free 22184K/22392K, paused 72ms, total 73ms
02-24 10:18:55.284: E/dalvikvm-heap(1088): Out of memory on a 45349648-byte allocation.
02-24 10:18:55.284: I/dalvikvm(1088): "main" prio=5 tid=1 RUNNABLE
02-24 10:18:55.284: I/dalvikvm(1088): | group="main" sCount=0 dsCount=0 obj=0x40a719a0 self=0x2a00bba8
02-24 10:18:55.284: I/dalvikvm(1088): | sysTid=1088 nice=0 sched=0/0 cgrp=apps handle=1073849308
02-24 10:18:55.284: I/dalvikvm(1088): | state=R schedstat=( 3224239902 1154906764 146 ) utm=280 stm=42 core=0
02-24 10:18:55.284: I/dalvikvm(1088): at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
02-24 10:18:55.294: I/dalvikvm(1088): at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:502)
02-24 10:18:55.294: I/dalvikvm(1088): at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:355)
02-24 10:18:55.294: I/dalvikvm(1088): at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:785)
02-24 10:18:55.294: I/dalvikvm(1088): at android.content.res.Resources.loadDrawable(Resources.java:1965)
02-24 10:18:55.304: I/dalvikvm(1088): at android.content.res.TypedArray.getDrawable(TypedArray.java:601)
02-24 10:18:55.304: I/dalvikvm(1088): at android.view.View.<init>(View.java:3328)
02-24 10:18:55.304: I/dalvikvm(1088): at android.view.ViewGroup.<init>(ViewGroup.java:431)
02-24 10:18:55.304: I/dalvikvm(1088): at android.widget.LinearLayout.<init>(LinearLayout.java:176)
02-24 10:18:55.304: I/dalvikvm(1088): at android.widget.LinearLayout.<init>(LinearLayout.java:172)
02-24 10:18:55.316: I/dalvikvm(1088): at java.lang.reflect.Constructor.constructNative(Native Method)
02-24 10:18:55.316: I/dalvikvm(1088): at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
02-24 10:18:55.316: I/dalvikvm(1088): at android.view.LayoutInflater.createView(LayoutInflater.java:587)
02-24 10:18:55.316: I/dalvikvm(1088): at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
02-24 10:18:55.316: I/dalvikvm(1088): at android.view.LayoutInflater.onCreateView(LayoutInflater.java:660)
02-24 10:18:55.316: I/dalvikvm(1088): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:685)
02-24 10:18:55.316: I/dalvikvm(1088): at android.view.LayoutInflater.inflate(LayoutInflater.java:466)
02-24 10:18:55.324: I/dalvikvm(1088): at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
02-24 10:18:55.324: I/dalvikvm(1088): at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
02-24 10:18:55.324: I/dalvikvm(1088): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:270)
02-24 10:18:55.324: I/dalvikvm(1088): at android.app.Activity.setContentView(Activity.java:1881)
02-24 10:18:55.334: I/dalvikvm(1088): at com.example.iamgreat.GreatPiyu.onCreate(GreatPiyu.java:12)
02-24 10:18:55.334: I/dalvikvm(1088): at android.app.Activity.performCreate(Activity.java:5104)
02-24 10:18:55.334: I/dalvikvm(1088): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
02-24 10:18:55.344: I/dalvikvm(1088): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
02-24 10:18:55.344: I/dalvikvm(1088): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
02-24 10:18:55.344: I/dalvikvm(1088): at android.app.ActivityThread.access$600(ActivityThread.java:141)
02-24 10:18:55.344: I/dalvikvm(1088): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
02-24 10:18:55.354: I/dalvikvm(1088): at android.os.Handler.dispatchMessage(Handler.java:99)
02-24 10:18:55.354: I/dalvikvm(1088): at android.os.Looper.loop(Looper.java:137)
02-24 10:18:55.354: I/dalvikvm(1088): at android.app.ActivityThread.main(ActivityThread.java:5039)
02-24 10:18:55.354: I/dalvikvm(1088): at java.lang.reflect.Method.invokeNative(Native Method)
02-24 10:18:55.354: I/dalvikvm(1088): at java.lang.reflect.Method.invoke(Method.java:511)
02-24 10:18:55.354: I/dalvikvm(1088): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
02-24 10:18:55.354: I/dalvikvm(1088): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
02-24 10:18:55.354: I/dalvikvm(1088): at dalvik.system.NativeStart.main(Native Method)
02-24 10:18:55.364: D/skia(1088): --- allocation failed for scaled bitmap
02-24 10:18:55.404: D/AndroidRuntime(1088): Shutting down VM
02-24 10:18:55.404: W/dalvikvm(1088): threadid=1: thread exiting with uncaught exception (group=0x40a70930)
02-24 10:18:55.515: E/AndroidRuntime(1088): FATAL EXCEPTION: main
02-24 10:18:55.515: E/AndroidRuntime(1088): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.iamgreat/com.example.iamgreat.GreatPiyu}: android.view.InflateException: Binary XML file line #1: Error inflating class <unknown>
02-24 10:18:55.515: E/AndroidRuntime(1088): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2180)
02-24 10:18:55.515: E/AndroidRuntime(1088): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
02-24 10:18:55.515: E/AndroidRuntime(1088): at android.app.ActivityThread.access$600(ActivityThread.java:141)
02-24 10:18:55.515: E/AndroidRuntime(1088): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
02-24 10:18:55.515: E/AndroidRuntime(1088): at android.os.Handler.dispatchMessage(Handler.java:99)
02-24 10:18:55.515: E/AndroidRuntime(1088): at android.os.Looper.loop(Looper.java:137)
02-24 10:18:55.515: E/AndroidRuntime(1088): at android.app.ActivityThread.main(ActivityThread.java:5039)
02-24 10:18:55.515: E/AndroidRuntime(1088): at java.lang.reflect.Method.invokeNative(Native Method)
02-24 10:18:55.515: E/AndroidRuntime(1088): at java.lang.reflect.Method.invoke(Method.java:511)
02-24 10:18:55.515: E/AndroidRuntime(1088): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
02-24 10:18:55.515: E/AndroidRuntime(1088): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
02-24 10:18:55.515: E/AndroidRuntime(1088): at dalvik.system.NativeStart.main(Native Method)
02-24 10:18:55.515: E/AndroidRuntime(1088): Caused by: android.view.InflateException: Binary XML file line #1: Error inflating class <unknown>
02-24 10:18:55.515: E/AndroidRuntime(1088): at android.view.LayoutInflater.createView(LayoutInflater.java:613)
02-24 10:18:55.515: E/AndroidRuntime(1088): at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
02-24 10:18:55.515: E/AndroidRuntime(1088): at android.view.LayoutInflater.onCreateView(LayoutInflater.java:660)
02-24 10:18:55.515: E/AndroidRuntime(1088): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:685)
02-24 10:18:55.515: E/AndroidRuntime(1088): at android.view.LayoutInflater.inflate(LayoutInflater.java:466)
02-24 10:18:55.515: E/AndroidRuntime(1088): at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
02-24 10:18:55.515: E/AndroidRuntime(1088): at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
02-24 10:18:55.515: E/AndroidRuntime(1088): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:270)
02-24 10:18:55.515: E/AndroidRuntime(1088): at android.app.Activity.setContentView(Activity.java:1881)
02-24 10:18:55.515: E/AndroidRuntime(1088): at com.example.iamgreat.GreatPiyu.onCreate(GreatPiyu.java:12)
02-24 10:18:55.515: E/AndroidRuntime(1088): at android.app.Activity.performCreate(Activity.java:5104)
02-24 10:18:55.515: E/AndroidRuntime(1088): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
02-24 10:18:55.515: E/AndroidRuntime(1088): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
02-24 10:18:55.515: E/AndroidRuntime(1088): ... 11 more
02-24 10:18:55.515: E/AndroidRuntime(1088): Caused by: java.lang.reflect.InvocationTargetException
02-24 10:18:55.515: E/AndroidRuntime(1088): at java.lang.reflect.Constructor.constructNative(Native Method)
02-24 10:18:55.515: E/AndroidRuntime(1088): at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
02-24 10:18:55.515: E/AndroidRuntime(1088): at android.view.LayoutInflater.createView(LayoutInflater.java:587)
02-24 10:18:55.515: E/AndroidRuntime(1088): ... 23 more
02-24 10:18:55.515: E/AndroidRuntime(1088): Caused by: java.lang.OutOfMemoryError
02-24 10:18:55.515: E/AndroidRuntime(1088): at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
02-24 10:18:55.515: E/AndroidRuntime(1088): at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:502)
02-24 10:18:55.515: E/AndroidRuntime(1088): at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:355)
02-24 10:18:55.515: E/AndroidRuntime(1088): at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:785)
02-24 10:18:55.515: E/AndroidRuntime(1088): at android.content.res.Resources.loadDrawable(Resources.java:1965)
02-24 10:18:55.515: E/AndroidRuntime(1088): at android.content.res.TypedArray.getDrawable(TypedArray.java:601)
02-24 10:18:55.515: E/AndroidRuntime(1088): at android.view.View.<init>(View.java:3328)
02-24 10:18:55.515: E/AndroidRuntime(1088): at android.view.ViewGroup.<init>(ViewGroup.java:431)
02-24 10:18:55.515: E/AndroidRuntime(1088): at android.widget.LinearLayout.<init>(LinearLayout.java:176)
02-24 10:18:55.515: E/AndroidRuntime(1088): at android.widget.LinearLayout.<init>(LinearLayout.java:172)
02-24 10:18:55.515: E/AndroidRuntime(1088): ... 26 more
Out of memory on a 45349648-byte allocation
I think you are using lots of images and its not able to inflate it all at once.
Have a look at:
http://developer.android.com/training/displaying-bitmaps/load-bitmap.html

trouble compiling ffmpeg library and converter class

I am using this project as a reference : The code is avaiable at http://roman10.net/src/affmpeg.zip.
I am trying to compile this project with ffmpeg with different configuration than the project suggests.
I've compiled a new libffmpeg.so and added it to the project.
However, now i'm getting an "UnsatisfiedLinkError"
02-24 11:05:45.644: D/dalvikvm(11363): Trying to load lib /data/data/roman10.media.ffmpeg/lib/libffmpeg.so 0x47b0ec70
02-24 11:05:45.680: D/dalvikvm(11363): Added shared lib /data/data/roman10.media.ffmpeg/lib/libffmpeg.so 0x47b0ec70
02-24 11:05:45.680: D/dalvikvm(11363): No JNI_OnLoad found in /data/data/roman10.media.ffmpeg/lib/libffmpeg.so 0x47b0ec70, skipping init
02-24 11:05:45.684: D/dalvikvm(11363): Trying to load lib /data/data/roman10.media.ffmpeg/lib/libconverter.so 0x47b0ec70
02-24 11:05:45.687: I/dalvikvm(11363): Unable to dlopen(/data/data/roman10.media.ffmpeg/lib/libconverter.so): Cannot load library: link_image[1995]: failed to link libconverter.so
02-24 11:05:45.687: W/dalvikvm(11363): Exception Ljava/lang/UnsatisfiedLinkError; thrown during Lroman10/media/ffmpeg/ffmpegService;.<clinit>
02-24 11:05:45.687: W/dalvikvm(11363): Class init failed in newInstance call (Lroman10/media/ffmpeg/ffmpegService;)
02-24 11:05:45.687: D/AndroidRuntime(11363): Shutting down VM
02-24 11:05:45.687: W/dalvikvm(11363): threadid=1: thread exiting with uncaught exception (group=0x4001d7d0)
02-24 11:05:45.695: E/AndroidRuntime(11363): FATAL EXCEPTION: main
02-24 11:05:45.695: E/AndroidRuntime(11363): java.lang.ExceptionInInitializerError
02-24 11:05:45.695: E/AndroidRuntime(11363): at java.lang.Class.newInstanceImpl(Native Method)
02-24 11:05:45.695: E/AndroidRuntime(11363): at java.lang.Class.newInstance(Class.java:1429)
02-24 11:05:45.695: E/AndroidRuntime(11363): at android.app.ActivityThread.handleCreateService(ActivityThread.java:2940)
02-24 11:05:45.695: E/AndroidRuntime(11363): at android.app.ActivityThread.access$3300(ActivityThread.java:125)
02-24 11:05:45.695: E/AndroidRuntime(11363): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2087)
02-24 11:05:45.695: E/AndroidRuntime(11363): at android.os.Handler.dispatchMessage(Handler.java:99)
02-24 11:05:45.695: E/AndroidRuntime(11363): at android.os.Looper.loop(Looper.java:123)
02-24 11:05:45.695: E/AndroidRuntime(11363): at android.app.ActivityThread.main(ActivityThread.java:4627)
02-24 11:05:45.695: E/AndroidRuntime(11363): at java.lang.reflect.Method.invokeNative(Native Method)
02-24 11:05:45.695: E/AndroidRuntime(11363): at java.lang.reflect.Method.invoke(Method.java:521)
02-24 11:05:45.695: E/AndroidRuntime(11363): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:871)
02-24 11:05:45.695: E/AndroidRuntime(11363): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:629)
02-24 11:05:45.695: E/AndroidRuntime(11363): at dalvik.system.NativeStart.main(Native Method)
02-24 11:05:45.695: E/AndroidRuntime(11363): Caused by: java.lang.UnsatisfiedLinkError: Library converter not found
02-24 11:05:45.695: E/AndroidRuntime(11363): at java.lang.Runtime.loadLibrary(Runtime.java:461)
02-24 11:05:45.695: E/AndroidRuntime(11363): at java.lang.System.loadLibrary(System.java:557)
02-24 11:05:45.695: E/AndroidRuntime(11363): at roman10.media.ffmpeg.ffmpegService.<clinit>(ffmpegService.java:123)
I decided to recompile the converter.so file
however, when running the ndk-build command on it, i receive these messages:
c:\Users\user\workspace\Main\jni>c:\work\android-ndk-r8d\ndk-build
c:/android-ndk-r8d/build/core/build-binary.mk:266: warning: overriding comm
ands for target `c:/Users/user/workspace/Main//obj/local/armeabi/objs/converter'
c:/android-ndk-r8d/build/core/build-binary.mk:266: warning: ignoring old co
mmands for target `c:/Users/user/workspace/Main//obj/local/armeabi/objs/converte
r'
c:/android-ndk-r8d/build/core/build-binary.mk:266: warning: overriding comm
ands for target `c:/Users/user/workspace/Main//obj/local/armeabi/objs/converter'
c:/android-ndk-r8d/build/core/build-binary.mk:266: warning: ignoring old co
mmands for target `c:/Users/user/workspace/Main//obj/local/armeabi/objs/converte
r'
c:/android-ndk-r8d/build/core/build-binary.mk:357: warning: overriding comm
ands for target `c:/Users/user/workspace/Main//obj/local/armeabi'
c:/android-ndk-r8d/build/core/build-binary.mk:357: warning: ignoring old co
mmands for target `c:/Users/user/workspace/Main//obj/local/armeabi'
c:/android-ndk-r8d/build/core/build-binary.mk:439: warning: overriding comm
ands for target `c:/Users/user/workspace/Main//libs/armeabi'
c:/android-ndk-r8d/build/core/build-binary.mk:439: warning: ignoring old co
mmands for target `c:/Users/user/workspace/Main//libs/armeabi'
c:/android-ndk-r8d/build/core/build-binary.mk:357: warning: overriding comm
ands for target `c:/Users/user/workspace/Main//obj/local/armeabi'
c:/android-ndk-r8d/build/core/build-binary.mk:357: warning: ignoring old co
mmands for target `c:/Users/user/workspace/Main//obj/local/armeabi'
"Compile thumb : converter <= cmdutils.c
c:/Users/user/workspace/Main//jni/cmdutils.c:32:34: fatal error: libavformat/avf
ormat.h: No such file or directory
compilation terminated.
make: *** [c:/Users/user/workspace/Main//obj/local/armeabi/objs/converter/cmduti
ls.o] Error 1
What can I do to fix this, and make it work?
According to the error you are missing the libavformat headers.
I found this:
FFMpeg on Android, undefined references to libavcodec functions, although it is listed on command line

Categories

Resources