yunjianwu / achartengine

Automatically exported from code.google.com/p/achartengine
0 stars 0 forks source link

Nullpointer exception upon orientation change on real device. #248

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. A XYMultipleSeries graph is created (just drawing x,y line data)
2. some zooming/moving of the graph
3. do orientation change from portrait to landscape on real device

What is the expected output? What do you see instead?
Sometimes, only sometimes (1 in 5) it just plains crashes with a null-pointer 
exception related to code in AChartEngine

Stacktrace:
E/AndroidRuntime( 4155): FATAL EXCEPTION: main
java.lang.NullPointerException
at org.achartengine.chart.XYChart.toRealPoint(XYChart.java:805)
at org.achartengine.tools.Pan.apply(Pan.java:74)
at org.achartengine.TouchHandler.handleTouch(TouchHandler.java:126)
at org.achartengine.GraphicalView.onTouchEvent(GraphicalView.java:286)
at android.view.View.dispatchTouchEvent(View.java:3919)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:936)
at 
com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(P
honeWindow.java:1709)
at 
com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow
.java:1123)
at android.app.Activity.dispatchTouchEvent(Activity.java:2090)
at 
com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneW
indow.java:1693)
at android.view.ViewRoot.handleMessage(ViewRoot.java:1785)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:4627)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at 
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
at dalvik.system.NativeStart.main(Native Method)

Please provide a source code snippet that we can use to replicate the issue.

What version of the product binary library are you using?
1.0 (latest available version for download)

Please provide any additional information below.

Original issue reported on code.google.com by martink...@gmail.com on 22 Sep 2012 at 12:03

GoogleCodeExporter commented 9 years ago
I just had a crash report from one of my app users for this. Using engine 1.0

java.lang.NullPointerException
        at org.achartengine.chart.XYChart.toRealPoint(SourceFile:805)
        at org.achartengine.tools.Pan.apply(SourceFile:74)
        at org.achartengine.TouchHandler.handleTouch(SourceFile:126)
        at org.achartengine.GraphicalView.onTouchEvent(SourceFile:286)
        at android.view.View.dispatchTouchEvent(View.java:7127)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2176)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1919)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2176)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1919)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2176)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1919)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2176)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1919)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2176)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1919)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2176)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1919)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2176)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1919)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2176)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1919)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2176)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1919)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2176)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1919)
        at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2176)
        at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1919)
        at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1925)
        at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1379)
        at android.app.Activity.dispatchTouchEvent(Activity.java:2396)
        at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1873)
        at android.view.View.dispatchPointerEvent(View.java:7307)
        at android.view.ViewRootImpl.deliverPointerEvent(ViewRootImpl.java:3172)
        at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:3117)
        at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:4153)
        at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:4132)
        at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:4224)
        at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:171)
        at android.view.InputEventReceiver.nativeConsumeBatchedInputEvents(Native Method)
        at android.view.InputEventReceiver.consumeBatchedInputEvents(InputEventReceiver.java:163)
        at android.view.ViewRootImpl.doConsumeBatchedInput(ViewRootImpl.java:4203)
        at android.view.ViewRootImpl$ConsumeBatchedInputRunnable.run(ViewRootImpl.java:4243)
        at android.view.Choreographer$CallbackRecord.run(Choreographer.java:725)
        at android.view.Choreographer.doCallbacks(Choreographer.java:555)
        at android.view.Choreographer.doFrame(Choreographer.java:523)
        at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:711)
        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: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)

Build Ino.
"BOARD=EeePad
BOOTLOADER=unknown
BRAND=asus
CPU_ABI=armeabi-v7a
CPU_ABI2=armeabi
DEVICE=TF300TG
DISPLAY=JRO03C.WW_epad-10.4.3.9-20121106
FINGERPRINT=asus/WW_epad/TF300TG:4.1.1/JRO03C/WW_epad-10.4.3.9-20121106:user/rel
ease-keys
HARDWARE=cardhu
HOST=Venus
ID=JRO03C
IS_DEBUGGABLE=false
MANUFACTURER=asus
MODEL=ASUS Transformer Pad TF300TG
PRODUCT=WW_epad
RADIO=unknown
SERIAL=C7OKCT100210
TAGS=release-keys
TIME=1352212276000
TYPE=user
UNKNOWN=unknown
USER=android
"

Crash configuration.
"compatScreenHeightDp=320
compatScreenWidthDp=545
compatSmallestScreenWidthDp=320
fontScale=1.0
hardKeyboardHidden=HARDKEYBOARDHIDDEN_NO
keyboard=KEYBOARD_QWERTY
keyboardHidden=KEYBOARDHIDDEN_NO
layoutDirection=0
locale=en_US
mcc=530
mnc=5
navigation=NAVIGATION_NONAV
navigationHidden=NAVIGATIONHIDDEN_YES
orientation=ORIENTATION_LANDSCAPE
screenHeightDp=752
screenLayout=SCREENLAYOUT_SIZE_XLARGE+SCREENLAYOUT_LONG_NO
screenWidthDp=1280
seq=19
smallestScreenWidthDp=800
touchscreen=TOUCHSCREEN_FINGER
uiMode=UI_MODE_TYPE_NORMAL+UI_MODE_NIGHT_NO
userSetLocale=false
"

Using android 4.1.1

Original comment by mat...@winters.org.nz on 27 Nov 2012 at 9:44

GoogleCodeExporter commented 9 years ago
I just had the exact same error report.

Original comment by VieyraS...@gmail.com on 11 Dec 2012 at 1:29

GoogleCodeExporter commented 9 years ago
I get the exact same problem but without orientation change.

I have a ListFragment in my android app which loads different graph views 
depending on which item in the list is selected.

When you click once on an item and then quickly tap a different one before it 
loads, (as if you had changed your mind at the last second as to which item you 
wanted to select) the application will crash with this exact same achartengine 
error.

This is probably due to a touch event firing on the graph view before it is 
fully loaded. Please fix this Null Pointer Exception.

Original comment by benn.ma...@gmail.com on 12 Dec 2012 at 11:18

GoogleCodeExporter commented 9 years ago

Original comment by dandrome...@gmail.com on 8 Jan 2013 at 12:29

GoogleCodeExporter commented 9 years ago
I have same problem like a Benn. Can somebody tell me how i can prevent from 
this error? Thanks

Original comment by michal.m...@gmail.com on 18 Mar 2013 at 8:36

GoogleCodeExporter commented 9 years ago
Upgrade to 1.1.0.

Original comment by dandrome...@gmail.com on 19 Mar 2013 at 7:38