Problem
On signed APK Android distribution.
Issue: while installing directly to device from studio or while loading the unsigned APK (app.apk within build folder-> bin) App works fine. But the signed APK not working. Activity indicator keeps on spinning.
Background
Have been using 3.0.2 GA and migrated to 3.1.1 GA recently. Facing this issue after the migration.
Its working fine up to 3.0.2.GA Distribution
Analytics & JS Minification are already disabled. Still on direct installation to device/the unsigned APK is working fine. Have attached the required logs.
Additional info
Added device stack trace and 'mApprovalsTest' sample. Unsigned APK launches correctly meanwhile error can be reproduced with a Signed APK.
Steps to reproduce
Please Walkthrough through the following steps (first with unsigned APK then proceed with signed APK). Install APK to device via adb in terminal, copy to SD card or bluetooth share.
(1) Click "Submit" in first screen
(2) Click left most title (that is "Purchase Requisition with count 5") in home screen.
(3) Indicator ll be loading and next screen with a tableview is loaded. Here is where on direct install / unsigned works but in signed Version indicator keeps loading/spinning.
Device output
Unsigned APK
08-14 12:58:12.020: D/Window(7320): Checkpoint: postWindowCreated()
08-14 12:58:12.020: D/Module(7320): Loading module: /Data/generatePR -> Resources/Data/generatePR.js
08-14 12:58:12.027: D/Module(7320): Loading module: /requestBuilder/prPendingRequestBuilder -> Resources/requestBuilder/prPendingRequestBuilder.js
08-14 12:58:12.051: D/Module(7320): Loading module: settings -> Resources/settings.js
08-14 12:58:12.066: I/TiAPI(7320): ****notifyResponseText{"P_NOTIF_LIST_ITEM":[{"NOTIFICATION_ID":"89901602","SUBJECT":"Second Reminder: Purchase Requisition 1329470 for LE, TIEN MINH (24.06 USD)","BEGIN_DATE":"2013-08-12T23:22:55.000-06:00","TYPE_OF_MSG":"Purchase Requisition","PO_REQ_NO":"1329470","FROM_USER":"LE, TIEN MINH","TOTAL_AMT":"24.06 USD","URGENT_REQ_FLAG":"N","PR_NUMBER":"1329470","STATUS":null,"VENDOR_NAME":"TELEPRESS INC"},{"NOTIFICATION_ID":"89901603","SUBJECT":"Second Reminder: Purchase Requisition 1329471 for LE, TIEN MINH (24.06 USD)","BEGIN_DATE":"2013-08-12T23:22:55.000-06:00","TYPE_OF_MSG":"Purchase Requisition","PO_REQ_NO":"1329471","FROM_USER":"LE, TIEN MINH","TOTAL_AMT":"24.06 USD","URGENT_REQ_FLAG":"N","PR_NUMBER":"1329471","STATUS":null,"VENDOR_NAME":"TELEPRESS INC"},{"NOTIFICATION_ID":"89901627","SUBJECT":"Second Reminder: Purchase Requisition 1329500 for LE, TIEN MINH (24.06 USD)","BEGIN_DATE":"2013-08-12T23:22:58.000-06:00","TYPE_OF_MSG":"Purchase Requisition","PO_REQ_NO":"1329500","FROM_USER":"LE, TIEN MINH","TOTAL_AMT":"24.06 USD","URGENT_REQ_FLAG":"N","PR_NUMBER":"1329500","STATUS":null,"VENDOR_NAME":"TELEPRESS INC"},{"NOTIFICATION_ID":"89901628","SUBJECT":"Second Reminder: Purchase Requisition 1329502 for LE, TIEN MINH (24.06 USD)","BEGIN_DATE":"2013-08-12T23:22:59.000-06:00","TYPE_OF_MSG":"Purchase Requisition","PO_REQ_NO":"1329502","FROM_USER":"LE, TIEN MINH","TOTAL_AMT":"24.06 USD","URGENT_REQ_FLAG":"N","PR_NUMBER":"1329502","STATUS":null,"VENDOR_NAME":"TELEPRESS INC"},{"NOTIFICATION_ID":"89901629","SUBJECT":"Second Reminder: Purchase Requisition 1329503 for LE, TIEN MINH (24.06 USD)","BEGIN_DATE":"2013-08-12T23:22:59.000-06:00","TYPE_OF_MSG":"Purchase Requisition","PO_REQ_NO":"1329503","FROM_USER":"LE, TIEN MINH","TOTAL_AMT":"24.06 USD","URGENT_REQ_FLAG":"N","PR_NUMBER":"1329503","STATUS":null,"VENDOR_NAME":"TELEPRESS INC"},null]}
08-14 12:58:12.066: I/TiAPI(7320): **** so far so good[object Object],[object Object],[object Object],[object Object],[object Object]
08-14 12:58:12.066: D/Module(7320): Loading module: /controller/PRpending -> Resources/controller/PRpending.js
08-14 12:58:12.184: D/Module(7320): Loading module: /ui/android/prPendingScreen -> Resources/ui/android/prPendingScreen.js
08-14 12:58:12.246: I/dalvikvm(7320): Failed resolving Lti/modules/titanium/ui/widget/searchview/TiUISearchView; interface 613 'Landroid/widget/SearchView$OnQueryTextListener;'
08-14 12:58:12.246: W/dalvikvm(7320): Link of class 'Lti/modules/titanium/ui/widget/searchview/TiUISearchView;' failed
08-14 12:58:12.246: E/dalvikvm(7320): Could not find class 'ti.modules.titanium.ui.widget.searchview.TiUISearchView', referenced from method ti.modules.titanium.ui.widget.TiUITableView.processProperties
08-14 12:58:12.246: W/dalvikvm(7320): VFY: unable to resolve check-cast 1881 (Lti/modules/titanium/ui/widget/searchview/TiUISearchView;) in Lti/modules/titanium/ui/widget/TiUITableView;
08-14 12:58:12.246: D/dalvikvm(7320): VFY: replacing opcode 0x1f at 0x0110
08-14 12:58:12.246: D/dalvikvm(7320): VFY: dead code 0x0112-0118 in Lti/modules/titanium/ui/widget/TiUITableView;.processProperties (Lorg/appcelerator/kroll/KrollDict;)V
08-14 12:58:12.270: I/ActivityManager(498): Starting: Intent { cmp=com.agilent.mApprovalsTest/org.appcelerator.titanium.TiActivity (has extras) } from pid 7320
08-14 12:58:12.379: D/dalvikvm(7320): GC_EXTERNAL_ALLOC freed 684K, 40% free 4324K/7175K, external 7682K/8885K, paused 35ms
Signed APK (Enabled Javascript Minification)
08-14 13:04:34.332: D/dalvikvm(7000): GC_EXPLICIT freed 50K, 44% free 3013K/5379K, external 2357K/2773K, paused 165ms
08-14 13:04:34.902: I/TiAPI(7564): ****notifyResponseText{"P_NOTIF_LIST_ITEM":[{"NOTIFICATION_ID":"89901602","SUBJECT":"Second Reminder: Purchase Requisition 1329470 for LE, TIEN MINH (24.06 USD)","BEGIN_DATE":"2013-08-12T23:22:55.000-06:00","TYPE_OF_MSG":"Purchase Requisition","PO_REQ_NO":"1329470","FROM_USER":"LE, TIEN MINH","TOTAL_AMT":"24.06 USD","URGENT_REQ_FLAG":"N","PR_NUMBER":"1329470","STATUS":null,"VENDOR_NAME":"TELEPRESS INC"},{"NOTIFICATION_ID":"89901603","SUBJECT":"Second Reminder: Purchase Requisition 1329471 for LE, TIEN MINH (24.06 USD)","BEGIN_DATE":"2013-08-12T23:22:55.000-06:00","TYPE_OF_MSG":"Purchase Requisition","PO_REQ_NO":"1329471","FROM_USER":"LE, TIEN MINH","TOTAL_AMT":"24.06 USD","URGENT_REQ_FLAG":"N","PR_NUMBER":"1329471","STATUS":null,"VENDOR_NAME":"TELEPRESS INC"},{"NOTIFICATION_ID":"89901627","SUBJECT":"Second Reminder: Purchase Requisition 1329500 for LE, TIEN MINH (24.06 USD)","BEGIN_DATE":"2013-08-12T23:22:58.000-06:00","TYPE_OF_MSG":"Purchase Requisition","PO_REQ_NO":"1329500","FROM_USER":"LE, TIEN MINH","TOTAL_AMT":"24.06 USD","URGENT_REQ_FLAG":"N","PR_NUMBER":"1329500","STATUS":null,"VENDOR_NAME":"TELEPRESS INC"},{"NOTIFICATION_ID":"89901628","SUBJECT":"Second Reminder: Purchase Requisition 1329502 for LE, TIEN MINH (24.06 USD)","BEGIN_DATE":"2013-08-12T23:22:59.000-06:00","TYPE_OF_MSG":"Purchase Requisition","PO_REQ_NO":"1329502","FROM_USER":"LE, TIEN MINH","TOTAL_AMT":"24.06 USD","URGENT_REQ_FLAG":"N","PR_NUMBER":"1329502","STATUS":null,"VENDOR_NAME":"TELEPRESS INC"},{"NOTIFICATION_ID":"89901629","SUBJECT":"Second Reminder: Purchase Requisition 1329503 for LE, TIEN MINH (24.06 USD)","BEGIN_DATE":"2013-08-12T23:22:59.000-06:00","TYPE_OF_MSG":"Purchase Requisition","PO_REQ_NO":"1329503","FROM_USER":"LE, TIEN MINH","TOTAL_AMT":"24.06 USD","URGENT_REQ_FLAG":"N","PR_NUMBER":"1329503","STATUS":null,"VENDOR_NAME":"TELEPRESS INC"},null]}
08-14 13:04:34.902: I/TiAPI(7564): **** so far so good[object Object],[object Object],[object Object],[object Object],[object Object]
08-14 13:04:35.066: E/TiExceptionHandler(7564): (main) [10723,10723] ----- Titanium Javascript Runtime Error -----
08-14 13:04:35.066: E/TiExceptionHandler(7564): (main) [0,10723] - In controller/PRpending.js:15,69
08-14 13:04:35.066: E/TiExceptionHandler(7564): (main) [0,10723] - Message: Uncaught TypeError: undefined is not a function
08-14 13:04:35.066: E/TiExceptionHandler(7564): (main) [1,10724] - Source: t("PRrfiAnswer",{rowIndex:e,comment:f}))}}});u.push(f)}k=="android"?v(u,s,i):v
08-14 13:04:35.066: E/V8Exception(7564): Exception occurred at controller/PRpending.js:15: Uncaught TypeError: undefined is not a function
08-14 13:04:39.254: D/dalvikvm(7014): GC_EXPLICIT freed 925K, 50% free 3139K/6215K, external 2357K/2773K, paused 83ms
08-14 13:04:41.645: D/LSAPP_TelMon(773): onCellTowerChanged CDMA :: {"NetTyp":"CDMA","BaseStnLat":"297036","NetOp":"33404","BaseStnId":"505","BaseStnLng":"-1488748","CntryISO":"mx","NetId":"0","SysId":"24587"}
08-14 13:04:41.668: D/LSAPP_TelMon(773): Telmon : celltower changed...new cell...clear bouncing cells upon new cell and no pending timer
Signed APK (Disabled Javascript Minification)
08-14 13:30:58.154: I/TiAPI(8566): ****notifyResponseText{"P_NOTIF_LIST_ITEM":[{"NOTIFICATION_ID":"89901602","SUBJECT":"Second Reminder: Purchase Requisition 1329470 for LE, TIEN MINH (24.06 USD)","BEGIN_DATE":"2013-08-12T23:22:55.000-06:00","TYPE_OF_MSG":"Purchase Requisition","PO_REQ_NO":"1329470","FROM_USER":"LE, TIEN MINH","TOTAL_AMT":"24.06 USD","URGENT_REQ_FLAG":"N","PR_NUMBER":"1329470","STATUS":null,"VENDOR_NAME":"TELEPRESS INC"},{"NOTIFICATION_ID":"89901603","SUBJECT":"Second Reminder: Purchase Requisition 1329471 for LE, TIEN MINH (24.06 USD)","BEGIN_DATE":"2013-08-12T23:22:55.000-06:00","TYPE_OF_MSG":"Purchase Requisition","PO_REQ_NO":"1329471","FROM_USER":"LE, TIEN MINH","TOTAL_AMT":"24.06 USD","URGENT_REQ_FLAG":"N","PR_NUMBER":"1329471","STATUS":null,"VENDOR_NAME":"TELEPRESS INC"},{"NOTIFICATION_ID":"89901627","SUBJECT":"Second Reminder: Purchase Requisition 1329500 for LE, TIEN MINH (24.06 USD)","BEGIN_DATE":"2013-08-12T23:22:58.000-06:00","TYPE_OF_MSG":"Purchase Requisition","PO_REQ_NO":"1329500","FROM_USER":"LE, TIEN MINH","TOTAL_AMT":"24.06 USD","URGENT_REQ_FLAG":"N","PR_NUMBER":"1329500","STATUS":null,"VENDOR_NAME":"TELEPRESS INC"},{"NOTIFICATION_ID":"89901628","SUBJECT":"Second Reminder: Purchase Requisition 1329502 for LE, TIEN MINH (24.06 USD)","BEGIN_DATE":"2013-08-12T23:22:59.000-06:00","TYPE_OF_MSG":"Purchase Requisition","PO_REQ_NO":"1329502","FROM_USER":"LE, TIEN MINH","TOTAL_AMT":"24.06 USD","URGENT_REQ_FLAG":"N","PR_NUMBER":"1329502","STATUS":null,"VENDOR_NAME":"TELEPRESS INC"},{"NOTIFICATION_ID":"89901629","SUBJECT":"Second Reminder: Purchase Requisition 1329503 for LE, TIEN MINH (24.06 USD)","BEGIN_DATE":"2013-08-12T23:22:59.000-06:00","TYPE_OF_MSG":"Purchase Requisition","PO_REQ_NO":"1329503","FROM_USER":"LE, TIEN MINH","TOTAL_AMT":"24.06 USD","URGENT_REQ_FLAG":"N","PR_NUMBER":"1329503","STATUS":null,"VENDOR_NAME":"TELEPRESS INC"},null]}
08-14 13:30:58.154: I/TiAPI(8566): **** so far so good[object Object],[object Object],[object Object],[object Object],[object Object]
08-14 13:30:58.303: E/TiExceptionHandler(8566): (main) [8879,8879] ----- Titanium Javascript Runtime Error -----
08-14 13:30:58.303: E/TiExceptionHandler(8566): (main) [0,8879] - In controller/PRpending.js:15,69
08-14 13:30:58.303: E/TiExceptionHandler(8566): (main) [0,8879] - Message: Uncaught TypeError: undefined is not a function
08-14 13:30:58.303: E/TiExceptionHandler(8566): (main) [0,8879] - Source: t("PRrfiAnswer",{rowIndex:e,comment:f}))}}});u.push(f)}k=="android"?v(u,s,i):v
08-14 13:30:58.303: E/V8Exception(8566): Exception occurred at controller/PRpending.js:15: Uncaught TypeError: undefined is not a function
08-14 13:30:59.631: D/dalvikvm(869): GC_EXPLICIT freed 2206K, 48% free 4860K/9223K, external 9213K/9392K, paused 73ms
08-14 13:30:59.998: I/AlarmManager(498): sending alarm Alarm{40667b50 type 1 android}
Root cause
On "Resources/controller/PRPending.js" (near the very top) just add the following to notice the issue:
exports.populatePrPendingTable = function(parsedArray, managerId, Token, callback) {
alert( 'Ti.App.densityFactor: ' + Ti.App.densityFactor);
alert( 'callback: ' + callback);
Deployment build:
08-19 16:15:59.223: D/Module(22337): Loading module: /controller/PRpending -> Resources/controller/PRpending.js
08-19 16:15:59.246: I/ALERT(22337): (KrollRuntimeThread) [8276,8276] Ti.App.densityFactor: 1.5
08-19 16:15:59.246: I/ALERT(22337): (KrollRuntimeThread) [1,8277] callback: function createPR(tableData, topView, alertView) {
08-19 16:15:59.246: I/ALERT(22337): if (tableData != 'Error') {
08-19 16:15:59.246: I/ALERT(22337): //cover.hide();
08-19 16:15:59.246: I/ALERT(22337): // alert('last'+topView);
08-19 16:15:59.246: I/ALERT(22337): require('/ui/android/prPendingScreen').prPendingWindow(prNotificationCount, tableData, topView, alertView, initService);
08-19 16:15:59.246: I/ALERT(22337): setTimeout(function() {
08-19 16:15:59.246: I/ALERT(22337): cover.hide();
08-19 16:15:59.246: I/ALERT(22337): Ti.API.info(' ### Hide cover.hide() newHome ');
08-19 16:15:59.246: I/ALERT(22337): }, 3000);
08-19 16:15:59.246: I/ALERT(22337): // openContainerWindow = require('ui/PRpendingscreen').prPendingTable(managerId, token, from, navGroup, prNotificationCount, prData);
08-19 16:15:59.246: I/ALERT(22337): } else {
08-19 16:15:59.246: I/ALERT(22337): cover.hide();
08-19 16:15:59.246: I/ALERT(22337): Ti.API.info(' ### Hide cover.hide() newHome else ');
08-19 16:15:59.246: I/ALERT(22337): }
08-19 16:15:59.246: I/ALERT(22337): }
08-19 16:15:59.324: D/Module(22337): Loading module: /ui/android/prPendingScreen -> Resources/ui/android/prPendingScreen.js
Distribution build:
08-19 16:23:40.270: I/ALERT(22796): (KrollRuntimeThread) [6513,6513] Ti.App.densityFactor: 1.5
08-19 16:23:40.270: I/ALERT(22796): (KrollRuntimeThread) [0,6513] callback: undefined
08-19 16:23:40.418: E/TiExceptionHandler(22796): (main) [150,6663] ----- Titanium Javascript Runtime Error -----
08-19 16:23:40.418: E/TiExceptionHandler(22796): (main) [0,6663] - In controller/PRpending.js:16,69
08-19 16:23:40.418: E/TiExceptionHandler(22796): (main) [0,6663] - Message: Uncaught TypeError: undefined is not a function
08-19 16:23:40.418: E/TiExceptionHandler(22796): (main) [0,6663] - Source: .info("Fire Event (PRrfiAnswer): "+c+d))}}});v.push(d)}h=="android"?u(v,s,i):u
08-19 16:23:40.418: E/V8Exception(22796): Exception occurred at controller/PRpending.js:16: Uncaught TypeError: undefined is not a function
Eduardo, can you provide a reproducible test case? I packaged a very simple test case which is attached below with 3.1.1.GA and the latest master, and installed it on Galaxy Nexus (4.1.1) using the command "adb install xxx.apk". The app works fine.
How are you installing the signed apk? I use 'adb install' on the packaged build and it works fine for me.
[Install instructions moved to description]
Closing