Runtime error ?:0: attempt to index global 'network' (a nil value)

Hi there,

I am not sue if it’s necessarily a newbie issue, but I am a newbie so I thought I would start here to see if it’s a simple issue I am dealing with.

I am completely new to Corona SDK and decided to buy a source code to work with. I tend to learn better by starting with a modification process rather than attempting to start from scratch. The developer has been incredibly helpful, but he was unable to resolve my last issue. I will give a bit of background first to see if it helps.

The source code was pretty much ready to upload - I simply had to make a few changes to insert proper ID’s for ad’s and the Playstore. I downloaded Corona SDK 2014.2511 and after a bit of trial and error managed to get it working (for the most part) and was running alpha testing on Google Play Store. I was getting no errors at all. However, the one final issue I had was in app purchases. I noticed when I tried to purchase coins within the game it did nothing - no errors; it simply did nothing and displayed no messages.

When I contacted the developer about the issue they had me send over my exisiting code and they tested it. They made a few minor changes and stated it worked fine for them now. They were testing on Mac and Apple devices. Meanwhile, I was testing it on a PC and android device (Samsung Note 4). When they sent the code back it still didn’t work for me. 

We did a bit of troubleshooting and they asked what version of Corona SDK I was running. When I confirmed it was 2014.2511 they said it was a very old version and that I should download the daily builds regularly. That is when it all fell apart for me! I installed the most recent daily build and suddenly my app wouldn’t work at all and I was getting this error:

Runtime error

?:0: attempt to index global ‘network’ (a nil value)

stack traceback:

        ?: in function ‘downloadManifest’

        ?: in function ‘downloadQueuedManifests’

        ?: in function ‘?’

        ?: in function <?:718>

        (tail call): ?

        ?: in function <?:498>

        ?: in function <?:221>

They had me comment out the following codes one at time to see if the error would go away or any other errors would appear:

storyboard.gotoScene(“menuScene”, “fade”);

adsLib.init(activeAdsProviders);

networksLib.init(activeNetworksProviders);

I did as suggested and nothing changed. No new errors and it did not resolve the existing issue.

I am also noticing that when I open Corona Simulator it looks like it’s trying to load or connect and just sits at the halfway point. This is before I even open a project - it’s just on the main screen, so I am wondering if that may be part of the problem. I’ve attached a little screenshot of what I am referring to.

Has anyone else had a similar issue or could you possibly offer some advice on how to resolve this?

Any help would be greatly appreciated.

Thanks,

Kim

First of all 2014.2511 isn’t that old.  It’s our last public/stable release and with the exception of some requirements by Apple, which requires a newer version.  You probably could back to 2511 if you wanted to.

There could be several reasons why you’re getting that error.  I don’t recognize the functions downloadManifest and downloadQueuedManifests.  But something is overwriting the “network” library.  We don’t know anything about your program.  You could be using some plugins that have changed or are no longer available. 

I would suggest that you read this guide.  There may be more information that can help you debug this:

http://docs.coronalabs.com/guide/basics/debugging/index.html

Jumping in to a complete project that uses IAP and Ads that requires a bunch of server setup gives you too many factors when trying to learn.

Rob

I am also noticing that when I open Corona Simulator it looks like it’s trying to load or connect and just sits at the halfway point. This is before I even open a project - it’s just on the main screen, so I am wondering if that may be part of the problem. I’ve attached a little screenshot of what I am referring to.

This usually happens if you are behind a proxy server, in which case the simulator tries to connect when launched but then let’s you to run the code eventually. However, when this happens, none of the plugins would have loaded. 

Is this happening every time? Could you please confirm that your laptop internet is directly connected to the internet or are you via a proxy server?

Thanks for the response, Rob. The source code was supposed to be “ready to publish”, so I didn’t anticipate running into so many issues. Lesson learned the hard way :slight_smile:

I am still slowly running through it trying to figure out what (if any) plugin is causing the issue.

 

 

This usually happens if you are behind a proxy server, in which case the simulator tries to connect when launched but then let’s you to run the code eventually. However, when this happens, none of the plugins would have loaded. 

 

Is this happening every time? Could you please confirm that your laptop internet is directly connected to the internet or are you via a proxy server?

Hmm…it’s definitely connected directly to the internet, not a proxy server. It happen every time though. As I mentioned to Rob, I am trying to go through and figure out which plugin could potentially be causing an issue.

I appreciate your help in trying to figure this out. It’s been a bit frustrating, but I’m not ready to throw in the towel just yet! :slight_smile:

First of all 2014.2511 isn’t that old.  It’s our last public/stable release and with the exception of some requirements by Apple, which requires a newer version.  You probably could back to 2511 if you wanted to.

There could be several reasons why you’re getting that error.  I don’t recognize the functions downloadManifest and downloadQueuedManifests.  But something is overwriting the “network” library.  We don’t know anything about your program.  You could be using some plugins that have changed or are no longer available. 

I would suggest that you read this guide.  There may be more information that can help you debug this:

http://docs.coronalabs.com/guide/basics/debugging/index.html

Jumping in to a complete project that uses IAP and Ads that requires a bunch of server setup gives you too many factors when trying to learn.

Rob

I am also noticing that when I open Corona Simulator it looks like it’s trying to load or connect and just sits at the halfway point. This is before I even open a project - it’s just on the main screen, so I am wondering if that may be part of the problem. I’ve attached a little screenshot of what I am referring to.

This usually happens if you are behind a proxy server, in which case the simulator tries to connect when launched but then let’s you to run the code eventually. However, when this happens, none of the plugins would have loaded. 

Is this happening every time? Could you please confirm that your laptop internet is directly connected to the internet or are you via a proxy server?

Thanks for the response, Rob. The source code was supposed to be “ready to publish”, so I didn’t anticipate running into so many issues. Lesson learned the hard way :slight_smile:

I am still slowly running through it trying to figure out what (if any) plugin is causing the issue.

 

 

This usually happens if you are behind a proxy server, in which case the simulator tries to connect when launched but then let’s you to run the code eventually. However, when this happens, none of the plugins would have loaded. 

 

Is this happening every time? Could you please confirm that your laptop internet is directly connected to the internet or are you via a proxy server?

Hmm…it’s definitely connected directly to the internet, not a proxy server. It happen every time though. As I mentioned to Rob, I am trying to go through and figure out which plugin could potentially be causing an issue.

I appreciate your help in trying to figure this out. It’s been a bit frustrating, but I’m not ready to throw in the towel just yet! :slight_smile:

I don’t know if this is an old issue but I am having this same error in the windows simulator if I have the lines in build.settings to add the  plugin.google.play.services , which I have for admob.

When I am developing in my mac I get no error in the mac simulator and I can run in simulator with no problems, also if I build for device app and admob runs fine in the device.

--[[--Comment out to run in Windows simulator plugins = { ["plugin.google.play.services"] = { publisherId = "com.coronalabs", supportedPlatforms = { iphone=true, android=true } }, }, ]]--

Is there any way to add conditional statements in the build.setting to not run that plugin if running in the windows simulator?

Well, it looks like it has something to do with the windows installation of the SDK. I uninstalled both versions I had installed in my laptop and reinstalled the latest daily build and now runs with no problem.  :huh:

I don’t know if this is an old issue but I am having this same error in the windows simulator if I have the lines in build.settings to add the  plugin.google.play.services , which I have for admob.

When I am developing in my mac I get no error in the mac simulator and I can run in simulator with no problems, also if I build for device app and admob runs fine in the device.

--[[--Comment out to run in Windows simulator plugins = { ["plugin.google.play.services"] = { publisherId = "com.coronalabs", supportedPlatforms = { iphone=true, android=true } }, }, ]]--

Is there any way to add conditional statements in the build.setting to not run that plugin if running in the windows simulator?

Well, it looks like it has something to do with the windows installation of the SDK. I uninstalled both versions I had installed in my laptop and reinstalled the latest daily build and now runs with no problem.  :huh: