corona viewer problem on a specific file

hi, 

i found this sample game project and i make my game on this :

https://github.com/coronalabs/sample-game-project

i have discovered the corona viewer with dropbox and it’s very powerfull but the problem is i can’t use the corona viewer with this sample game project. I have this error :

/Users/jenkins/slaveroot/workspace/Templates/label/android/subrepos/widget/widgetLibrary/widget_button.lua:1180:bad argument #2 to ‘newSprite’ (ImageSheet expected, got nil)

i post an issue to the contributor about this…but if someone find the solution…it would be fun .

https://github.com/coronalabs/sample-game-project/issues/2

the builds settings that i use with corona viewer for this file :

`settings = { orientation = { default = "landscapeLeft", supported = { "landscapeRight", "landscapeLeft" } }, android = { usesPermissions = { "android.permission.INTERNET", "android.permission.ACCESS\_NETWORK\_STATE", "android.permission.WRITE\_EXTERNAL\_STORAGE", "com.android.vending.BILLING", "com.android.vending.CHECK\_LICENSE", }, googlePlayGamesAppId = "xxxxxxxxxxxx", --largeHeap = true }, plugins = { -- key is the name passed to Lua's 'require()' ["plugin.viewer"] = { -- required publisherId = "com.coronalabs", }, -- key is the name passed to Lua's 'require()' ["plugin.google.iap.v3"] = { -- required publisherId = "com.coronalabs", supportedPlatforms = { android = true }, }, -- key is the name passed to Lua's 'require()' ["CoronaProvider.native.popup.social"] = { -- required publisherId = "com.coronalabs", }, ["plugin.google.play.services"] = { publisherId = "com.coronalabs", supportedPlatforms = { android=true } }, -- Google play game services ["CoronaProvider.gameNetwork.google"] = { publisherId = "com.coronalabs", supportedPlatforms = { android=true }, }, ["CoronaProvider.gameNetwork.apple"] = { publisherId = "com.coronalabs", supportedPlatforms = { iphone=true, ["iphone-sim"]=true }, }, }, iphone = { plist = { CFBundleIconFiles = { "Icon-60.png", "Icon-60@2x.png", "Icon-60@3x.png", "Icon-76.png", "Icon-76@2x.png", "Icon-Small@3x.png", "Icon-Small-40.png", "Icon-Small-40@2x.png", "Icon-Small-40@3x.png", }, UILaunchImages = { { --iPhone 4 Portait ["UILaunchImageMinimumOSVersion"] = "7.0", ["UILaunchImageName"] = "Default", ["UILaunchImageOrientation"] = "Portrait", ["UILaunchImageSize"] = "{320, 480}" }, { --iPhone 4 LandscapeLeft ["UILaunchImageMinimumOSVersion"] = "7.0", ["UILaunchImageName"] = "Default", ["UILaunchImageOrientation"] = "LandscapeLeft", ["UILaunchImageSize"] = "{320, 480}" }, { --iPhone 4 LandscapeRight ["UILaunchImageMinimumOSVersion"] = "7.0", ["UILaunchImageName"] = "Default", ["UILaunchImageOrientation"] = "LandscapeRight", ["UILaunchImageSize"] = "{320, 480}" }, { --iPhone 5 Portait ["UILaunchImageMinimumOSVersion"] = "7.0", ["UILaunchImageName"] = "Default-568h", ["UILaunchImageOrientation"] = "Portrait", ["UILaunchImageSize"] = "{320, 568}" }, { --iPhone 5 LandscapeLeft ["UILaunchImageMinimumOSVersion"] = "7.0", ["UILaunchImageName"] = "Default-568h", ["UILaunchImageOrientation"] = "LandscapeLeft", ["UILaunchImageSize"] = "{320, 568}" }, { --iPhone 5 LandscapeRight ["UILaunchImageMinimumOSVersion"] = "7.0", ["UILaunchImageName"] = "Default-568h", ["UILaunchImageOrientation"] = "LandscapeRight", ["UILaunchImageSize"] = "{320, 568}" }, { -- iPad / iPad Retina ["UILaunchImageMinimumOSVersion"] = "7.0", ["UILaunchImageName"] = "Default-Portrait", ["UILaunchImageOrientation"] = "Portrait", ["UILaunchImageSize"] = "{768, 1024}" }, { -- iPad / iPad Retina ["UILaunchImageMinimumOSVersion"] = "7.0", ["UILaunchImageName"] = "Default-Landscape", ["UILaunchImageOrientation"] = "LandscapeLeft", ["UILaunchImageSize"] = "{768, 1024}" }, { -- iPad / iPad Retina ["UILaunchImageMinimumOSVersion"] = "7.0", ["UILaunchImageName"] = "Default-Landscape", ["UILaunchImageOrientation"] = "LandscapeRight", ["UILaunchImageSize"] = "{768, 1024}" }, { --iPhone 6 Portrait ["UILaunchImageMinimumOSVersion"] = "8.0", ["UILaunchImageName"] = "Default-667h", ["UILaunchImageOrientation"] = "Portrait", ["UILaunchImageSize"] = "{375, 667}" }, { --iPhone 6 LandscapeLeft ["UILaunchImageMinimumOSVersion"] = "8.0", ["UILaunchImageName"] = "Default-667h", ["UILaunchImageOrientation"] = "LandscapeLeft", ["UILaunchImageSize"] = "{375, 667}" }, { --iPhone 6 LandscapeRight ["UILaunchImageMinimumOSVersion"] = "8.0", ["UILaunchImageName"] = "Default-667h", ["UILaunchImageOrientation"] = "LandscapeRight", ["UILaunchImageSize"] = "{375, 667}" }, { -- iPhone 6 Plus Portrait ["UILaunchImageMinimumOSVersion"] = "8.0", ["UILaunchImageName"] = "Default-736h", ["UILaunchImageOrientation"] = "Portrait", ["UILaunchImageSize"] = "{414, 736}" }, { -- iPhone 6 Plus landscape left ["UILaunchImageMinimumOSVersion"] = "8.0", ["UILaunchImageName"] = "Default-Landscape-736h", ["UILaunchImageOrientation"] = "LandscapeLeft", ["UILaunchImageSize"] = "{414, 736}" }, { -- iPhone 6 Plus landscape right ["UILaunchImageMinimumOSVersion"] = "8.0", ["UILaunchImageName"] = "Default-Landscape-736h", ["UILaunchImageOrientation"] = "LandscapeRight", ["UILaunchImageSize"] = "{414, 736}" } }, UIApplicationExitsOnSuspend = false, -- must be false for single sign-on to work --[[FacebookAppID = "XXXXXXXXXXXXXXXX", -- replace XXXXXXXXX with your facebook appId CFBundleURLTypes = { { CFBundleURLSchemes = { "fbXXXXXXXXXXXXXX", -- replace XXXXXXXXX with your facebook appId } } }, --]] --[[UIAppFonts = { "immortal.ttf", "district.ttf", "carbontype.ttf", "Agency.ttf", "AgencyFB-Bold.ttf", }, --]] } }, excludeFiles = { iphone = { 'Icon-\*dpi.png', 'audio/\*.oog' }, android = { 'Icon.png', 'Icon-6\*.png', 'Icon-7\*.png', 'Icon-Small\*.png', 'Icon@2x.png', 'Default-568h@2x.png', 'audio/\*.m4a' } }, 

thanks if you could help me. 

Your build.settings are not likely the problem here.  Can you duplicate this in the simulator just with the straight up game project?

Rob

hi,

i have build and test this with the simulator and i have no problem. my version of corona simulator is the last 20162830.

the problem occurs only when i use the corona viewer. 

all my previous games works in the corona viewer except this.

no one ?

i  have tried with as simple file like this :

--main.lua local widget = require( "widget" ) -- Function to handle button events local function handleButtonEvent( event ) if ( "ended" == event.phase ) then print( "Button was pressed and released" ) end end -- Create the widget local button1 = widget.newButton( { left = 100, top = 200, id = "button1", label = "Default", onEvent = handleButtonEvent } )

it works in the simulator and it doesn’t work in the corona viewer. is it a problem with the widget library in the corona viewer ?

I took your code, made a slight modification where I could see the button presses:

--main.lua local widget = require( "widget" ) local message = display.newText("Hello World", display.contentCenterX, 40, native.systemFontBold, 30 ) message:setFillColor( 1 ) local red = false -- Function to handle button events local function handleButtonEvent( event ) if ( "ended" == event.phase ) then print( "Button was pressed and released" ) if red then message:setFillColor( 1, 0, 0 ) red = false else message:setFillColor( 1 ) red = true end end end -- Create the widget local button1 = widget.newButton( { left = 100, top = 200, id = "button1", label = "Default", onEvent = handleButtonEvent } )

I probably tapped the button 50-60 times as quickly as I could and I got no errors. Do you have your own copy of the widget library in your project?

hi Rob,

i have tested your snippet in the corona viewer and i have only the text Hello World who appears.

Do you have your own copy of the widget library in your project?

is it this ?

https://github.com/coronalabs/framework-widget/tree/master/widgetLibrary

how I should organize these files in my directory viewer corona ?

i simply copy the framework-widget in my corona viewer directory and  i don’t see the button.  

/root/Dropbox/Applications/CoronaViewer/framework-widget-master/ ...

/root/Dropbox/Applications/CoronaViewer/framework-widget-master/main.lua

thanks for your support

re-hi :slight_smile:

resolved

i must put all the files from /framework-widget-master in this directory and now the sample game project works 

/root/Dropbox/Applications/CoronaViewer/

thanks and have a nice day

Your build.settings are not likely the problem here.  Can you duplicate this in the simulator just with the straight up game project?

Rob

hi,

i have build and test this with the simulator and i have no problem. my version of corona simulator is the last 20162830.

the problem occurs only when i use the corona viewer. 

all my previous games works in the corona viewer except this.

no one ?

i  have tried with as simple file like this :

--main.lua local widget = require( "widget" ) -- Function to handle button events local function handleButtonEvent( event ) if ( "ended" == event.phase ) then print( "Button was pressed and released" ) end end -- Create the widget local button1 = widget.newButton( { left = 100, top = 200, id = "button1", label = "Default", onEvent = handleButtonEvent } )

it works in the simulator and it doesn’t work in the corona viewer. is it a problem with the widget library in the corona viewer ?

I took your code, made a slight modification where I could see the button presses:

--main.lua local widget = require( "widget" ) local message = display.newText("Hello World", display.contentCenterX, 40, native.systemFontBold, 30 ) message:setFillColor( 1 ) local red = false -- Function to handle button events local function handleButtonEvent( event ) if ( "ended" == event.phase ) then print( "Button was pressed and released" ) if red then message:setFillColor( 1, 0, 0 ) red = false else message:setFillColor( 1 ) red = true end end end -- Create the widget local button1 = widget.newButton( { left = 100, top = 200, id = "button1", label = "Default", onEvent = handleButtonEvent } )

I probably tapped the button 50-60 times as quickly as I could and I got no errors. Do you have your own copy of the widget library in your project?

hi Rob,

i have tested your snippet in the corona viewer and i have only the text Hello World who appears.

Do you have your own copy of the widget library in your project?

is it this ?

https://github.com/coronalabs/framework-widget/tree/master/widgetLibrary

how I should organize these files in my directory viewer corona ?

i simply copy the framework-widget in my corona viewer directory and  i don’t see the button.  

/root/Dropbox/Applications/CoronaViewer/framework-widget-master/ ...

/root/Dropbox/Applications/CoronaViewer/framework-widget-master/main.lua

thanks for your support

re-hi :slight_smile:

resolved

i must put all the files from /framework-widget-master in this directory and now the sample game project works 

/root/Dropbox/Applications/CoronaViewer/

thanks and have a nice day