{ "id": "89543", "key": "TIMOB-8622", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "14164", "description": "Release 3.0.2", "name": "Release 3.0.2", "archived": true, "released": true, "releaseDate": "2013-02-19" }, { "id": "15277", "description": "2013 Sprint 06 Core", "name": "2013 Sprint 06 Core", "archived": true, "released": true, "releaseDate": "2013-03-25" }, { "id": "14816", "description": "2013 Sprint 06", "name": "2013 Sprint 06", "archived": true, "released": true, "releaseDate": "2013-03-25" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2013-03-18T20:34:52.000+0000", "created": "2012-04-05T06:41:09.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "SupportTeam", "core", "qe-testadded" ], "versions": [ { "id": "12593", "name": "Release 2.0.0", "archived": false, "released": true, "releaseDate": "2012-03-30" } ], "issuelinks": [], "assignee": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2013-10-04T11:25:18.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "h4. Problem Description\r\nWhen building to android I get regular occasional errors when building to the device which fails to initialise the app.\r\n\r\n\r\n\r\nh4. Actual Results\r\nHere is the DDMS error:\r\n\r\n{code}\r\n04-05 15:36:30.609: E/TiApplication(32009): (main) [348,985] Sending event: exception on thread: main msg:java.lang.RuntimeException: Unable to create application uk.co.spiritquest.sfl11b1.ScifilondonApplication: android.database.sqlite.SQLiteException: unable to open database file; Titanium 2.0.0,2012/03/30 10:33,b091bae\r\n04-05 15:36:30.609: E/TiApplication(32009): java.lang.RuntimeException: Unable to create application uk.co.spiritquest.sfl11b1.ScifilondonApplication: android.database.sqlite.SQLiteException: unable to open database file\r\n04-05 15:36:30.609: E/TiApplication(32009): \tat android.app.ActivityThread.handleBindApplication(ActivityThread.java:3812)\r\n04-05 15:36:30.609: E/TiApplication(32009): \tat android.app.ActivityThread.access$2200(ActivityThread.java:132)\r\n04-05 15:36:30.609: E/TiApplication(32009): \tat android.app.ActivityThread$H.handleMessage(ActivityThread.java:1082)\r\n04-05 15:36:30.609: E/TiApplication(32009): \tat android.os.Handler.dispatchMessage(Handler.java:99)\r\n04-05 15:36:30.609: E/TiApplication(32009): \tat android.os.Looper.loop(Looper.java:150)\r\n04-05 15:36:30.609: E/TiApplication(32009): \tat android.app.ActivityThread.main(ActivityThread.java:4277)\r\n04-05 15:36:30.609: E/TiApplication(32009): \tat java.lang.reflect.Method.invokeNative(Native Method)\r\n04-05 15:36:30.609: E/TiApplication(32009): \tat java.lang.reflect.Method.invoke(Method.java:507)\r\n04-05 15:36:30.609: E/TiApplication(32009): \tat com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)\r\n04-05 15:36:30.609: E/TiApplication(32009): \tat com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)\r\n04-05 15:36:30.609: E/TiApplication(32009): \tat dalvik.system.NativeStart.main(Native Method)\r\n04-05 15:36:30.609: E/TiApplication(32009): Caused by: android.database.sqlite.SQLiteException: unable to open database file\r\n04-05 15:36:30.609: E/TiApplication(32009): \tat android.database.sqlite.SQLiteDatabase.dbopen(Native Method)\r\n04-05 15:36:30.609: E/TiApplication(32009): \tat android.database.sqlite.SQLiteDatabase.(SQLiteDatabase.java:1956)\r\n04-05 15:36:30.609: E/TiApplication(32009): \tat android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:902)\r\n04-05 15:36:30.609: E/TiApplication(32009): \tat android.database.sqlite.SQLiteOpenHelper.getReadableDatabase(SQLiteOpenHelper.java:208)\r\n04-05 15:36:30.609: E/TiApplication(32009): \tat org.appcelerator.titanium.util.TiDatabaseHelper.getPlatformParam(TiDatabaseHelper.java:73)\r\n04-05 15:36:30.609: E/TiApplication(32009): \tat org.appcelerator.titanium.util.TiPlatformHelper.initialize(TiPlatformHelper.java:69)\r\n04-05 15:36:30.609: E/TiApplication(32009): \tat org.appcelerator.titanium.TiApplication.postAppInfo(TiApplication.java:349)\r\n04-05 15:36:30.609: E/TiApplication(32009): \tat uk.co.spiritquest.sfl11b1.ScifilondonApplication.onCreate(ScifilondonApplication.java:34)\r\n04-05 15:36:30.609: E/TiApplication(32009): \tat android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:984)\r\n04-05 15:36:30.609: E/TiApplication(32009): \tat android.app.ActivityThread.handleBindApplication(ActivityThread.java:3809)\r\n04-05 15:36:30.609: E/TiApplication(32009): \t... 10 more\r\n{code}\r\n\r\nh4. Expected results\r\nthe DB working fine\r\n\r\nh4. Test Case \r\n1. Create New mobile project\r\n2. Add this code:\r\n{code}\r\nvar win = Ti.UI.createWindow();\r\n\r\nvar l = Titanium.UI.createLabel({\r\n\ttext:'See Log for output',\r\n\ttop:10,\r\n\tleft:10,\r\n\theight:'auto',\r\n\twidth:'auto'\r\n});\r\nwin.add(l);\r\n\r\nvar b1 = Titanium.UI.createButton({\r\n\ttitle:'DB in 2nd Context',\r\n\twidth:200,\r\n\theight:40,\r\n\ttop:40\r\n});\r\nwin.add(b1);\r\n\r\nb1.addEventListener('click', function()\r\n{\r\n\tvar win1 = Titanium.UI.createWindow({\r\n\t\turl:'database_2.js',\r\n\t\theight:30,\r\n\t\twidth:280,\r\n\t\tborderRadius:10,\r\n\t\tbottom:80,\r\n\t\tbackgroundColor:'#333'\r\n\t});\r\n\tvar l1 = Titanium.UI.createLabel({\r\n\t\ttext:'2nd context test - see log.',\r\n\t\tcolor:'#fff',\r\n\t\tfont:{fontSize:14},\r\n\t\twidth:'auto',\r\n\t\theight:'auto'\r\n\t});\r\n\twin1.add(l1);\r\n\twin1.open();\r\n});\r\n\r\nvar b2 = Titanium.UI.createButton({\r\n\ttitle:'Pre-packaged DB',\r\n\twidth:200,\r\n\theight:40,\r\n\ttop:100\r\n});\r\nwin.add(b2);\r\n\r\nb2.addEventListener('click', function()\r\n{\r\n\tvar win2 = Titanium.UI.createWindow({\r\n\t\turl:'database_3.js',\r\n\t\theight:30,\r\n\t\twidth:280,\r\n\t\tborderRadius:10,\r\n\t\tbottom:140,\r\n\t\tbackgroundColor:'#333'\r\n\t});\r\n\tvar l2= Titanium.UI.createLabel({\r\n\t\ttext:'Pre-packaged Db - see log.',\r\n\t\tcolor:'#fff',\r\n\t\tfont:{fontSize:14},\r\n\t\twidth:'auto',\r\n\t\theight:'auto'\r\n\t});\r\n\twin2.add(l2);\r\n\twin2.open();\r\n\t\r\n});\r\nvar l3 = Titanium.UI.createLabel({\r\n\ttext:'unicode placeholder',\r\n\twidth:300,\r\n\theight:40,\r\n\ttop:190\r\n});\r\nwin.add(l3);\r\nif (Ti.Platform.osname !== 'android')\r\n{\r\n\twin.add(l3);\r\n\t\tvar b3 = Titanium.UI.createButton({\r\n\t\ttitle:'Check DB FullPath',\r\n\t\twidth:200,\r\n\t\theight:40,\r\n\t\ttop:150\r\n\t});\r\n\tb3.addEventListener('click', function()\r\n\t{\r\n\t\tvar path = db.file;\r\n\t\talert(\"mysql.db fullpath : \\n \\nType :\" + path +\"\\n\\nFullPath: \"+path.nativePath);\t\r\n\t});\r\n\twin.add(b3);\r\n}\r\nvar db = Titanium.Database.open('mydb');\r\n\r\ndb.execute('CREATE TABLE IF NOT EXISTS DATABASETEST (ID INTEGER, NAME TEXT)');\r\ndb.execute('DELETE FROM DATABASETEST');\r\n\r\ndb.execute('INSERT INTO DATABASETEST (ID, NAME ) VALUES(?,?)',1,'Name 1');\r\ndb.execute('INSERT INTO DATABASETEST (ID, NAME ) VALUES(?,?)',2,'Name 2');\r\ndb.execute('INSERT INTO DATABASETEST (ID, NAME ) VALUES(?,?)',3,'Name 3');\r\ndb.execute('INSERT INTO DATABASETEST (ID, NAME ) VALUES(?,?)',4,'Name 4');\r\ndb.execute('INSERT INTO DATABASETEST (ID, NAME ) VALUES(?,?)', 5, '\\u2070 \\u00B9 \\u00B2 \\u00B3 \\u2074 \\u2075 \\u2076 \\u2077 \\u2078 \\u2079');\r\nvar updateName = 'I was updated';\r\nvar updateId = 4;\r\ndb.execute('UPDATE DATABASETEST SET NAME = ? WHERE ID = ?', updateName, updateId);\r\n\r\ndb.execute('UPDATE DATABASETEST SET NAME = \"I was updated too\" WHERE ID = 2');\r\n\r\ndb.execute('DELETE FROM DATABASETEST WHERE ID = ?',1);\r\n\r\nTitanium.API.info('JUST INSERTED, rowsAffected = ' + db.rowsAffected);\r\nTitanium.API.info('JUST INSERTED, lastInsertRowId = ' + db.lastInsertRowId);\r\n\r\nvar rows = db.execute('SELECT * FROM DATABASETEST');\r\nTitanium.API.info('ROW COUNT = ' + rows.getRowCount());\r\nTitanium.API.info('ROW COUNT = ' + rows.getRowCount());\r\nTitanium.API.info('ROW COUNT = ' + rows.getRowCount());\r\n\r\nwhile (rows.isValidRow())\r\n{\r\n\tTitanium.API.info('ID: ' + rows.field(0) + ' NAME: ' + rows.fieldByName('name') + ' COLUMN NAME ' + rows.fieldName(0));\r\n\tif (rows.field(0)==5)\r\n\t{\r\n\t\tl3.text = rows.fieldByName('name');\r\n\t}\r\n\r\n\trows.next();\r\n}\r\nrows.close();\r\ndb.close(); // close db when you're done to save resources\r\nwin.open();\r\n{code}\r\n\r\nh4. Extra info\r\nAlso the Studio Console failed to build prior to the above error: I will have to add that as a comment when i encounter it next.\r\n", "attachment": [], "flagged": false, "summary": "Android: Random Android Installation bugs when building to device - sqlite realted", "creator": { "name": "stereoket", "key": "stereoket", "displayName": "Ketan Majmudar", "active": true, "timeZone": "Europe/London" }, "subtasks": [ { "id": "108839", "key": "TIMOB-12485", "fields": { "summary": "Backport to 3_0_X: TIMOB-8622", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "5", "description": "The sub-task of the issue", "name": "Sub-task", "subtask": true } } }, { "id": "110250", "key": "TIMOB-12858", "fields": { "summary": "Backport to 2_1_X: TIMOB-8622", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "5", "description": "The sub-task of the issue", "name": "Sub-task", "subtask": true } } } ], "reporter": { "name": "stereoket", "key": "stereoket", "displayName": "Ketan Majmudar", "active": true, "timeZone": "Europe/London" }, "environment": "SDK 2.0.0.GA (on Mac 10.6.8 - running Xcode 2.3, with Android tools 17 installed)\r\nAndroid HTC 2.3.6 - \r\nStudio 2.0 - \r\nMac 10.6.8", "comment": { "comments": [ { "id": "210402", "author": { "name": "tvfoodmaps", "key": "tvfoodmaps", "displayName": "Frank Apap", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I get this as well in my properly compiled app that is running correct for 95% of users. I see the following in my crash reports (from the android dev console website):\r\n\r\n\r\njava.lang.RuntimeException: Unable to create application com.apsquared.tvfoodmaps.TvfoodmapsApplication: android.database.sqlite.SQLiteException: unable to open database file\r\nat android.app.ActivityThread.handleBindApplication(ActivityThread.java:4501)\r\nat android.app.ActivityThread.access$3000(ActivityThread.java:135)\r\nat android.app.ActivityThread$H.handleMessage(ActivityThread.java:2181)\r\nat android.os.Handler.dispatchMessage(Handler.java:99)\r\nat android.os.Looper.loop(Looper.java:144)\r\nat android.app.ActivityThread.main(ActivityThread.java:4937)\r\nat java.lang.reflect.Method.invokeNative(Native Method)\r\nat java.lang.reflect.Method.invoke(Method.java:521)\r\nat com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)\r\nat com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)\r\nat dalvik.system.NativeStart.main(Native Method)\r\nCaused by: android.database.sqlite.SQLiteException: unable to open database file\r\nat android.database.sqlite.SQLiteDatabase.dbopen(Native Method)\r\nat android.database.sqlite.SQLiteDatabase.(SQLiteDatabase.java:1899)\r\nat android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:881)\r\nat android.database.sqlite.SQLiteOpenHelper.getReadableDatabase(SQLiteOpenHelper.java:168)\r\nat org.appcelerator.titanium.util.TiDatabaseHelper.getPlatformParam(TiDatabaseHelper.java:73)\r\nat org.appcelerator.titanium.util.TiPlatformHelper.initialize(TiPlatformHelper.java:69)\r\nat org.appcelerator.titanium.TiApplication.postAppInfo(TiApplication.java:372)\r\nat com.apsquared.tvfoodmaps.TvfoodmapsApplication.onCreate(TvfoodmapsApplication.java:34)\r\nat android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:979)\r\nat android.app.ActivityThread.handleBindApplication(ActivityThread.java:4498)\r\n... 10 more\r\n", "updateAuthor": { "name": "tvfoodmaps", "key": "tvfoodmaps", "displayName": "Frank Apap", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-07-30T05:51:45.000+0000", "updated": "2012-07-30T05:51:45.000+0000" }, { "id": "210403", "author": { "name": "tvfoodmaps", "key": "tvfoodmaps", "displayName": "Frank Apap", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This is happening on recent CI build of 2.1.1 - unfortunately I cant tell from the android reports what devices it is happening on.", "updateAuthor": { "name": "tvfoodmaps", "key": "tvfoodmaps", "displayName": "Frank Apap", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-07-30T05:52:23.000+0000", "updated": "2012-07-30T05:52:23.000+0000" }, { "id": "219223", "author": { "name": "azriel46d", "key": "azriel46d", "displayName": "Michael De Giovanni", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Can confirm that we have this same error on an HTC ChaCha , and the funny thing is that we arent using SQLLite", "updateAuthor": { "name": "azriel46d", "key": "azriel46d", "displayName": "Michael De Giovanni", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-09-17T01:30:51.000+0000", "updated": "2012-09-17T01:30:51.000+0000" }, { "id": "234971", "author": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "body": "This looks identical to this:\nhttp://stackoverflow.com/questions/3563728/random-exception-android-database-sqlite-sqliteexception-unable-to-open-databas\n\n", "updateAuthor": { "name": "penrique", "key": "penrique", "displayName": "Pedro Enrique", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-01-18T15:01:46.000+0000", "updated": "2013-01-18T15:01:46.000+0000" }, { "id": "235533", "author": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR: https://github.com/appcelerator/titanium_mobile/pull/3618", "updateAuthor": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-01-23T18:56:41.000+0000", "updated": "2013-01-23T18:56:41.000+0000" }, { "id": "237015", "author": { "name": "amittal", "key": "amittal", "displayName": "Anshu Mittal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Tested with: \r\nSDK:3.0.2.v20130201161712\r\nStudio: 3.0.2.201301281948\r\nDevice: iPhone3GS(v 5.0.1), iPhone5(v 6.0)", "updateAuthor": { "name": "amittal", "key": "amittal", "displayName": "Anshu Mittal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-02-04T07:13:37.000+0000", "updated": "2013-02-04T07:13:37.000+0000" }, { "id": "239822", "author": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Reopen to modify labels and add new subtask", "updateAuthor": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-02-26T18:37:44.000+0000", "updated": "2013-02-26T18:37:44.000+0000" }, { "id": "242746", "author": { "name": "mstepanov", "key": "mstepanov", "displayName": "Max Stepanov", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Ticket was reopened to add subtasks and change labels, but wasn't closaed afterwards.", "updateAuthor": { "name": "mstepanov", "key": "mstepanov", "displayName": "Max Stepanov", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-03-18T20:34:52.000+0000", "updated": "2013-03-18T20:34:52.000+0000" } ], "maxResults": 12, "total": 12, "startAt": 0 } } }