【接入斯凯SDK异常】
耗时0.6人天
问题描述:接入斯凯SDK后,点击付费按钮后卡死(顺利的话回弹出斯凯确认面板)
不断重复日志内容:
09-22 18:22:15.179: W/System.err(28848): java.lang.NullPointerException
09-22 18:22:15.179: W/System.err(28848): at android.content.ContextWrapper.getResources(ContextWrapper.java:89)
09-22 18:22:15.179: W/System.err(28848): at android.widget.Toast.<init>(Toast.java:99)
09-22 18:22:15.180: W/System.err(28848): at android.widget.Toast.makeText(Toast.java:245)
09-22 18:22:15.180: W/System.err(28848): at com.skymobi.pay.opplugin.v2014.app.b.run(Unknown Source)
出现该问题前,确认面板工作一直OK,突然之间就不行了
根据SDK支持人员建议把所有资源文件都替换一轮都解决不了问题
代码也一点一点排查,仍然不OK
【问题发现思路】
由于后面不停出现Toast的日志,猜想在日志的源头是否有有用的信息。故此找到问题源头
09-22 18:22:15.134: W/System.err(28848): java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()
09-22 18:22:15.135: W/System.err(28848): at android.os.Handler.<init>(Handler.java:205)
09-22 18:22:15.135: W/System.err(28848): at android.os.Handler.<init>(Handler.java:119)
09-22 18:22:15.135: W/System.err(28848): at com.o2o.singlegame.activity.p.<init>(Unknown Source)
09-22 18:22:15.135: W/System.err(28848): at com.o2o.singlegame.activity.o.a(Unknown Source)
09-22 18:22:15.135: W/System.err(28848): at com.o2o.singlegame.SDKCore.pay(Unknown Source)
09-22 18:22:15.135: W/System.err(28848): at com.cldeer.bubblebear.O2OGameInterface.payForIt(O2OGameInterface.java:84)
09-22 18:22:15.135: W/System.err(28848): at org.cocos2dx.lib.Cocos2dxRenderer.nativeTouchesEnd(Native Method)
09-22 18:22:15.135: W/System.err(28848): at org.cocos2dx.lib.Cocos2dxRenderer.handleActionUp(Cocos2dxRenderer.java:129)
09-22 18:22:15.135: W/System.err(28848): at org.cocos2dx.lib.Cocos2dxGLSurfaceView$9.run(Cocos2dxGLSurfaceView.java:261)
09-22 18:22:15.135: W/System.err(28848): at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1494)
09-22 18:22:15.136: W/System.err(28848): at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1272)
出现该问题的原因一般是在UI线程外面进行界面操作。尝试修改后,问题解决
耗时0.6人天
问题描述:接入斯凯SDK后,点击付费按钮后卡死(顺利的话回弹出斯凯确认面板)
不断重复日志内容:
09-22 18:22:15.179: W/System.err(28848): java.lang.NullPointerException
09-22 18:22:15.179: W/System.err(28848): at android.content.ContextWrapper.getResources(ContextWrapper.java:89)
09-22 18:22:15.179: W/System.err(28848): at android.widget.Toast.<init>(Toast.java:99)
09-22 18:22:15.180: W/System.err(28848): at android.widget.Toast.makeText(Toast.java:245)
09-22 18:22:15.180: W/System.err(28848): at com.skymobi.pay.opplugin.v2014.app.b.run(Unknown Source)
出现该问题前,确认面板工作一直OK,突然之间就不行了
根据SDK支持人员建议把所有资源文件都替换一轮都解决不了问题
代码也一点一点排查,仍然不OK
【问题发现思路】
由于后面不停出现Toast的日志,猜想在日志的源头是否有有用的信息。故此找到问题源头
09-22 18:22:15.134: W/System.err(28848): java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()
09-22 18:22:15.135: W/System.err(28848): at android.os.Handler.<init>(Handler.java:205)
09-22 18:22:15.135: W/System.err(28848): at android.os.Handler.<init>(Handler.java:119)
09-22 18:22:15.135: W/System.err(28848): at com.o2o.singlegame.activity.p.<init>(Unknown Source)
09-22 18:22:15.135: W/System.err(28848): at com.o2o.singlegame.activity.o.a(Unknown Source)
09-22 18:22:15.135: W/System.err(28848): at com.o2o.singlegame.SDKCore.pay(Unknown Source)
09-22 18:22:15.135: W/System.err(28848): at com.cldeer.bubblebear.O2OGameInterface.payForIt(O2OGameInterface.java:84)
09-22 18:22:15.135: W/System.err(28848): at org.cocos2dx.lib.Cocos2dxRenderer.nativeTouchesEnd(Native Method)
09-22 18:22:15.135: W/System.err(28848): at org.cocos2dx.lib.Cocos2dxRenderer.handleActionUp(Cocos2dxRenderer.java:129)
09-22 18:22:15.135: W/System.err(28848): at org.cocos2dx.lib.Cocos2dxGLSurfaceView$9.run(Cocos2dxGLSurfaceView.java:261)
09-22 18:22:15.135: W/System.err(28848): at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1494)
09-22 18:22:15.136: W/System.err(28848): at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1272)
出现该问题的原因一般是在UI线程外面进行界面操作。尝试修改后,问题解决