ScrollView: java.lang.StackOverflowError - android

I got a ScrollView with many Views and if i start the activity i got this after some scrolling:
04-10 20:11:42.480: E/AndroidRuntime(2089): FATAL EXCEPTION: main
04-10 20:11:42.480: E/AndroidRuntime(2089): java.lang.StackOverflowError
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.View.addFocusables(View.java:3654)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.addFocusables(ViewGroup.java:637)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.addFocusables(ViewGroup.java:637)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.addFocusables(ViewGroup.java:637)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.addFocusables(ViewGroup.java:637)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.addFocusables(ViewGroup.java:637)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.addFocusables(ViewGroup.java:637)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.addFocusables(ViewGroup.java:637)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.addFocusables(ViewGroup.java:637)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.addFocusables(ViewGroup.java:637)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.addFocusables(ViewGroup.java:637)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.addFocusables(ViewGroup.java:618)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.View.getFocusables(View.java:3612)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.FocusFinder.findNextFocus(FocusFinder.java:109)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.FocusFinder.findNextFocus(FocusFinder.java:93)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.focusSearch(ViewGroup.java:476)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.focusSearch(ViewGroup.java:478)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.focusSearch(ViewGroup.java:478)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.focusSearch(ViewGroup.java:478)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.focusSearch(ViewGroup.java:478)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.focusSearch(ViewGroup.java:478)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.focusSearch(ViewGroup.java:478)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.focusSearch(ViewGroup.java:478)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.focusSearch(ViewGroup.java:478)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.focusSearch(ViewGroup.java:478)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.focusSearch(ViewGroup.java:478)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.focusSearch(ViewGroup.java:478)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.View.focusSearch(View.java:3547)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.widget.TextView.onCreateInputConnection(TextView.java:4662)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.inputmethod.InputMethodManager.startInputInner(InputMethodManager.java:945)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.inputmethod.InputMethodManager.checkFocus(InputMethodManager.java:1129)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.inputmethod.InputMethodManager.isActive(InputMethodManager.java:542)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.widget.TextView.onDraw(TextView.java:4173)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.View.draw(View.java:6933)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.drawChild(ViewGroup.java:1646)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.View.draw(View.java:6936)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.widget.FrameLayout.draw(FrameLayout.java:357)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.drawChild(ViewGroup.java:1646)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.View.draw(View.java:6936)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.widget.FrameLayout.draw(FrameLayout.java:357)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.drawChild(ViewGroup.java:1646)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.drawChild(ViewGroup.java:1644)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.drawChild(ViewGroup.java:1644)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.drawChild(ViewGroup.java:1644)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.drawChild(ViewGroup.java:1644)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.View.draw(View.java:7039)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.widget.FrameLayout.draw(FrameLayout.java:357)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.widget.ScrollView.draw(ScrollView.java:1415)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.drawChild(ViewGroup.java:1646)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.View.draw(View.java:6936)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.widget.FrameLayout.draw(FrameLayout.java:357)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.drawChild(ViewGroup.java:1646)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.drawChild(ViewGroup.java:1644)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.drawChild(ViewGroup.java:1644)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.View.draw(View.java:6936)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.widget.FrameLayout.draw(FrameLayout.java:357)
04-10 20:11:42.480: E/AndroidRuntime(2089): at android.view.ViewGroup.drawChild(
Why m I getting this error any idea?

Your UI View tree is too deep. addFocusables is recursive (obviously) into the View layout tree and Android has a fairly limited stack size. Change your layout to do less nesting and more of a flat layout. You may need to write a custom layout to get the layout you want without nesting.

Related

My Launcher Based off androids launcher 3 ASOP doesn't open on samsung galaxy tab s

hey guys I'm working on a launcher that is based off Launcher 3 form AOSP it works perfectly on my nexus 7 tablet and all my android phones I just got the samsung galaxy tab s 8.4 and when I try to run it it crashes before it launchers heres what logcat says:
04-10 07:46:57.757: E/ActivityThread(23606): Failed to find provider info for com.android.launcher2.settings
04-10 07:46:57.897: E/AndroidRuntime(23606): FATAL EXCEPTION: main
04-10 07:46:57.897: E/AndroidRuntime(23606): Process: com.android.launcher3, PID: 23606
04-10 07:46:57.897: E/AndroidRuntime(23606): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.android.launcher3/com.android.launcher3.Launcher}: java.lang.RuntimeException: Binary XML file line #16: You must supply a layout_width attribute.
04-10 07:46:57.897: E/AndroidRuntime(23606): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2404)
04-10 07:46:57.897: E/AndroidRuntime(23606): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2464)
04-10 07:46:57.897: E/AndroidRuntime(23606): at android.app.ActivityThread.access$900(ActivityThread.java:172)
04-10 07:46:57.897: E/AndroidRuntime(23606): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1308)
04-10 07:46:57.897: E/AndroidRuntime(23606): at android.os.Handler.dispatchMessage(Handler.java:102)
04-10 07:46:57.897: E/AndroidRuntime(23606): at android.os.Looper.loop(Looper.java:146)
04-10 07:46:57.897: E/AndroidRuntime(23606): at android.app.ActivityThread.main(ActivityThread.java:5653)
04-10 07:46:57.897: E/AndroidRuntime(23606): at java.lang.reflect.Method.invokeNative(Native Method)
04-10 07:46:57.897: E/AndroidRuntime(23606): at java.lang.reflect.Method.invoke(Method.java:515)
04-10 07:46:57.897: E/AndroidRuntime(23606): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1291)
04-10 07:46:57.897: E/AndroidRuntime(23606): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1107)
04-10 07:46:57.897: E/AndroidRuntime(23606): at dalvik.system.NativeStart.main(Native Method)
04-10 07:46:57.897: E/AndroidRuntime(23606): Caused by: java.lang.RuntimeException: Binary XML file line #16: You must supply a layout_width attribute.
04-10 07:46:57.897: E/AndroidRuntime(23606): at android.content.res.TypedArray.getLayoutDimension(TypedArray.java:492)
04-10 07:46:57.897: E/AndroidRuntime(23606): at android.view.ViewGroup$LayoutParams.setBaseAttributes(ViewGroup.java:6203)
04-10 07:46:57.897: E/AndroidRuntime(23606): at android.view.ViewGroup$MarginLayoutParams.<init>(ViewGroup.java:6372)
04-10 07:46:57.897: E/AndroidRuntime(23606): at android.widget.FrameLayout$LayoutParams.<init>(FrameLayout.java:615)
04-10 07:46:57.897: E/AndroidRuntime(23606): at android.widget.FrameLayout.generateLayoutParams(FrameLayout.java:559)
04-10 07:46:57.897: E/AndroidRuntime(23606): at android.widget.FrameLayout.generateLayoutParams(FrameLayout.java:56)
04-10 07:46:57.897: E/AndroidRuntime(23606): at android.view.LayoutInflater.inflate(LayoutInflater.java:486)
04-10 07:46:57.897: E/AndroidRuntime(23606): at android.view.LayoutInflater.inflate(LayoutInflater.java:398)
04-10 07:46:57.897: E/AndroidRuntime(23606): at com.android.launcher3.Launcher.getQsbBar(Launcher.java:3427)
04-10 07:46:57.897: E/AndroidRuntime(23606): at com.android.launcher3.SearchDropTargetBar.setup(SearchDropTargetBar.java:72)
04-10 07:46:57.897: E/AndroidRuntime(23606): at com.android.launcher3.Launcher.setupViews(Launcher.java:1325)
04-10 07:46:57.897: E/AndroidRuntime(23606): at com.android.launcher3.Launcher.onCreate(Launcher.java:437)
04-10 07:46:57.897: E/AndroidRuntime(23606): at android.app.Activity.performCreate(Activity.java:5539)
04-10 07:46:57.897: E/AndroidRuntime(23606): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1093)
04-10 07:46:57.897: E/AndroidRuntime(23606): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2368)
04-10 07:46:57.897: E/AndroidRuntime(23606): ... 11 more
I know it says the error is at line 16 in the xml but what xml file theres 30 xml files so if you have any ideas please let me know
The device is a Samsung Galaxy Tab S running 4.4.2
any help would be awesome
Thanks in advance
I figured it out! the xml in question is located in: res/layout-sw720p/search_bar.xml
on line 16 you need to add the following code:
android:layout_width="match_parent"
android:layout_height="match_parent"
This fixed the crashing issue I hope this helps anyone else who is having this issue!

TextView Center Gravity Crash

Hi I set a background to a textview as
mImageAppInstallStatus.setBackgroundResource(R.drawable.downloaded);
Then i set the gravity of textview as center as below
<TextView
android:id="#+id/textview_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="12dp"
android:textColor="#ffffff"
android:gravity="center"
android:layout_alignParentLeft="true"/>
But in devices < API 11 i get a stackoverflowerror as below ..I GET THE CRASH ONLY IF I MAKE gravity center if i make gravity left it works
java.lang.StackOverflowError
04-10 13:09:33.747: E/(6732): at android.text.Layout.measureText(Layout.java:1655)
04-10 13:09:33.747: E/(6732): at android.text.Layout.getLineMax(Layout.java:689)
04-10 13:09:33.747: E/(6732): at android.text.Layout.draw(Layout.java:340)
04-10 13:09:33.747: E/(6732): at android.text.BoringLayout.draw(BoringLayout.java:365)
04-10 13:09:33.747: E/(6732): at android.widget.TextView.onDraw(TextView.java:4322)
04-10 13:09:33.747: E/(6732): at android.view.View.draw(View.java:6920)
04-10 13:09:33.747: E/(6732): at android.view.ViewGroup.drawChild(ViewGroup.java:1651)
04-10 13:09:33.747: E/(6732): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
04-10 13:09:33.747: E/(6732): at android.view.ViewGroup.drawChild(ViewGroup.java:1649)
04-10 13:09:33.747: E/(6732): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
04-10 13:09:33.747: E/(6732): at android.view.ViewGroup.drawChild(ViewGroup.java:1649)
04-10 13:09:33.747: E/(6732): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
04-10 13:09:33.747: E/(6732): at android.view.ViewGroup.drawChild(ViewGroup.java:1649)
04-10 13:09:33.747: E/(6732): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
04-10 13:09:33.747: E/(6732): at android.view.ViewGroup.drawChild(ViewGroup.java:1649)
04-10 13:09:33.747: E/(6732): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
04-10 13:09:33.747: E/(6732): at android.view.ViewGroup.drawChild(ViewGroup.java:1649)
04-10 13:09:33.747: E/(6732): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
04-10 13:09:33.747: E/(6732): at android.view.View.draw(View.java:6923)
04-10 13:09:33.747: E/(6732): at android.widget.FrameLayout.draw(FrameLayout.java:357)
04-10 13:09:33.747: E/(6732): at android.view.ViewGroup.drawChild(ViewGroup.java:1651)
04-10 13:09:33.747: E/(6732): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
04-10 13:09:33.747: E/(6732): at android.view.ViewGroup.drawChild(ViewGroup.java:1649)
04-10 13:09:33.747: E/(6732): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
04-10 13:09:33.747: E/(6732): at android.view.View.draw(View.java:6923)
04-10 13:09:33.747: E/(6732): at android.view.ViewGroup.drawChild(ViewGroup.java:1651)
04-10 13:09:33.747: E/(6732): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
04-10 13:09:33.747: E/(6732): at android.widget.AbsListView.dispatchDraw(AbsListView.java:1487)
04-10 13:09:33.747: E/(6732): at android.view.View.draw(View.java:7026)
04-10 13:09:33.747: E/(6732): at android.widget.AbsListView.draw(AbsListView.java:2595)
04-10 13:09:33.747: E/(6732): at android.view.ViewGroup.drawChild(ViewGroup.java:1651)
04-10 13:09:33.747: E/(6732): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
04-10 13:09:33.747: E/(6732): at android.view.View.draw(View.java:6923)
04-10 13:09:33.747: E/(6732): at android.view.ViewGroup.drawChild(ViewGroup.java:1651)
04-10 13:09:33.747: E/(6732): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
04-10 13:09:33.747: E/(6732): at android.view.View.draw(View.java:6923)
04-10 13:09:33.747: E/(6732): at android.view.ViewGroup.drawChild(ViewGroup.java:1651)
04-10 13:09:33.747: E/(6732): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
04-10 13:09:33.747: E/(6732): at android.view.ViewGroup.drawChild(ViewGroup.java:1649)
04-10 13:09:33.747: E/(6732): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
04-10 13:09:33.747: E/(6732): at android.view.ViewGroup.drawChild(ViewGroup.java:1649)
04-10 13:09:33.747: E/(6732): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
04-10 13:09:33.747: E/(6732): at android.view.View.draw(View.java:6923)
04-10 13:09:33.747: E/(6732): at android.support.v4.view.ViewPager.draw(ViewPager.java:2153)
04-10 13:09:33.747: E/(6732): at android.view.ViewGroup.drawChild(ViewGroup.java:1651)
04-10 13:09:33.747: E/(6732): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
04-10 13:09:33.747: E/(6732): at android.view.ViewGroup.drawChild(ViewGroup.java:1649)
04-10 13:09:33.747: E/(6732): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
04-10 13:09:33.747: E/(6732): at android.view.ViewGroup.drawChild(ViewGroup.java:1649)
04-10 13:09:33.747: E/(6732): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
04-10 13:09:33.747: E/(6732): at android.view.ViewGroup.drawChild(ViewGroup.java:1649)
04-10 13:09:33.747: E/(6732): at android.support.v4.widget.DrawerLayout.drawChild(DrawerLayout.java:769)
04-10 13:09:33.747: E/(6732): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
04-10 13:09:33.747: E/(6732): at android.view.ViewGroup.drawChild(ViewGroup.java:1649)
04-10 13:09:33.747: E/(6732): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
04-10 13:09:33.747: E/(6732): at android.view.View.draw(View.java:6923)
04-10 13:09:33.747: E/(6732): at android.widget.FrameLayout.draw(FrameLayout.java:357)
04-10 13:09:33.747: E/(6732): at android.view.ViewGroup.drawChild(ViewGroup.java:1651)
04-10 13:09:33.747: E/(6732): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
04-10 13:09:33.747: E/(6732): at android.view.ViewGroup.drawChild(ViewGroup.java:1649)
04-10 13:09:33.747: E/(6732): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1373)
Your XML is probably too complicated and giving additional commands for drawing may be blocking you.
If you have too many nested layout views or if you have too many methods which have recursive calls it is normal that you will see java.lang.StackOverflowError.
Check out Android Developers blog to see how to ideally optimise your complex Layouts.
Also don't forget to check CommonsWare answer in the following topic about number of nested layouts:
Stackoverflow: Caused by nested views?

Getting ExceptionInInitializerError due to UnsatisfiedLinkError for Android NDK

When I use NDK + Android + JNI + OPENCV4ANDROID(2.4.2) I get the following error:
Caused by: java.lang.UnsatisfiedLinkError: Cannot load library: reloc_library[1312]: 2586 cannot locate '_ZN2cv3Mat8copySizeERKS0_'...
I couldn't find anything useful when I searched.
Here's the logcat:
04-10 12:05:19.960: E/AndroidRuntime(11567): FATAL EXCEPTION: main
04-10 12:05:19.960: E/AndroidRuntime(11567): java.lang.ExceptionInInitializerError
04-10 12:05:19.960: E/AndroidRuntime(11567): at java.lang.Class.newInstanceImpl>(Native Method)
04-10 12:05:19.960: E/AndroidRuntime(11567): at java.lang.Class.newInstance(Class.java:1409)
04-10 12:05:19.960: E/AndroidRuntime(11567): at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
04-10 12:05:19.960: E/AndroidRuntime(11567): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1565)
04-10 12:05:19.960: E/AndroidRuntime(11567): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667)
04-10 12:05:19.960: E/AndroidRuntime(11567): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
04-10 12:05:19.960: E/AndroidRuntime(11567): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935)
04-10 12:05:19.960: E/AndroidRuntime(11567): at android.os.Handler.dispatchMessage(Handler.java:99)
04-10 12:05:19.960: E/AndroidRuntime(11567): at android.os.Looper.loop(Looper.java:130)
04-10 12:05:19.960: E/AndroidRuntime(11567): at android.app.ActivityThread.main(ActivityThread.java:3691)
04-10 12:05:19.960: E/AndroidRuntime(11567): at java.lang.reflect.Method.invokeNative(Native Method)
04-10 12:05:19.960: E/AndroidRuntime(11567): at java.lang.reflect.Method.invoke(Method.java:507)
04-10 12:05:19.960: E/AndroidRuntime(11567): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:907)
04-10 12:05:19.960: E/AndroidRuntime(11567): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:665)
04-10 12:05:19.960: E/AndroidRuntime(11567): at dalvik.system.NativeStart.main(Native Method)
04-10 12:05:19.960: E/AndroidRuntime(11567): Caused by: java.lang.UnsatisfiedLinkError: Cannot load library: reloc_library[1312]: 2586 cannot locate '_ZN2cv3Mat8copySizeERKS0_'...
04-10 12:05:19.960: E/AndroidRuntime(11567): at java.lang.Runtime.loadLibrary(Runtime.java:434)
04-10 12:05:19.960: E/AndroidRuntime(11567): at java.lang.System.loadLibrary(System.java:554)
04-10 12:05:19.960: E/AndroidRuntime(11567): at com.amani.main.chooser.<clinit>(chooser.java:139)
04-10 12:05:19.960: E/AndroidRuntime(11567): ... 15 more
Why am I getting an UnsatisfiedLinkError?

EmPubLite app crashing on Tutorial #13

So, I am going through the Tutorial #12 and everything is working fine. I then try to go onto Tutorial #13 for Saving/Restoring Last-Read Position and the app crashes:
04-10 15:59:26.510: E/Trace(704): error opening trace file: No such file or directory (2)
04-10 15:59:27.491: D/AndroidRuntime(704): Shutting down VM
04-10 15:59:27.491: W/dalvikvm(704): threadid=1: thread exiting with uncaught exception (group=0x40a13300)
04-10 15:59:27.500: E/AndroidRuntime(704): FATAL EXCEPTION: main
04-10 15:59:27.500: E/AndroidRuntime(704): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.commonsware.empublite/com.commonsware.empublite.EmPubLiteActivity}: java.lang.NullPointerException
04-10 15:59:27.500: E/AndroidRuntime(704): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2059)
04-10 15:59:27.500: E/AndroidRuntime(704): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
04-10 15:59:27.500: E/AndroidRuntime(704): at android.app.ActivityThread.access$600(ActivityThread.java:130)
04-10 15:59:27.500: E/AndroidRuntime(704): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
04-10 15:59:27.500: E/AndroidRuntime(704): at android.os.Handler.dispatchMessage(Handler.java:99)
04-10 15:59:27.500: E/AndroidRuntime(704): at android.os.Looper.loop(Looper.java:137)
04-10 15:59:27.500: E/AndroidRuntime(704): at android.app.ActivityThread.main(ActivityThread.java:4745)
04-10 15:59:27.500: E/AndroidRuntime(704): at java.lang.reflect.Method.invokeNative(Native Method)
04-10 15:59:27.500: E/AndroidRuntime(704): at java.lang.reflect.Method.invoke(Method.java:511)
04-10 15:59:27.500: E/AndroidRuntime(704): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
04-10 15:59:27.500: E/AndroidRuntime(704): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
04-10 15:59:27.500: E/AndroidRuntime(704): at dalvik.system.NativeStart.main(Native Method)
04-10 15:59:27.500: E/AndroidRuntime(704): Caused by: java.lang.NullPointerException
04-10 15:59:27.500: E/AndroidRuntime(704): at com.commonsware.empublite.ModelFragment.executeAsyncTask(ModelFragment.java:51)
04-10 15:59:27.500: E/AndroidRuntime(704): at com.commonsware.empublite.ModelFragment.deliverModel(ModelFragment.java:38)
04-10 15:59:27.500: E/AndroidRuntime(704): at com.commonsware.empublite.ModelFragment.onActivityCreated(ModelFragment.java:29)
04-10 15:59:27.500: E/AndroidRuntime(704): at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:891)
04-10 15:59:27.500: E/AndroidRuntime(704): at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1080)
04-10 15:59:27.500: E/AndroidRuntime(704): at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:622)
04-10 15:59:27.500: E/AndroidRuntime(704): at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1416)
04-10 15:59:27.500: E/AndroidRuntime(704): at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:505)
04-10 15:59:27.500: E/AndroidRuntime(704): at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1163)
04-10 15:59:27.500: E/AndroidRuntime(704): at android.app.Activity.performStart(Activity.java:5018)
04-10 15:59:27.500: E/AndroidRuntime(704): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2032)
04-10 15:59:27.500: E/AndroidRuntime(704): ... 11 more
I tried to comment out the code I did until the last point that it was working, but that didn't seem to work. I am not really sure how to read this stack trace either. What should I be looking at to fix this problem?
Thanks.
I am not really sure how to read this stack trace either. What should I be looking at to fix this problem?
Line 51 of ModelFragment.java, in the executeAsyncTask() method is where you are crashing (see last stack trace stanza, starting with Caused by: java.lang.NullPointerException).
Your line numbers and those in the answers are not completely lining up. However, the only way executeAsyncTask() could have a NullPointerException is if the AsyncTask you are passing in is null, and that should not be possible as you define those tasks immediately before calling executeAsyncTask() in the deliverModel() method. Perhaps you missed a line in deliverModel().

I have an andengine program that works on one development machine but not another?

For reasons with which I won't bore you, I have to change development computers, and for the life of me I can't get my project to work on the second machine.
I have one library which is a .jar file which both machine have access to. But the program works fine on machine A but on machine B I get the errors below. At first I thought check the manifest, but, exactly the same project works fine on Machine A. So it must be something wrong with my development environment on B. Right? I can't think what it might be. I've got more apis on B than A.
04-10 20:21:50.826: W/dalvikvm(1487): Unable to resolve superclass of Lcom/webs/thefineanimationemporium/BoxingTmcthreeActivity; (117)
04-10 20:21:50.826: W/dalvikvm(1487): Link of class 'Lcom/webs/thefineanimationemporium/BoxingTmcthreeActivity;' failed
04-10 20:21:50.826: D/AndroidRuntime(1487): Shutting down VM
04-10 20:21:50.826: W/dalvikvm(1487): threadid=1: thread exiting with uncaught exception (group=0x2aac8578)
04-10 20:21:50.856: E/AndroidRuntime(1487): FATAL EXCEPTION: main
04-10 20:21:50.856: E/AndroidRuntime(1487): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.webs.thefineanimationemporium/com.webs.thefineanimationemporium.BoxingTmc threeActivity}: java.lang.ClassNotFoundException: com.webs.thefineanimationemporium.BoxingTmcthreeActivity in loader dalvik.system.PathClassLoader[/data/app/com.webs.thefineanimationemporium-1.apk]
04-10 20:21:50.856: E/AndroidRuntime(1487): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1581)
04-10 20:21:50.856: E/AndroidRuntime(1487): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1675)
04-10 20:21:50.856: E/AndroidRuntime(1487): at android.app.ActivityThread.access$1500(ActivityThread.java:121)
04-10 20:21:50.856: E/AndroidRuntime(1487): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:943)
04-10 20:21:50.856: E/AndroidRuntime(1487): at android.os.Handler.dispatchMessage(Handler.java:99)
04-10 20:21:50.856: E/AndroidRuntime(1487): at android.os.Looper.loop(Looper.java:138)
04-10 20:21:50.856: E/AndroidRuntime(1487): at android.app.ActivityThread.main(ActivityThread.java:3701)
04-10 20:21:50.856: E/AndroidRuntime(1487): at java.lang.reflect.Method.invokeNative(Native Method)
04-10 20:21:50.856: E/AndroidRuntime(1487): at java.lang.reflect.Method.invoke(Method.java:507)
04-10 20:21:50.856: E/AndroidRuntime(1487): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:878)
04-10 20:21:50.856: E/AndroidRuntime(1487): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:636)
04-10 20:21:50.856: E/AndroidRuntime(1487): at dalvik.system.NativeStart.main(Native Method)
04-10 20:21:50.856: E/AndroidRuntime(1487): Caused by: java.lang.ClassNotFoundException: com.webs.thefineanimationemporium.BoxingTmcthreeActivity in loader dalvik.system.PathClassLoader[/data/app/com.webs.thefineanimationemporium-1.apk]
04-10 20:21:50.856: E/AndroidRuntime(1487): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
04-10 20:21:50.856: E/AndroidRuntime(1487): at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
04-10 20:21:50.856: E/AndroidRuntime(1487): at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
04-10 20:21:50.856: E/AndroidRuntime(1487): at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
04-10 20:21:50.856: E/AndroidRuntime(1487): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1573)
04-10 20:21:50.856: E/AndroidRuntime(1487): ... 11 more
04-10 20:21:55.216: I/Process(1487): Sending signal. PID: 1487 SIG: 9
Sounds like a dodgy install on the second device to me, since one of the classes being called cant be found. Have you tried reinstalling?
edit: Sorry for sounding like someone from a tech support line...

Categories

Resources