Reproduce:
1. Create a simple app, and add following code.
var EncryptedDatabase = require('appcelerator.encrypteddatabase');
// Set Password
EncryptedDatabase.setPassword('testisamspassword');
// Open DB
EncryptedDatabase.open('test');
2. Run the app to a iOS 10 device.
3. Then run the app to a iOS 9 device.
Expect Result
It should work well on both device.
Actual Result
1.When running on the iOS 10 device, it works well.
2.When running on the iOS 9 device, the app will be crashed by the following error log
Sep 26 12:35:29 Alastairs-iPad iSAMS-Testing[510] <Warning>: [INFO] iSAMS-Testing/1.0 (5.5.0.44a2e3f)
Sep 26 12:35:29 Alastairs-iPad iSAMS-Testing[510] <Warning>: [DEBUG] Loading: /var/containers/Bundle/Application/F8DC6717-12AF-4C3E-B5C2-CF3C4BFCFD69/iSAMS-Testing.app/app.js, Resource: app_js
Sep 26 12:35:29 Alastairs-iPad iSAMS-Testing[510] <Warning>: [DEBUG] Loading: /var/containers/Bundle/Application/F8DC6717-12AF-4C3E-B5C2-CF3C4BFCFD69/iSAMS-Testing.app/_app_props_.json, Resource: _app_props__json
Sep 26 12:35:29 Alastairs-iPad iSAMS-Testing[510] <Warning>: [ERROR] db error
Sep 26 12:35:29 Alastairs-iPad iSAMS-Testing[510] <Warning>: [DEBUG] Loading: /var/containers/Bundle/Application/F8DC6717-12AF-4C3E-B5C2-CF3C4BFCFD69/iSAMS-Testing.app/appcelerator.encrypteddatabase.js, Resource: appcelerator_encrypteddatabase_js
Sep 26 12:35:29 Alastairs-iPad iSAMS-Testing[510] <Notice>: dyld: lazy symbol binding failed: Symbol not found: _sqlite3_key
Referenced from: /var/containers/Bundle/Application/F8DC6717-12AF-4C3E-B5C2-CF3C4BFCFD69/iSAMS-Testing.app/iSAMS-Testing
Expected in: dyld shared cache
Sep 26 12:35:29 Alastairs-iPad iSAMS-Testing[510] <Notice>: dyld: Symbol not found: _sqlite3_key
Referenced from: /var/containers/Bundle/Application/F8DC6717-12AF-4C3E-B5C2-CF3C4BFCFD69/iSAMS-Testing.app/iSAMS-Testing
Expected in: dyld shared cache
Related issue: http://stackoverflow.com/questions/22512614/sqlite3-key-symbols-not-found-for-architecture-i386 *EDIT*: The problem might be an architecture-issue here: !https://abload.de/img/bildschirmfoto2016-09hdsfk.png! So we need to change the value to
$(ARCHS_STANDARD)
. Although that still not completely explains why it works on iOS 10 but not iOS 9. Maybe different devices? It would be good to know the exact devices (model and iOS version) to verify my thought. Thx! And I currently cannot build the module, so [~cng] might need to help building.[~cng] Based on the code (https://github.com/appcelerator/node-appc/blob/master/lib/timodule.js#L238), it appears the order in the tiapp.xml dictates the order the modules are added to the Xcode project.
TODO: Currently, the
hooks
directory does not get copied over to the zipped module, so I needed to copy it there manually. [~cbarber] may know where to place it, please see the PR for details. *PR* (master): https://github.com/appcelerator-modules/appcelerator.encrypteddatabase/pull/16 *PR* (1_3_X): https://github.com/appcelerator-modules/appcelerator.encrypteddatabase/pull/17 *Test-Case*:*Side-note*: Unfortunately, I have no iOS 9 device in here Germany, so I could not actually test the change. But I can ensure that the
sqlite3.dylib
gets moved below thelibappcelerator.encrypteddatabase.a
, so it doesn't conflict. Thanks!APPROVED!
Cleaning up older fixed issues. If this issue should not have been closed as fixed, please reopen.