I have a news application on Titanium that was working fine on SDK 6.3.0. Since the update to SDK 7.0.1, I am facing a NullPointerException on Android.
I have narrowed down the issue so that I have now a simple test case to reproduce it. Enclosed are the crash logs and the sources used on this sample :
- models/article.js : simple sql article model with id and status fields
- index.xml and index.js : simple news list view and controller
- article.xml and article.js : simple news detail view and controller
The sample works as follows. At launch, a list of news is displayed as a TableView. Each row displays a title and a status.
When you click on an item, a new window is opened to display the news details. In that screen, you must click on the view to set the news status to 1.
When you go back, the list is displayed and the status has been updated on the selected row.
Now as soon as you try to scroll down the screen, the application crashes.
The issue is due to the Alloy Collection update to set the article status to 1.
function read() {
var article = Alloy.Collections.article.at(index);
article.save({status: 1});
}
Regards
Hello [~sliemlahi], Tested the issue on Android 7 device using SDK 7.0.1.GA. After running we do the following: 1)When click on an item, a new window is opened to display the news details. In that screen, we click on the view to set the news status to 1. 2)When you go back, the list is displayed and the status has been updated on the selected row. 3)Got the following error without any crash:
Can you please share the missing class *com.qualcomm.qti.Performance*? so that we can test again to reproduce the issue. *Console logs:*
Thanks
Hi, I don't know what it this com.qualcomm.qti.Performance class. I have no such class in the sample project. To make things easier, I uploaded a full Alloy sample project created simply like that below.
I then copied the 5 files included previously : model, controllers and views. Then I launched the project by executing the following command line :
Also, please do not forget to scroll down the list in step 3 to make the application crash. I have attached the new following files : - full new alloy project as stated before - environment check output - genymotion console logs of this new project Regards
[~sliemlahi] Thank you for the test case. I was able to reproduce the issue with it.
-PR-: https://github.com/appcelerator/titanium_mobile/pull/9720 new PR: https://github.com/appcelerator/titanium_mobile/pull/9721