[iOS] Linking error in Xcode with Zip plugin

I’m trying to build our Corona SDK app onto Enterprise/iOS/XCode and have followed all the tutorials and helpful forum posts that talk about this, but I’ve hit a dead end on how to get past this linking error in XCode:

Undefined symbols for architecture armv7:

  “_crc32”, referenced from:

      _unzReadCurrentFile in libplugin.zip.a(unzip.o)

      _zipWriteInFileInZip in libplugin.zip.a(zip.o)

      getFileCrc(char const*, void*, unsigned long, unsigned long*) in libplugin.zip.a(ZipTask.o)

  “_deflate”, referenced from:

      _zipWriteInFileInZip in libplugin.zip.a(zip.o)

      _zipCloseFileInZipRaw64 in libplugin.zip.a(zip.o)

  “_deflateEnd”, referenced from:

      _zipCloseFileInZipRaw64 in libplugin.zip.a(zip.o)

  “_deflateInit2_”, referenced from:

      _zipOpenNewFileInZip4_64 in libplugin.zip.a(zip.o)

  “_get_crc_table”, referenced from:

      _zipOpenNewFileInZip4_64 in libplugin.zip.a(zip.o)

  “_inflate”, referenced from:

      _unzReadCurrentFile in libplugin.zip.a(unzip.o)

  “_inflateEnd”, referenced from:

      _unzCloseCurrentFile in libplugin.zip.a(unzip.o)

  “_inflateInit2_”, referenced from:

      _unzOpenCurrentFile3 in libplugin.zip.a(unzip.o)

ld: symbol(s) not found for architecture armv7

clang: error: linker command failed with exit code 1 (use -v to see invocation)

My specs: Xcode 6.4, OSX 10.10.4, Corona Enterprise 2015.2692.  I followed the directions posted here:

https://forums.coronalabs.com/topic/57414-moving-a-corona-app-to-corona-enterprise-guide-advice-required/

as well as the official Quick start tutorial.

Any help is greatly appreciated!  Thanks!

Kenric

I managed to get past the above build errors by downloading the zip plugin source from git and running the build.sh script in the iOS directory for the plugin.  Using the resulting .a file for the zip plugin, the project compiled successfully (only for the simulator though, it wouldn’t work for the device) but I got the following runtime error:

Aug 12 10:41:33.764: puzzingo: Runtime error

module ‘plugin.zip’ not found:resource (plugin.zip.lu) does not exist in archive

no field package.preload[‘plugin.zip’]

no file '/Users/Kenric/Library/Developer/CoreSimulator/Devices/2ADA8381-09C8-4747-883B-72008ABB9C97/data/Containers/Bundle/Application/2E6C1B49-65B1-4DA8-AC42-593BB97953E8/puzzingo.app/plugin/zip.lua’

no file '/Users/Kenric/Library/Developer/CoreSimulator/Devices/2ADA8381-09C8-4747-883B-72008ABB9C97/data/Containers/Bundle/Application/2E6C1B49-65B1-4DA8-AC42-593BB97953E8/puzzingo.app/plugin/zip.lua’

no file './plugin/zip.so’

no file '/Users/Kenric/Library/Developer/CoreSimulator/Devices/2ADA8381-09C8-4747-883B-72008ABB9C97/data/Containers/Bundle/Application/2E6C1B49-65B1-4DA8-AC42-593BB97953E8/puzzingo.app/plugin/zip.so’

no file './plugin.so’

no file '/Users/Kenric/Library/Developer/CoreSimulator/Devices/2ADA8381-09C8-4747-883B-72008ABB9C97/data/Containers/Bundle/Application/2E6C1B49-65B1-4DA8-AC42-593BB97953E8/puzzingo.app/plugin.so’plugin.zip

stack traceback:

[C]: in function 'require’

I added the libplugin.zip.a file by dragging it into the CoronaEnterprise/lib section of the Xcode project navigator pane.  Do I need to do something else to get past this error?  Also, eventually I’ll need to be able to run this on device, so I still need guidance from Corona staff on this issue.

Thanks,

Kenric

We fixed some other linking errors today. Please grab today’s daily build and give it a try.

Rob

@Rob, the last Corona Enterprise build listed is 2015.2693 built on the 11th. Am I missing something obvious?

Yea, the last one didn’t process right. It should sync up with the next daily build.

Rob

I just got back to this recently, and I’m still having issues with the zip plugin.

Building for the simulator, I get these errors:

Undefined symbols for architecture x86_64:

  “_crc32”, referenced from:

      _unzReadCurrentFile in libplugin.zip.a(unzip.o)

      _zipWriteInFileInZip in libplugin.zip.a(zip.o)

      getFileCrc(char const*, void*, unsigned long, unsigned long*) in libplugin.zip.a(ZipTask.o)

  “_deflate”, referenced from:

      _zipWriteInFileInZip in libplugin.zip.a(zip.o)

      _zipCloseFileInZipRaw64 in libplugin.zip.a(zip.o)

  “_deflateEnd”, referenced from:

      _zipCloseFileInZipRaw64 in libplugin.zip.a(zip.o)

  “_deflateInit2_”, referenced from:

      _zipOpenNewFileInZip4_64 in libplugin.zip.a(zip.o)

  “_get_crc_table”, referenced from:

      _zipOpenNewFileInZip4_64 in libplugin.zip.a(zip.o)

  “_inflate”, referenced from:

      _unzReadCurrentFile in libplugin.zip.a(unzip.o)

  “_inflateEnd”, referenced from:

      _unzCloseCurrentFile in libplugin.zip.a(unzip.o)

  “_inflateInit2_”, referenced from:

      _unzOpenCurrentFile3 in libplugin.zip.a(unzip.o)

ld: symbol(s) not found for architecture x86_64

clang: error: linker command failed with exit code 1 (use -v to see invocation)

Building for the device (iPhone 5), I get this error:

ld: ‘/Users/Kenric/Documents/GitHub/PuzzingoEnterprise/ios/libplugin.zip.a(ioapi.o)’ does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. for architecture arm64

clang: error: linker command failed with exit code 1 (use -v to see invocation)

I’m using OS X 10.10.5, XCode 7.0, Corona Enterprise build 2015.2716. 

Can someone confirm that the zip plugin works for a native iOS build?

I figured out how to get past these errors.  For the errors in the simulator, I had to add libz.dylib from /usr/lib into the Build Phases -> “Link Binary with Libraries” section.

For the error for the device build, I had to disable bitcode in the Build Settings section. Apparently that’s a new iOS 9 thing which is turned on by default (required for any app built for watchOS).   http://stackoverflow.com/questions/30848208/new-warnings-in-ios9

I managed to get past the above build errors by downloading the zip plugin source from git and running the build.sh script in the iOS directory for the plugin.  Using the resulting .a file for the zip plugin, the project compiled successfully (only for the simulator though, it wouldn’t work for the device) but I got the following runtime error:

Aug 12 10:41:33.764: puzzingo: Runtime error

module ‘plugin.zip’ not found:resource (plugin.zip.lu) does not exist in archive

no field package.preload[‘plugin.zip’]

no file '/Users/Kenric/Library/Developer/CoreSimulator/Devices/2ADA8381-09C8-4747-883B-72008ABB9C97/data/Containers/Bundle/Application/2E6C1B49-65B1-4DA8-AC42-593BB97953E8/puzzingo.app/plugin/zip.lua’

no file '/Users/Kenric/Library/Developer/CoreSimulator/Devices/2ADA8381-09C8-4747-883B-72008ABB9C97/data/Containers/Bundle/Application/2E6C1B49-65B1-4DA8-AC42-593BB97953E8/puzzingo.app/plugin/zip.lua’

no file './plugin/zip.so’

no file '/Users/Kenric/Library/Developer/CoreSimulator/Devices/2ADA8381-09C8-4747-883B-72008ABB9C97/data/Containers/Bundle/Application/2E6C1B49-65B1-4DA8-AC42-593BB97953E8/puzzingo.app/plugin/zip.so’

no file './plugin.so’

no file '/Users/Kenric/Library/Developer/CoreSimulator/Devices/2ADA8381-09C8-4747-883B-72008ABB9C97/data/Containers/Bundle/Application/2E6C1B49-65B1-4DA8-AC42-593BB97953E8/puzzingo.app/plugin.so’plugin.zip

stack traceback:

[C]: in function 'require’

I added the libplugin.zip.a file by dragging it into the CoronaEnterprise/lib section of the Xcode project navigator pane.  Do I need to do something else to get past this error?  Also, eventually I’ll need to be able to run this on device, so I still need guidance from Corona staff on this issue.

Thanks,

Kenric

We fixed some other linking errors today. Please grab today’s daily build and give it a try.

Rob

@Rob, the last Corona Enterprise build listed is 2015.2693 built on the 11th. Am I missing something obvious?

Yea, the last one didn’t process right. It should sync up with the next daily build.

Rob

I just got back to this recently, and I’m still having issues with the zip plugin.

Building for the simulator, I get these errors:

Undefined symbols for architecture x86_64:

  “_crc32”, referenced from:

      _unzReadCurrentFile in libplugin.zip.a(unzip.o)

      _zipWriteInFileInZip in libplugin.zip.a(zip.o)

      getFileCrc(char const*, void*, unsigned long, unsigned long*) in libplugin.zip.a(ZipTask.o)

  “_deflate”, referenced from:

      _zipWriteInFileInZip in libplugin.zip.a(zip.o)

      _zipCloseFileInZipRaw64 in libplugin.zip.a(zip.o)

  “_deflateEnd”, referenced from:

      _zipCloseFileInZipRaw64 in libplugin.zip.a(zip.o)

  “_deflateInit2_”, referenced from:

      _zipOpenNewFileInZip4_64 in libplugin.zip.a(zip.o)

  “_get_crc_table”, referenced from:

      _zipOpenNewFileInZip4_64 in libplugin.zip.a(zip.o)

  “_inflate”, referenced from:

      _unzReadCurrentFile in libplugin.zip.a(unzip.o)

  “_inflateEnd”, referenced from:

      _unzCloseCurrentFile in libplugin.zip.a(unzip.o)

  “_inflateInit2_”, referenced from:

      _unzOpenCurrentFile3 in libplugin.zip.a(unzip.o)

ld: symbol(s) not found for architecture x86_64

clang: error: linker command failed with exit code 1 (use -v to see invocation)

Building for the device (iPhone 5), I get this error:

ld: ‘/Users/Kenric/Documents/GitHub/PuzzingoEnterprise/ios/libplugin.zip.a(ioapi.o)’ does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. for architecture arm64

clang: error: linker command failed with exit code 1 (use -v to see invocation)

I’m using OS X 10.10.5, XCode 7.0, Corona Enterprise build 2015.2716. 

Can someone confirm that the zip plugin works for a native iOS build?

I figured out how to get past these errors.  For the errors in the simulator, I had to add libz.dylib from /usr/lib into the Build Phases -> “Link Binary with Libraries” section.

For the error for the device build, I had to disable bitcode in the Build Settings section. Apparently that’s a new iOS 9 thing which is turned on by default (required for any app built for watchOS).   http://stackoverflow.com/questions/30848208/new-warnings-in-ios9