"(null)" error on Building for iOS when using Zip plugin

Right before I left on vacation, I tried building my app for iOS and kept getting a “(null)” error (really!?) during the build process.

After spending hours trying to nail down what was causing the error, I tracked it down to including this code in the build.settings file:

 plugins = { ["plugin.zip"] = { publisherId = "com.coronalabs" } },

If this code is in the build.settings file, the app will not build.  Remove this, and the app builds fine (though the Zip functionality does not work).

I tried playing with all different uses of the commas after closing brackets to see if it was a code structure error, but it isn’t.

Seems incredibly odd that this was not tested, so not sure what the problem could be.  I know of at least one other person having the problem, so wondering if anyone else has had it and if they were able to fix it.

In his post in the Newbie forum, the other person who experienced this back in July (no responses to his post at all) indicated it only happened when Building for iOS.  Android built fine.  I cannot say the same thing yet as I do not build for Android on my Mac and I need to finish setting up my new Windows machine with everything to build this app on there.

Also. I have experienced this on several builds of the Corona SDK, including the current release build, the last public release build, and a couple of daily builds.

Is the above code within the settings table in build.settings?

Yes.

Are there any other errors in your console log?

What version of Corona SDK are you trying to use?

Where is the console log when building?

I get no errors when running the game in the Corona Simulator.  The game runs perfectly there.

As for the builds, as I said, I downloaded and used the current public release (2013.1202).  When I ran into this a month ago, I tested some other builds thinking it was a daily build issue, but it also occurred with the then-current public release and with build 1137, which I built my other app - which doesn’t use the Zip plugin - successfully.

I also went back and ran a test where I removed all of my require() statements from the main.lua, moved all of my supporting .lua files out of the project folder, and commented out all of the code in the main.lua file, leaving in only the code to display the opening logos and go to main menu, which the function was present, though empty.  There were also some variables defined.

Ran this in the Simulator and verified that I had no errors.

Did a Build for iOS and I get the “(null)” error.

Hi @thegdog,

For a simple test, can you please try loading up the Corona “Hello World” sample project and try building that? It’s one of the most basic test bed projects for diagnosing build issues. You can find it here:

CoronaSDK > SampleCode > GettingStarted > HelloWorld

Thanks,

Brent

Brent,

Yes, I can build the Hello World app.  Just did.

If I then update the Hello World app’s build.settings and change it to:

settings = { plugins = { ["plugin.zip"] = { publisherId = "com.coronalabs" } }, orientation = { default = "portrait", supported = { "portrait" } }, iphone = { plist = { CFBundleIconFile = "Icon.png", CFBundleIconFiles = { "Icon.png", "Icon@2x.png", "Icon-72.png", "Icon-72@2x.png", }, }, }, }

The build then fails when Building for iOS.

Incidentally, I have no problem building my other app which does not use the Zip plugin.

Just for fun can you go this folder:
 

/Users/yourhomefolder/Library/Application Support/Corona/Simulator/Plugins

Where yourhomefolder is your home folder :slight_smile: and remove everything related to the zip plugin?  Then give it a go?

Just did that, Rob.  Same thing.  Get the “(null)” error.

I even tried deleting the entire Plugins folder but no difference. 

I removed the Corona SDK completely, deleting all the Corona files in the Preferences folder.  Reinstalled the current public release, edited the Hello World example to add in the Zip plugin lines, and did a Build for iOS.  Again, I get the “(null)” error.

Any chance this could be a permissions error on the build server for iOS?  Even though I am a Pro developer and should have access, maybe that is failing and that is causing the problem?

I think at this point, we’ve ruled out its an app code issue, since it happens with your HelloWorld application if the plugin is correctly added to the build.settings file.

It could be something account related.  I just tried to look up your account and I don’t find any accounts with your email address.  It might be worth trying to deauthroize yourself and then run Corona SDK and login again and see if that clears something up.   If that doesn’t do it, I’m afraid you’re going to have to email support AT coronalabs DOT com and have them look up your account information from the account you are logging with and see if there is an issue with your subscription.

I just took an existing main.lua and used your build.settings on build 1198 on my Mac and it built with no errors.  So it is an issue with your local machine and or account.

When I reinstalled Corona on the last round of trying things, deleting all the Preferences made me have to log back in.

And there is an account with my email address, since if I remove the Zip plugin code, it does build.

I will contact the Support email.

Rob,

Is there anyway to tell what the “(null)” error is actually throwing?  Are there any logs on the build server (or locally) that indicate what causes a build to fail?

I have a sneaky suspicion you are just running the Corona app, not the “corona-terminal” app. If you run the latter, the terminal app will open and launch the simulator for you, this terminal has your console messages. Go google “corona SDK basic debugging” and read that blog post for specifics.

Ahh, I didn’t know that it gave information during the Build process.

Here is the error reported:

2013-09-09 20:36:03.946 Corona Simulator[7790:e03] xcode-select is set to an invalid location: /Volumes/Xcode/Xcode.app/Contents/Developer Using additional build settings from: /Applications/CoronaSDK/SampleCode/GettingStarted/HelloWorld/build.settings WARNING: Your SDK may be out of date b/c the following SDK directory could not be found: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk WARNING: Using the following SDK instead: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.0.sdk WARNING: Your SDK may be out of date b/c the following SDK directory could not be found: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk WARNING: Using the following SDK instead: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk Runtime error ...esktop/HelloWorld.app/.build/libtemplate/Builder.lua:295: \<error\>{"status":32512,"message":"sh: /Volumes/Xcode/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++: No such file or directory"}\</error\> stack traceback: [C]: ? [C]: in function 'assert' ...esktop/HelloWorld.app/.build/libtemplate/Builder.lua:295: in function 'checkError' ...esktop/HelloWorld.app/.build/libtemplate/Builder.lua:318: in function 'build' ?: in function 'buildExe' ?: in function \<?:692\> Runtime error: ...esktop/HelloWorld.app/.build/libtemplate/Builder.lua:295: \<error\>{"status":32512,"message":"sh: /Volumes/Xcode/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++: No such file or directory"}\</error\> stack traceback: [C]: ? [C]: in function 'assert' ...esktop/HelloWorld.app/.build/libtemplate/Builder.lua:295: in function 'checkError' ...esktop/HelloWorld.app/.build/libtemplate/Builder.lua:318: in function 'build' ?: in function 'buildExe' ?: in function \<?:692\>

If I remove the plugin information from the build.settings file, the only error I get is:

2013-09-09 20:38:26.188 Corona Simulator[7825:e03] xcode-select is set to an invalid location: /Volumes/Xcode/Xcode.app/Contents/Developer

The rest of the information is the packaging and adding of files.

I am downloading the latest Xcode 4 installer now and will try reinstalling that.  Was there some notification that plugins required a later version of Xcode?  I didn’t see anything and since I was able to keep building my other app, I had no idea that I should be updating since I had no reason to on my side.

Will let you know how this goes.  Fingers crossed.   :slight_smile:

Side note:

Can your web guys fix the code formatter here in the forums so that it wraps lines?  Or provides scroll bars?  That’d be so helpful.  :slight_smile:

SOLVED!

I updated to the latest Xcode (4.6.3), which alone did not solve the problem.

I then launched Xcode and went to Preferences.  On the Downloads tab, I selected to install the Command Line Tools.  On the Locations tab, I changed the Command Line Tools value, which was not selected, to Xcode 4.6.3. 

Build for iOS then completed successfully.

Are you using Firefox?  The code formatting is fine on Chrome and Safari.  I’m a firefox user and I have to deal with the cut lines too.  I’ll add you to those asking for a fix.

Glad you got it solved.

Rob

Is the above code within the settings table in build.settings?