我在Titanium上有一个新闻应用程序,它在SDK 6上运行良好。 自SDK 7.0.1更新以来,我在Android上面临NullPointerException。
该应用程序的工作原理如下。启动时,会显示一个新闻列表(TableView)。当我点击某个项目时,会打开一个新窗口以显示新闻详细信息。 当我回去时,显示列表。现在,当我尝试滚动屏幕时,应用程序崩溃了。
Bellow是我在展位Genymotion和运行Android 6或7的真实设备上的日志。
09:38:48 E TiApplication : (main) [6538,99229] Sending event: exception on thread: main msg:java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.View org.appcelerator.titanium.view.TiUIView.getOuterView()' on a null object reference; Titanium 7.0.1,2017/12/18 10:42,undefined
09:38:48 E TiApplication : java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.View org.appcelerator.titanium.view.TiUIView.getOuterView()' on a null object reference
09:38:48 E TiApplication : at ti.modules.titanium.ui.widget.tableview.TiTableViewRowProxyItem.createControls(TiTableViewRowProxyItem.java:244)
09:38:48 E TiApplication : at ti.modules.titanium.ui.widget.tableview.TiTableViewRowProxyItem.setRowData(TiTableViewRowProxyItem.java:423)
09:38:48 E TiApplication : at ti.modules.titanium.ui.widget.tableview.TiTableViewRowProxyItem.setRowData(TiTableViewRowProxyItem.java:86)
09:38:48 E TiApplication : at ti.modules.titanium.ui.widget.tableview.TiTableView$TTVListAdapter.getView(TiTableView.java:254)
09:38:48 E TiApplication : at android.widget.AbsListView.obtainView(AbsListView.java:2372)
09:38:48 E TiApplication : at android.widget.ListView.makeAndAddView(ListView.java:2052)
09:38:48 E TiApplication : at android.widget.ListView.fillDown(ListView.java:786)
09:38:48 E TiApplication : at android.widget.ListView.fillGap(ListView.java:750)
09:38:48 E TiApplication : at android.widget.AbsListView.trackMotionScroll(AbsListView.java:5232)
09:38:48 E TiApplication : at android.widget.ListView.trackMotionScroll(ListView.java:1971)
09:38:48 E TiApplication : at android.widget.AbsListView.scrollIfNeeded(AbsListView.java:3581)
09:38:48 E TiApplication : at android.widget.AbsListView.onTouchMove(AbsListView.java:3990)
09:38:48 E TiApplication : at android.widget.AbsListView.onTouchEvent(AbsListView.java:3815)
09:38:48 E TiApplication : at ti.modules.titanium.ui.widget.listview.TiNestedListView.onTouchEvent(TiNestedListView.java:127)
09:38:48 E TiApplication : at android.view.View.dispatchTouchEvent(View.java:11721)
09:38:48 E TiApplication : at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2955)
09:38:48 E TiApplication : at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2636)
09:38:48 E TiApplication : at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2961)
09:38:48 E TiApplication : at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2650)
09:38:48 E TiApplication : at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2961)
09:38:48 E TiApplication : at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2650)
09:38:48 E TiApplication : at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2961)
09:38:48 E TiApplication : at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2650)
09:38:48 E TiApplication : at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2961)
09:38:48 E TiApplication : at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2650)
09:38:48 E TiApplication : at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2961)
09:38:48 E TiApplication : at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2650)
09:38:48 E TiApplication : at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2961)
09:38:48 E TiApplication : at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2650)
09:38:48 E TiApplication : at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2961)
09:38:48 E TiApplication : at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2650)
09:38:48 E TiApplication : at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2961)
09:38:48 E TiApplication : at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2650)
09:38:48 E TiApplication : at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2961)
09:38:48 E TiApplication : at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2650)
09:38:48 E TiApplication : at com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:445)
09:38:48 E TiApplication : at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1828)
09:38:48 E TiApplication : at android.app.Activity.dispatchTouchEvent(Activity.java:3292)
09:38:48 E TiApplication : at android.support.v7.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:68)
09:38:48 E TiApplication : at com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java:407)
09:38:48 E TiApplication : at android.view.View.dispatchPointerEvent(View.java:11960)
09:38:48 E TiApplication : at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:4776)
09:38:48 E TiApplication : at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4590)
09:38:48 E TiApplication : at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4128)
09:38:48 E TiApplication : at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4181)
09:38:48 E TiApplication : at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4147)
09:38:48 E TiApplication : at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4274)
09:38:48 E TiApplication : at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4155)
09:38:48 E TiApplication : at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4331)
09:38:48 E TiApplication : at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4128)
09:38:48 E TiApplication : at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4181)
09:38:48 E TiApplication : at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4147)
09:38:48 E TiApplication : at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4155)
09:38:48 E TiApplication : at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4128)
09:38:48 E TiApplication : at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:6642)
09:38:48 E TiApplication : at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:6616)
09:38:48 E TiApplication : at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:6577)
09:38:48 E TiApplication : at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:6745)
09:38:48 E TiApplication : at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:185)
09:38:48 E TiApplication : at android.view.InputEventReceiver.nativeConsumeBatchedInputEvents(Native Method)
09:38:48 E TiApplication : at android.view.InputEventReceiver.consumeBatchedInputEvents(InputEventReceiver.java:176)
09:38:48 E TiApplication : at android.view.ViewRootImpl.doConsumeBatchedInput(ViewRootImpl.java:6716)
09:38:48 E TiApplication : at android.view.ViewRootImpl$ConsumeBatchedInputRunnable.run(ViewRootImpl.java:6768)
09:38:48 E TiApplication : at android.view.Choreographer$CallbackRecord.run(Choreographer.java:911)
09:38:48 E TiApplication : at android.view.Choreographer.doCallbacks(Choreographer.java:723)
09:38:48 E TiApplication : at android.view.Choreographer.doFrame(Choreographer.java:652)
09:38:48 E TiApplication : at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:897)
09:38:48 E TiApplication : at android.os.Handler.handleCallback(Handler.java:789)
09:38:48 E TiApplication : at android.os.Handler.dispatchMessage(Handler.java:98)
09:38:48 E TiApplication : at android.os.Looper.loop(Looper.java:164)
09:38:48 E TiApplication : at android.app.ActivityThread.main(ActivityThread.java:6541)
09:38:48 E TiApplication : at java.lang.reflect.Method.invoke(Native Method)
09:38:48 E TiApplication : at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
09:38:48 E TiApplication : at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)