Project: titanium
Issue TIMOB-20434: Kitchen Sink Crashes on initial install 
*Description* When installing a fresh version of the kitchen sink from the stable branch on github, The first install on the phone crashes, if you change the SDK to the 5.1.2 GA and run it works. if you change the Facebook module to the 4.0.5 and run it works. After either of these it also works on 5.2.0.v20160219124528 SDK aswell *{color:red}This is a Regression.{color}* *Steps to reproduce:* # Download a fresh install of the stable kitchen sink # Change targetSdkVersion to 23 # add Android config code below to the tiapp.xml # Run the application with the 5.2.0.v20160219124528 SDK and 5.0.0 Facebook module {code:javascript} {code} *Actual :* The application crashes *Log* {code:javascript} -- Start application log ----------------------------------------------------- [INFO] : TiApplication: (main) [0,0] checkpoint, app created. [INFO] : TiApplication: (main) [51,51] Titanium 5.2.0 (2016/02/19 12:45 fd837d1) [INFO] : DatabaseHelper: No value in database for platform key: 'unique_machine_id' returning supplied default '' [INFO] : DatabaseHelper: No value in database for platform key: 'hardware_machine_id' returning supplied default '' [INFO] : TiApplication: (main) [201,252] Titanium Javascript runtime: v8 [INFO] : TiRootActivity: (main) [0,0] checkpoint, on root activity create, savedInstanceState: null [ERROR] : TiApplication: (AsyncTask #1) [24,24] Sending event: exception on thread: AsyncTask #1 msg:java.lang.NullPointerException: Attempt to invoke virtual method 'int android.app.Activity.checkSelfPermission(java.lang.String)' on a null object reference; Titanium 5.2.0,2016/02/19 12:45,fd837d1 [ERROR] : TiApplication: java.lang.NullPointerException: Attempt to invoke virtual method 'int android.app.Activity.checkSelfPermission(java.lang.String)' on a null object reference [ERROR] : TiApplication: org.appcelerator.titanium.util.TiFileHelper2.hasStoragePermission(TiFileHelper2.java:89) [ERROR] : TiApplication: org.appcelerator.titanium.util.TiResponseCache.get(TiResponseCache.java:314) [ERROR] : TiApplication: com.android.okhttp.internal.huc.CacheAdapter.getJavaCachedResponse(CacheAdapter.java:103) [ERROR] : TiApplication: com.android.okhttp.internal.huc.CacheAdapter.get(CacheAdapter.java:47) [ERROR] : TiApplication: com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:229) [ERROR] : TiApplication: com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:437) [ERROR] : TiApplication: com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:388) [ERROR] : TiApplication: com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:501) [ERROR] : TiApplication: com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getResponseCode(DelegatingHttpsURLConnection.java:105) [ERROR] : TiApplication: com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java) [ERROR] : TiApplication: com.facebook.GraphResponse.fromHttpConnection(GraphResponse.java:253) [ERROR] : TiApplication: com.facebook.GraphRequest.executeConnectionAndWait(GraphRequest.java:1255) [ERROR] : TiApplication: com.facebook.GraphRequest.executeBatchAndWait(GraphRequest.java:1157) [ERROR] : TiApplication: com.facebook.GraphRequest.executeBatchAndWait(GraphRequest.java:1124) [ERROR] : TiApplication: com.facebook.GraphRequest.executeBatchAndWait(GraphRequest.java:1108) [ERROR] : TiApplication: com.facebook.GraphRequest.executeAndWait(GraphRequest.java:1083) [ERROR] : TiApplication: com.facebook.GraphRequest.executeAndWait(GraphRequest.java:977) [ERROR] : TiApplication: com.facebook.internal.Utility.getAppSettingsQueryResponse(Utility.java:868) [ERROR] : TiApplication: com.facebook.internal.Utility.access$1(Utility.java:860) [ERROR] : TiApplication: com.facebook.internal.Utility$1.run(Utility.java:797) [ERROR] : TiApplication: java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) [ERROR] : TiApplication: java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) [ERROR] : TiApplication: java.lang.Thread.run(Thread.java:818) [INFO] : SQLiteConnectionPool: The connection pool for /data/user/0/com.appcelerator.kitchensink/databases/appcAnalytics.db has been closed but there are still 1 connections in use. They will be closed as they are released back to the pool. [INFO] : SQLiteConnectionPool: The connection pool for /data/user/0/com.appcelerator.kitchensink/databases/appcAnalytics.db has been closed but there are still 1 connections in use. They will be closed as they are released back to the pool. [ERROR] : TiApplication: (main) [38,62] Sending event: exception on thread: main msg:java.lang.RuntimeException: Unable to start activity ComponentInfo{com.appcelerator.kitchensink/com.appcelerator.kitchensink.KitchensinkActivity}: java.lang.IllegalStateException: Cannot perform this operation because the connection pool has been closed.; Titanium 5.2.0,2016/02/19 12:45,fd837d1 [ERROR] : TiApplication: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.appcelerator.kitchensink/com.appcelerator.kitchensink.KitchensinkActivity}: java.lang.IllegalStateException: Cannot perform this operation because the connection pool has been closed. [ERROR] : TiApplication: android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416) [ERROR] : TiApplication: android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476) [ERROR] : TiApplication: android.app.ActivityThread.-wrap11(ActivityThread.java) [ERROR] : TiApplication: android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344) [ERROR] : TiApplication: android.os.Handler.dispatchMessage(Handler.java:102) [ERROR] : TiApplication: android.os.Looper.loop(Looper.java:148) [ERROR] : TiApplication: android.app.ActivityThread.main(ActivityThread.java:5417) [ERROR] : TiApplication: java.lang.reflect.Method.invoke(Native Method) [ERROR] : TiApplication: com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) [ERROR] : TiApplication: com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) [ERROR] : TiApplication: Caused by: java.lang.IllegalStateException: Cannot perform this operation because the connection pool has been closed. [ERROR] : TiApplication: android.database.sqlite.SQLiteConnectionPool.throwIfClosedLocked(SQLiteConnectionPool.java:962) [ERROR] : TiApplication: android.database.sqlite.SQLiteConnectionPool.waitForConnection(SQLiteConnectionPool.java:677) [ERROR] : TiApplication: android.database.sqlite.SQLiteConnectionPool.acquireConnection(SQLiteConnectionPool.java:348) [ERROR] : TiApplication: android.database.sqlite.SQLiteSession.acquireConnection(SQLiteSession.java:894) [ERROR] : TiApplication: android.database.sqlite.SQLiteSession.executeForCursorWindow(SQLiteSession.java:834) [ERROR] : TiApplication: android.database.sqlite.SQLiteQuery.fillWindow(SQLiteQuery.java:62) [ERROR] : TiApplication: android.database.sqlite.SQLiteCursor.fillWindow(SQLiteCursor.java:143) [ERROR] : TiApplication: android.database.sqlite.SQLiteCursor.getCount(SQLiteCursor.java:132) [ERROR] : TiApplication: android.database.AbstractCursor.moveToPosition(AbstractCursor.java:219) [ERROR] : TiApplication: android.database.AbstractCursor.moveToNext(AbstractCursor.java:268) [ERROR] : TiApplication: com.appcelerator.analytics.APSAnalyticsModel.getProps(APSAnalyticsModel.java:307) [ERROR] : TiApplication: com.appcelerator.analytics.APSAnalyticsModel.addEvent(APSAnalyticsModel.java:78) [ERROR] : TiApplication: com.appcelerator.analytics.APSAnalyticsHelper.sendAnalyticsEvent(APSAnalyticsHelper.java:523) [ERROR] : TiApplication: com.appcelerator.analytics.APSAnalyticsHelper.postAnalyticsEvent(APSAnalyticsHelper.java:479) [ERROR] : TiApplication: com.appcelerator.analytics.APSAnalytics.sendAppEnrollEvent(APSAnalytics.java:121) [ERROR] : TiApplication: org.appcelerator.titanium.TiApplication.setRootActivity(TiApplication.java:498) [ERROR] : TiApplication: org.appcelerator.titanium.TiRootActivity.onCreate(TiRootActivity.java:94) [ERROR] : TiApplication: android.app.Activity.performCreate(Activity.java:6251) [ERROR] : TiApplication: android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107) [ERROR] : TiApplication: android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369) [WARN] : V8Object: (KrollRuntimeThread) [19,81] Runtime disposed, cannot set property 'userAgent' [INFO] : Process: Sending signal. PID: 11338 SIG: 9 {code} *GA :* The application runs *Expected:* The application runs
Story points: 3