Titanium JIRA Archive
Appcelerator Modules (MOD)

[MOD-2504] Missing linker flags in appcelerator.encrypteddatabase module

GitHub Issuen/a
TypeBug
PriorityCritical
StatusResolved
ResolutionFixed
Resolution Date2019-04-10T19:15:13.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsEncrypted SQLite DB
Labelsios
ReporterRyan Aston
AssigneeJan Vennemann
Created2019-03-24T03:46:33.000+0000
Updated2019-04-10T19:15:13.000+0000

Description

When attempting to build a project with the encrypted database module for the iOS simulator in the environment above the xcodebuild linker step fails. Running
appc run -p ios -l trace
shows the following error: {noformat} [TRACE] Undefined symbols for architecture x86_64: [TRACE] "_inflate", referenced from: [TRACE] _zipfileColumn in libappcelerator.encrypteddatabase.a(sqlite3.o) [TRACE] "_deflateInit2_", referenced from: [TRACE] _zipfileDeflate in libappcelerator.encrypteddatabase.a(sqlite3.o) [TRACE] "_compressBound", referenced from: [TRACE] _zipfileDeflate in libappcelerator.encrypteddatabase.a(sqlite3.o) [TRACE] "_deflate", referenced from: [TRACE] _zipfileDeflate in libappcelerator.encrypteddatabase.a(sqlite3.o) [TRACE] "_inflateInit2_", referenced from: [TRACE] _zipfileColumn in libappcelerator.encrypteddatabase.a(sqlite3.o) [TRACE] "_deflateEnd", referenced from: [TRACE] _zipfileDeflate in libappcelerator.encrypteddatabase.a(sqlite3.o) [TRACE] "_inflateEnd", referenced from: [TRACE] _zipfileColumn in libappcelerator.encrypteddatabase.a(sqlite3.o) [TRACE] "_crc32", referenced from: [TRACE] _zipfileStep in libappcelerator.encrypteddatabase.a(sqlite3.o) [TRACE] _zipfileUpdate in libappcelerator.encrypteddatabase.a(sqlite3.o) [TRACE] "_uncompress", referenced from: [TRACE] _uncompressFunc in libappcelerator.encrypteddatabase.a(sqlite3.o) [TRACE] "_compress", referenced from: [TRACE] _compressFunc in libappcelerator.encrypteddatabase.a(sqlite3.o) [TRACE] (maybe you meant: _sqlite3_compress_init [TRACE] ) [TRACE] ld: symbol(s) not found for architecture x86_64 [TRACE] clang: error: [TRACE] linker command failed with exit code 1 (use -v to see invocation) [ERROR] ** BUILD FAILED ** [ERROR] The following build commands failed: [ERROR] Ld /Users/ryanaston/Projects/EncDBiOSBuildBug/build/iphone/build/Products/Debug-iphonesimulator/EncDBiOSBuildBug.app/EncDBiOSBuildBug normal x86_64 [ERROR] (1 failure) {noformat} Researching this issue I found that adding
OTHER_LDFLAGS= -lz
to the module.xcconfig file fixes the issue. If another module in the project has already set this flag it actually works fine, but when this module is alone it will not build without that flag. This happens with both version 2.0.5 and the unofficial build of 2.0.6 we were provided for testing purposes. Demo project here: https://drive.google.com/file/d/1SMUz7HxNPQPUj6H48Q_NOMYwhhrj7Qd8/view?usp=sharing

Attachments

FileDateSize
Screen Shot 2019-04-07 at 4.22.33 PM.png2019-04-07T10:24:53.000+000034184

Comments

  1. Jan Vennemann 2019-04-08

    This is due to changes in the Xcode project in 8.0.0.GA. Previously we would link with the libz library by default. This was removed in 8.0.0.GA and now modules that need to link against this library will have to explicitly specify this in their module.xcconfig. As already stated the easy fix is to update the modules module.xcconfig locally. Moving this to the MOD project to update the module.xcconfig.
  2. Jan Vennemann 2019-04-08

    PR: https://github.com/appcelerator-modules/appcelerator.encrypteddatabase/pull/35
  3. Christopher Williams 2019-04-10

    merged to master branch of the module

JSON Source