I compiled and ran the TestCpp sample for android. I checked out a few test cases and they worked well. But the accelerometer test crashes on android. Here’s what I do.
1] Start TestCpp
2]Select Accelerometer. White dot is shown in center. Nothing happens when I tilt the device.
4] Tap anywhere on screen. (app will now crash).
Here is what I get from crash dump
Build fingerprint: ‘samsung/GT-S5670/GT-S5670:2.3.4/GINGERBREAD/XWKQ2:user/release-keys’
pid: 28201, tid: 28201 >>> org.cocos2dx.testcpp <<<
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0000009c
Stack frame #00 pc 00199a1a /mnt/asec/org.cocos2dx.testcpp-2/lib/libtestcpp.so: Routine didAccelerate in D:/Dev/cocos2d-2.0-x-2.0.4/samples/TestCpp/proj.android/../../../samples/TestCpp/Classes/AccelerometerTest/AccelerometerTest.cpp:67
Stack frame #01 pc 002bfaa8 /mnt/asec/org.cocos2dx.testcpp-2/lib/libtestcpp.so: Routine update in D:/Dev/cocos2d-2.0-x-2.0.4/samples/TestCpp/proj.android/../.
Stack frame #02 pc 002c74b8 /mnt/asec/org.cocos2dx.testcpp-2/lib/libtestcpp.so: Routine Java_org_cocos2dx_lib_Cocos2dxAccelerometer_onSensorChanged in D:/Dev/
Stack frame #03 pc 000180f4 /system/lib/libdvm.so
I was trying earlier to get accemerometer values in my game project but the “didAccelerate” method was never being called then. Here, in test cpp its being called but it crashes somehow.
It works sometime, while sometimes it does not. So I’m guessing it could be some problem with my phone. Will test more on this and post results here.