FAQ Wednesday: iOS Builds, API Docs, and Android

Frequently Asked Questions
Share on Facebook0Share on Google+4Tweet about this on TwitterShare on LinkedIn0

Frequently Asked Questions

It’s Wednesday and time for another FAQ session. Here are some frequently asked questions (FAQ) about iOS builds, API documentation and Android.

1. I’m using build 922 and I’m getting a code signing error after an iOS build. What’s wrong?

Starting with build 922, Corona builds against the iOS 6 SDK which requires Xcode 4.5. You will get this error message if you are using an earlier version of Xcode.

2. I see new APIs added to Corona but the API docs are not being updated.

The API documentation on the web is the documentation for the current Release Build (2012.894). The documentation for APIs added/changed in the Daily Builds are located in a zip file on the Daily Builds page.

3. I’m trying to use File I/O on Android to read files and it’s not working. It does work in the Simulator and on iOS. Is this a bug?

An Android APK is really a zip file. The files in the resource directory are inside the APK file, therefore they are compressed within a zip file (instead of residing in an actual directory). The Lua I/O API such as io.open() is unable to open/extract files inside a zip file, thus it cannot open files within an APK.

With that said, we’ve implemented some special handling on Android. Calling system.pathForFile() on certain file types will cause Corona to automatically extract that file and copy it to an outside directory. It’s a hack and not a good solution because it is wasteful on storage space, but it does allows Lua I/O APIs to access certain file types.

system.pathForFile() will auto-extract all file types EXCEPT the following:


This means that the above file types cannot be accessed by Lua I/O API. All other files will be automatically extracted when calling system.pathForFile() first. This is also why you can’t access your HTML file. The reason that the HTML file is not auto-extracted is because typically images are linked to it as well so Corona would have to auto-extract image files too to make the web page appear correctly… but we definitely don’t want to do this because images typically take a huge amount of space on storage.

One way to access one of the above files (e.g., png and jpg) is to rename it to something like my file.png.txt. You would typically copy one of these files to the Documents or Temporary directory and rename it back to it’s original name. Just be aware that large files will add to the memory space used by your app.

4. I’m displaying an image and trying to update it with a new image and it’s not updating. What’s wrong?

Corona will cache image data based on the file name. If you are trying to load an image with the same file name and the previous image is currently active, Corona will think it’s the same image and use the previous image data. This typically happens if you are downloading images from a server where the images are updated but the file name stays the same. The solution is to rename the newer image before loading it or to make sure to remove the old image before loading the new image. Calling removeSelf on the old image object will remove the association between the image data and file name.

5. How to get a cleaner ADB Logcat debug display

This is not really a question but a tip I found in the Corona Forums (sorry I don’t have the name of the user who posted it). The tip is how to only display print messages for your app and not show all the other “busy” messages that Android OS sends. For those who installed the Android SDK you are probably using the ADB program to help debug your code.

Start “adb” (from the Android SDK) with the following line of code:

adb logcat Corona:v *:s

If you app is not working as expected you should try running “adb” without the extra parameters just in case there are other errors or warnings displayed.

That’s it for today’s questions. I hope you enjoyed it and even learned a few things.

Share on Facebook0Share on Google+4Tweet about this on TwitterShare on LinkedIn0

This entry has 3 replies

  1. Dave says:

    Regarding #4, would appending a random key-value at the end of the image URL (e.g. http://domain.com/img.jpg?r=someRandomNumber) be a workaround solution?


  2. FriskyPig says:

    When will you be releasing a stable/public build that is compatible with iOS 6? We need a build we can rely on and work with.

  3. Neil says:

    If you’re debugging on Android, you can do:

    adb logcat dalvikvm:v Corona:v *:s

    I’ve been looking for this answer all over the place and just figured it out, using the info in this article. Thanks for the article! 🙂