"composer.showOverlay" working on Corona simulator but not on android device

Hello,

I have very strange issue and I need your help.
 
In Corona simulator when I click “Koupit” button the “coinShopScene” appears. Screenshot is here:
http://i.imgur.com/1VQK5kG.jpg

And when I click on this button on any Android device (Samsung S6, HTC M9) nothing happens.
 

 function searchLetterButton:touchBegan() searchLetterButton:setFillColor(.7, .7, .7); end function searchLetterButton:touchEnded() searchLetterButton:setFillColor(1, 1, 1); local listener = function(event) if event.index == 1 then local currentCoins = ragdogLib.getSaveValue("currentCoins") or 0; if currentCoins \>= \_G.costOfHintLetters then local currentRevealedLetters = ragdogLib.getSaveValue(currentLevel.id.."revealedLetters") or 0; currentRevealedLetters = currentRevealedLetters+1; ragdogLib.setSaveValue(currentLevel.id.."revealedLetters", currentRevealedLetters); currentCoins = currentCoins-\_G.costOfHintLetters; ragdogLib.setSaveValue("currentCoins", currentCoins, true); emptySpacesTab:revealLetter(); else local subListener = function(event) if event.index == 1 then composer.showOverlay("coinShopScene"); end end if not \_G.allowCoinPurchaseThroughIAP then native.showAlert("Nákup", "Nemáte dostatek mincí.", {"Ok"}); else native.showAlert("Nákup", "Nemáte dostatek mincí.", {"Koupit", "Ok"}, subListener); end end end

I have no idea what could be wrong. Thank you!

Hi @hrubyadam,

In these cases, the issue is usually a case-sensitive mismatch. Is the actual file (for the scene) named “coinShopScene.lua” in that specific case? Please check that you have matched the name of the file and the name in your code exactly, with lowercase and uppercase matches across the entire name.

Best regards,

Brent

Thank you for reply. The file in main folder is exactly “coinShopScene.lua”. I think the problem is in 

if event.index == 1 then ##### end

because everything inside this condition works on Corona simulator and not works in Android device.

Hi again,

I see two instances of that condition in your code. Which one are you referring to?

Brent

I mean when there is something different in the condition it still does not work as it should on Android, for example:

                if event.index == 1 then                                 native.showAlert("test", "test", {"Ok"});                         end

The “test” alert is working in Corona simulator but not on real android device. The same code works different and I dont know why.

Did you follow the example for native.showAlert() here?

https://docs.coronalabs.com/api/library/native/showAlert.html

Hi @hrubyadam,

In these cases, the issue is usually a case-sensitive mismatch. Is the actual file (for the scene) named “coinShopScene.lua” in that specific case? Please check that you have matched the name of the file and the name in your code exactly, with lowercase and uppercase matches across the entire name.

Best regards,

Brent

Thank you for reply. The file in main folder is exactly “coinShopScene.lua”. I think the problem is in 

if event.index == 1 then ##### end

because everything inside this condition works on Corona simulator and not works in Android device.

Hi again,

I see two instances of that condition in your code. Which one are you referring to?

Brent

I mean when there is something different in the condition it still does not work as it should on Android, for example:

                if event.index == 1 then                                 native.showAlert("test", "test", {"Ok"});                         end

The “test” alert is working in Corona simulator but not on real android device. The same code works different and I dont know why.

Did you follow the example for native.showAlert() here?

https://docs.coronalabs.com/api/library/native/showAlert.html