Unable to set landscape mode

Hey y’all. I have the following in my build.settings:

orientation = { -- Supported values for orientation: -- portrait, portraitUpsideDown, landscapeLeft, landscapeRight default = "landscapeRight", supported = { "landscapeRight", "landscapeLeft"}, },

but for some reason, my app always loads in portrait and wont let me switch to landscape. It didn’t do this before I enabled the bit plugin, which makes me think it had something to with this. When I remove the bit plugin, it works just fine. I am using the dusk tiled engine, so I need bit enabled. Any help is appreciated. Thanks!

UPDATE: After playing around with the build.settings file some more, I found something interesting. The end of the plugin code has little greyed out underscores before it starts because I copied/pasted the code for the bit plugin from the docs. The underscores seem to represent spaces. When I remove said underscores, the app launches in landscape like it should, but the bit plugin no longer works.

Can you post your whole build.settings file?

-- -- For more information on build.settings, see the Project Build Settings guide at: -- https://docs.coronalabs.com/guide/distribution/buildSettings -- --     --the blank spaces commented out above cause the difference between the simulator being in portrait mode and dusk working, and the simulator being in landscape and not working settings = { orientation = { -- Supported values for orientation: -- portrait, portraitUpsideDown, landscapeLeft, landscapeRight default = "landscapeRight", supported = { "landscapeRight", }, }, -- -- Android section -- android = { usesPermissions = { "android.permission.INTERNET", }, }, -- -- iOS section -- iphone = { plist = { UIStatusBarHidden = false, UILaunchStoryboardName = "LaunchScreen", CFBundleIconFiles = { "Icon-40.png", "Icon-58.png", "Icon-76.png", "Icon-80.png", "Icon-87.png", "Icon-120.png", "Icon-152.png", "Icon-167.png", "Icon-180.png", }, }, }, -- -- Plugins section -- plugins = { ["plugin.bit"] = { publisherId = "com.coronalabs" }, }, -- -- Project section -- excludeFiles = { -- Exclude unnecessary files for each platform ios = { "Icon.png", "Icon-\*dpi.png", }, android = { "Icon.png", "Icon-??.png", "Icon-???.png", "LaunchScreen.storyboardc", }, }, }

I found out that the placement of the underscores/spaces makes no difference as long as they are in the file somewhere.

I’ve just copied the build.settings code that you’ve pasted here into a project, the simulator opens in landscape and the bit plugin works.

Are you using an up to date version of Corona?

What are you using as an editor?

Sometimes an editor will show tabs as a thin long dash and indentions using spaces with thin, light dots. If that’s the case, it’s likely not the problem.  If you have underscores or periods where it’s not expected, that would be a problem, but there should be errors showing up in your console log about it.

I don’t see anything in the build.settings you posted that would cause orientation issues. Now if there is a syntax error in your build.settings it could cause us to not see the orientation sub-table in which case it would default to portrait.

Rob

@Alan QuizTix Sorry if I was a little unclear, the blank comment near the top controlled the problem. I had a problem with orientation when it was not commented out and with bit when it was. Yes, I am using an up to date version of corona.

@Rob Miracle I am using Kate text editor. 

Now if there is a syntax error in your build.settings it could cause us to not see the orientation sub-table in which case it would default to portrait.

I can’t look into that right now, but that seems likely. I will check when I get a chance and get back to you. Does the build.settings file use regular Lua syntax? I have a attached an image of the “underscores.” 

Y’all have been really helpful, thanks.

build.settings is nothing more than a Lua table, so it has to abide by the same rules as any other Lua table. I don’t see the attached file.

Rob

Sorry, I hit the wrong button the first time around. The image should be there now. Thanks.

The – looks like two dashes which is a Lua comment that disables the rest of the line. A misplaced one of those  on a line with either curly brace { or } would potentially cause errors. The screen shot is a little on the small side but a rogue period would also cause problems.

Rob

Sorry for the vagueness, I was referring to the four little symbols following the comment on line 6. Those are the things that cause portrait mode when uncommented. Right now, since they are commented out, the bit plugin does not work properly. When I tried to load a map with the Dusk engine without the plugin at all, I got a warning that the plugin was not enabled. Then I copied and pasted the code from the docs to enable the plugin (that was where the weird blanks came from). At that point, the map loaded, but in portrait mode. When I removed the weird blanks, landscape mode worked again, but dusk did not. I am sorry that I was not clear about this from the beginning. Thanks for your patience.

Well, I have reached a point where I am having a completely different problem now, but I have already started another thread for that. I am still curious as to what caused the problem, but I will have to look into that later. Thanks for your help and I apologize if I wasted your time. Should I mark this thread as answered? If so, how?

Just remove the odd characters in build.settings. Comment out what needs commented out, uncomment code you need. And lets go from there.

If you want to mark this solved, click on the “Marked Solved” button on the answer you want to mark as the answer. It’s in the row with “Quote”, “Multi-Quote” and “Share”.

Rob

Can you post your whole build.settings file?

-- -- For more information on build.settings, see the Project Build Settings guide at: -- https://docs.coronalabs.com/guide/distribution/buildSettings -- --     --the blank spaces commented out above cause the difference between the simulator being in portrait mode and dusk working, and the simulator being in landscape and not working settings = { orientation = { -- Supported values for orientation: -- portrait, portraitUpsideDown, landscapeLeft, landscapeRight default = "landscapeRight", supported = { "landscapeRight", }, }, -- -- Android section -- android = { usesPermissions = { "android.permission.INTERNET", }, }, -- -- iOS section -- iphone = { plist = { UIStatusBarHidden = false, UILaunchStoryboardName = "LaunchScreen", CFBundleIconFiles = { "Icon-40.png", "Icon-58.png", "Icon-76.png", "Icon-80.png", "Icon-87.png", "Icon-120.png", "Icon-152.png", "Icon-167.png", "Icon-180.png", }, }, }, -- -- Plugins section -- plugins = { ["plugin.bit"] = { publisherId = "com.coronalabs" }, }, -- -- Project section -- excludeFiles = { -- Exclude unnecessary files for each platform ios = { "Icon.png", "Icon-\*dpi.png", }, android = { "Icon.png", "Icon-??.png", "Icon-???.png", "LaunchScreen.storyboardc", }, }, }

I found out that the placement of the underscores/spaces makes no difference as long as they are in the file somewhere.

I’ve just copied the build.settings code that you’ve pasted here into a project, the simulator opens in landscape and the bit plugin works.

Are you using an up to date version of Corona?

What are you using as an editor?

Sometimes an editor will show tabs as a thin long dash and indentions using spaces with thin, light dots. If that’s the case, it’s likely not the problem.  If you have underscores or periods where it’s not expected, that would be a problem, but there should be errors showing up in your console log about it.

I don’t see anything in the build.settings you posted that would cause orientation issues. Now if there is a syntax error in your build.settings it could cause us to not see the orientation sub-table in which case it would default to portrait.

Rob

@Alan QuizTix Sorry if I was a little unclear, the blank comment near the top controlled the problem. I had a problem with orientation when it was not commented out and with bit when it was. Yes, I am using an up to date version of corona.

@Rob Miracle I am using Kate text editor. 

Now if there is a syntax error in your build.settings it could cause us to not see the orientation sub-table in which case it would default to portrait.

I can’t look into that right now, but that seems likely. I will check when I get a chance and get back to you. Does the build.settings file use regular Lua syntax? I have a attached an image of the “underscores.” 

Y’all have been really helpful, thanks.

build.settings is nothing more than a Lua table, so it has to abide by the same rules as any other Lua table. I don’t see the attached file.

Rob

Sorry, I hit the wrong button the first time around. The image should be there now. Thanks.

The – looks like two dashes which is a Lua comment that disables the rest of the line. A misplaced one of those  on a line with either curly brace { or } would potentially cause errors. The screen shot is a little on the small side but a rogue period would also cause problems.

Rob