Question about old hardware

I have a business app released, and I just did an update for it’s UI a couple of months ago. The Main menu consists of a tableView that goes off screen. In each row is a small icon display object and a newText, and when tapping on the row it takes you to the corresponding function scene.

I have a function that, when you first get to the menu scene, it moves the list a bit to show that it’s scrollable. And each row fades in and out based on if it’s visible on screen.

My problem, is that I have gotten 2 people (out of a couple hundred) saying that the tableView (menu) just doesn’t show up when they open the app. All they see is the white background and the logo and the facebook icon. One is using an iPhone 4 and one is using an iPhone 3 (OS 6.1.3). I have tested the app on both my iPhone 5 and my iPhone 4 and it works fine, and i’ve had no other customer complaints. Testing with debugging shows nothing either.

I’m not even sure how to troubleshoot this. So I was hoping by posting here someone might know of an issue with the tableView (I’m guessing its a problem with the tableView) and iOS?

Screenshot of menu:

Dj62KTY.png

Code:

local function moveItems() menuList:scrollToIndex( 3, 1300, scrollComplete ) end scrollComplete = function() menuList:scrollToIndex( 1, 500 ) end local function onRowTouch( event ) local phase = event.phase local row = event.target.index if "press" == phase then elseif "release" == phase then going.num = row print(row) sceneSelect() end end local function onRowRender( event ) -- Get reference to the row group local row = event.row local buttons = event.row.params.buttons local labels = event.row.params.labels local icon, label -- Cache the row "contentWidth" and "contentHeight" because the row bounds can change as children objects are added local rowHeight = row.contentHeight local rowWidth = row.contentWidth icon = display.newImageRect(row, buttons[row.index], 56, 56) icon.anchorX = 0 icon.x = 0 icon.y = rowHeight \* 0.5 icon.alpha = 0 transition.to(icon, {alpha = 0.75, time = 500}) label = display.newText( { parent = row, text = labels[row.index], 0, 0, font = "BerlinSansFB-Reg", fontSize = 20, width = 100}) label.anchorX = 0 label.x = icon.x + icon.contentWidth + 10 label.y = rowHeight \* 0.5 label:setFillColor(0.15, 0.4, 0.729, 0.90) label.alpha = 0 transition.to(label, {alpha = 1, time = 500}) return true end function scene:create( event ) local sceneGroup = self.view myData.inch = false timesOpen2 = loadsave.loadTable("timesOpen2.json") if timesOpen2.opened == 5 then native.showAlert ( "Find this App useful?", "Leave a review and help others find it!", { "Never", "Later", "OK" }, alertListener ) end print("Times Opened "..timesOpen2.opened) going = {} going.num = 1 back = display.newRect( sceneGroup, display.contentCenterX, display.contentCenterY, display.contentWidth, display.contentHeight ) backEdgeX = back.contentBounds.xMin backEdgeY = back.contentBounds.yMin Runtime:addEventListener( "key", onKeyEvent ) logo = display.newImageRect(sceneGroup, "Images/title.png", 175, 100) logo.x = backEdgeX + 10 logo.anchorX = 0 logo.anchorY = 0.5 logo.y = logo.contentHeight / 2 + 40 topBar = display.newRect( sceneGroup, 0, 0, display.contentWidth, 30 ) topBar:setFillColor(0.15, 0.4, 0.729, 0.75) topBar.anchorX = 0 topBar.anchorY = 0 facebookButt = display.newImageRect(sceneGroup, "Images/facebook.png", 42, 42) facebookButt.anchorX = 0 facebookButt.anchorY = 0.5 facebookButt.x = logo.x facebookButt.y = logo.y \* 2 facebookButt:addEventListener ( "touch", goingFacebook ) butTable = {} labelTable = {} butTable[1] = "Images/rightMenu.png" butTable[2] = "Images/obliqueMenu.png" butTable[3] = "Images/sineMenu.png" butTable[4] = "Images/boltMenu.png" butTable[5] = "Images/speedMenu.png" butTable[6] = "Images/counterButt.png" butTable[7] = "Images/chartMenu.png" butTable[8] = "Images/mattButt.png" labelTable[1] = "Right Angle" labelTable[2] = "Oblique Triangle" labelTable[3] = "Sine Bar" labelTable[4] = "Bolt Circle" labelTable[5] = "Speeds & Feeds" labelTable[6] = "C'Sink & Drill Point" labelTable[7] = "Drill Charts" labelTable[8] = "Materials List" menuList = widget.newTableView{ left = logo.x + logo.contentWidth + 10, top = topBar.contentHeight, width = display.contentWidth - (logo.x + logo.contentWidth + 10) - 10, height = display.contentHeight - topBar.contentHeight, onRowTouch = onRowTouch, onRowRender = onRowRender, hideScrollBar = false, noLines = true, } sceneGroup:insert(menuList) for i = 1, #butTable, 1 do local isCategory = false local rowHeight = 65 local rowColor = { default={ 1, 1, 1 }, over={ 0.15, 0.4, 0.729, 0.2 } } local lineColor = { 0.15, 0.4, 0.729 } menuList:insertRow( { isCategory = isCategory, rowHeight = rowHeight, rowColor = rowColor, lineColor = lineColor, params = { buttons = butTable, labels = labelTable } } ) end if not composer.getSceneName( "previous" ) then timer.performWithDelay(500, moveItems) end end

I’m guessing that your devices are all on iOS7 so that’s why you don’t get any problems, but the users experiencing errors are using iOS6. There is some mismatch while trying to find the theme for the iOS6 widgets.

Try adding this to the start of your main.lua file:

local widget = require("widget") local version = system.getInfo( "platformVersion" ) if ( string.match( version, "7.\*" ) ) then -- use iOS 7 theme widget.setTheme( "widget\_theme\_ios7" ) else -- default iOS theme widget.setTheme( "widget\_theme\_ios" ) end

Hi @spowell83,

As @corona1634 suggests, are the devices where it’s failing iOS 6.x, but it’s working on devices with 7.x? 

Thanks,

Brent

I believe this might be the case. The problem is that I do not have any devices that are currently running iOS 6.1.3 and Apple, in all its glory, have decided that you are no longer allowed to downgrade your phones to earlier iOS versions.

I don’t suppose there is a way to test the theme fix without having an actual device on 6.1.3?

Hi @spowell83,

Do you actually set the widget theme anywhere in your code? I have an older iPod Touch 4th-gen which I intentionally did not upgrade to iOS7, and in recent tests of our “WidgetDemo”, the tableView worked fine. I can test it again if necessary… let me know if you’re manually setting themes, or letting it auto-detect.

Brent

Hi Brent, I’m not manually setting any themes.

Hmmm… I recall in my recent tests that setting the theme to iOS7 worked fine on the older 6.x device. Oddly though, tableViews aren’t really “themed” anyway, they merely use whatever settings you define in the constructor and the objects you insert into the rows.

Yeah, i’m at a complete loss as to what might be the issue. My tableView isn’t even that complicated in the making. It just contains a very simple display object and text object and that’s it. Of course it doesn’t help that I can’t re-create the issue myself.

I’m trying to get in contact with one of the users with the problem to see if they are running 6.1.3 on their iPhone 4. If they are then it might narrow it down to definitely being an issue with the version.

So it looks like he was running 6.1.3 as well. Any ideas of what could be the issue?

How many rows are you inserting into the tableView? Have you checked how much memory your app is using? Are you using a large image sheet?

8 rows. I’m not using an image sheet for the display images in each row because they are extremely small (The 4x version of each icon is only 224px x 224px and 4kb in size). If you meant an image sheet for the tableView widget, i’m not using one, i’m using the default widget.

What is your width and height in the config.lua file?

This is the part of the config that is for Apple:

if string.sub(system.getInfo("model"),1,4) == "iPad" then application = { content = { width = 360, height = 480, scale = "letterbox", xAlign = "center", yAlign = "center", imageSuffix = { ["@2x"] = 1.5, ["@4x"] = 3.0, }, }, SpriteHelperSettings = { imagesSubfolder = "Images", }, notification = { iphone = { types = { "badge", "sound", "alert" } } } } elseif string.sub(system.getInfo("model"),1,2) == "iP" and display.pixelHeight \> 960 then application = { content = { width = 320, height = 568, scale = "letterbox", xAlign = "center", yAlign = "center", imageSuffix = { ["@2x"] = 1.5, ["@4x"] = 3.0, }, }, SpriteHelperSettings = { imagesSubfolder = "Images", }, notification = { iphone = { types = { "badge", "sound", "alert" } } } } elseif string.sub(system.getInfo("model"),1,2) == "iP" then application = { content = { width = 320, height = 480, scale = "letterbox", xAlign = "center", yAlign = "center", imageSuffix = { ["@2x"] = 1.5, ["@4x"] = 3.0, }, }, SpriteHelperSettings = { imagesSubfolder = "Images", }, notification = { iphone = { types = { "badge", "sound", "alert" } } } }

Are your images loaded based on that “SpriteHelperSettings” folder or something? Or is that totally independent and would have no chance whatsoever of affecting this tableView?

Do you not have any “else” condition for your config? I see you do some basic device detection, but what is the “fallback” case?

Brent

Hi Brent, the Spritehelper module is only used inside apps calculator scenes (the scenes the menu options take you to). It’s not used on the menu scene, as you can see there is no reference to it at all in my menu.lua code.

And yes, I have an else condition for the config. It shouldn’t be called for an Apple device so I didn’t include it above, but here is the rest of my config, continuing from what I posted above:

elseif display.pixelHeight / display.pixelWidth \> 1.72 then application = { content = { width = 320, height = 570, scale = "letterbox", xAlign = "center", yAlign = "center", imageSuffix = { ["@2x"] = 1.5, ["@4x"] = 3.0, }, }, SpriteHelperSettings = { imagesSubfolder = "Images", }, license = { google = { key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAozSHdJRUEujwAGWx7ucEF0ajfEVbIxF66j2nv1SU5UeRm17FReg2uKZ4YVYn7vrIQwEZmdZWvfjJ/YoUpK8R7Q6AyS0gb/AlwL5871UsqrCpiQhL0wkfpkvd9swkGTlvhqNSPYYwnlZiuTx+v8JWf+wpQ9h7PSAoFVzvkUH54sG1VYa8ZkdQegHm0lynYALM3Xg3Ko/Bhu2ZJ7wYPHvEPKubF0gHahwBppJmfLyx0WBzU4PCdb53H2lT7xQO2FCacfLNc2jl1r3f4NBQQ1Kege4ndsBhPnwTYInrkz6k7FqR5hQxVKIxL5G46n5+hY2a2YNJACvxf59JtaUAYbfekQIDAQAB", policy = "serverManaged", }, }, } else application = { content = { width = 320, height = 512, scale = "letterbox", xAlign = "center", yAlign = "center", imageSuffix = { ["@2x"] = 1.5, ["@4x"] = 3.0, }, }, SpriteHelperSettings = { imagesSubfolder = "Images", }, notification = { iphone = { types = { "badge", "sound", "alert" } } }, license = { google = { key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAozSHdJRUEujwAGWx7ucEF0ajfEVbIxF66j2nv1SU5UeRm17FReg2uKZ4YVYn7vrIQwEZmdZWvfjJ/YoUpK8R7Q6AyS0gb/AlwL5871UsqrCpiQhL0wkfpkvd9swkGTlvhqNSPYYwnlZiuTx+v8JWf+wpQ9h7PSAoFVzvkUH54sG1VYa8ZkdQegHm0lynYALM3Xg3Ko/Bhu2ZJ7wYPHvEPKubF0gHahwBppJmfLyx0WBzU4PCdb53H2lT7xQO2FCacfLNc2jl1r3f4NBQQ1Kege4ndsBhPnwTYInrkz6k7FqR5hQxVKIxL5G46n5+hY2a2YNJACvxf59JtaUAYbfekQIDAQAB", policy = "serverManaged", }, }, } end

Do you know what devices these are failing on.  The OS isn’t the only thing that would factor in.  An iPhone 3s can run iOS 6.3.1 but might not have enough memory to run your app (as an example).  We need to know more about the environment that it’s failing.

Once you know that, you can put out a forum request to see if any developers have the same hardware/OS setup or go onto the Corona BETA testers group on Facebook (https://www.facebook.com/groups/102481146589254/) and see if any one there has a match up for you.  You could then add their devices to your Provisioning Portal, create a new provisioning profile including those devices and use something like TestFlight to get them a build they could test.  

What you describe is likely an error happening when you either create the tableView or when you try to insert the records into it.  In Lua when there is a run time error, it stops the rest of that chunk from executing, which is probably why you’re not getting anything after the Facebook button.   However, without attaching a failing device to a Mac and using Xcode to peek into it’s logs its going to be hard to know.   Actually there may be an option for you.

It’s possible to capture Corona’s run time errors.  You could use an analytics service like Flurry to report it too.  Or look at this thread:

http://forums.coronalabs.com/topic/50004-corona-advanced-logging/

It’s a debugging module that will capture messages that normally shows in the device’s console log and directs them somewhere that you can use them.  I’ve not tried this.  I have no idea how it works (and it’s not officially supported. ) but it might get you the intelligence you need to solve this.

Rob

On a complete side note (and not the cause of this issue)… you pass in the two tables as parameters for each insert.  It probably would be better code wise to pass in the actual image and such, perhaps something like:

for i = 1, #butTable, 1 do     local isCategory = false     local rowHeight = 65     local rowColor = { default={ 1, 1, 1 }, over={ 0.15, 0.4, 0.729, 0.2 } }     local lineColor = { 0.15, 0.4, 0.729 }     menuList:insertRow(     {         isCategory = isCategory,         rowHeight = rowHeight,         rowColor = rowColor,         lineColor = lineColor,         params = { button = butTable[i], label = labelTable[i] }     } ) end

then in your onRowRender() function you don’t have to look up the items in the table there.  This is just semantics but each insert inserts one row, that row should have the values for that row be the parameters.  If you just want to use the row’s index to look up the values, you don’t need to pass the values in via parameters at all.  Just define the table values at the top of the scene.

Rob

Hi Rob, thanks for that. I’ll have to look at my code again and see what I can do. I actually use a variation of this code in a ‘light’ version of my app where you can buy each menu item as an IAP, so the values of the table get shifted around based on what has been bought.

I think I’m going to just bite the bullet and find myself a iPhone 3GS to test on. I’ve only had 2 people contact me with this exact problem, 1 had a iPhone 3GS and the other had a iPhone 4. Both had iOS 6.1.x I believe.

One other thing, one of those people just told me the app actually worked for quite a while, then her iPhone 3GS had a software update and it was after that she started having it freeze. I’m trying to get more specifics as to what upgrades worked. But it looks like the version update from 6.1.5 to 6.1.6 might be the issue?

I’ll update my post once I can test my app on that iOS version with debugging.

The 3Gs is the lowest memory device out there.  If it ran for a while, perhaps you have a memory leak or peak memory usage that doesn’t show up except on older, low memory devices. 

Rob

So I was able to get my hands on a iPhone3GS with 6.1.6 and run my app with the console open in xCode. And sure enough there is a runtime error that doesn’t appear when I run my app on iOS 7

Aug 22 11:10:46 Steves-iPhone Machinist’sCalculator[352] <Warning>: Runtime error

?:0: attempt to index field ‘colours’ (a nil value)

stack traceback:

?: in function <?:1667>

(tail call): ?

?: in function <?:122>

(tail call): ?

/Users/Steve/Desktop/Machinist_Calculator/menu.lua:230: in function </Users/Steve/Desktop/Machinist_Calculator/menu.lua:169>

?: in function ‘dispatchEvent’

?: in function ‘gotoScene’

/Users/Steve/Desktop/Machinist_Calculator/main.lua:75: in main chunk

Aug 22 11:10:46 Steves-iPhone Machinist’sCalculator[352] <Warning>: AppDelegate.mm: didFailToRegisterForRemoteNotificationsWithError: no valid ‘aps-environment’ entitlement string found for application

The problem is I don’t have “Colours” anywhere in my code?