Titanium JIRA Archive
Appcelerator Modules (MOD)

[MOD-2299] Encrypted Database: Crashed on iOS 9 Devices after using SDK 5.5.0.GA

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2016-10-29T01:34:12.000+0000
Affected Version/sRelease 5.5.0
Fix Version/sappcelerator.encrypteddatabase 2.0.2
ComponentsEncrypted SQLite DB
Labelsn/a
ReporterShuo Liang
AssigneeHans Knöchel
Created2016-09-26T13:43:05.000+0000
Updated2018-08-06T17:49:31.000+0000

Description

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

Attachments

FileDateSize
project-broken.pbxproj2016-10-14T08:18:09.000+0000284783
project-fixed.pbxproj2016-10-14T08:18:09.000+0000284783
screenshot.mov2016-10-14T08:18:19.000+00002243146

Comments

  1. Hans Knöchel 2016-09-26

    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.
  2. Chris Barber 2016-10-14

    [~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.
  3. Hans Knöchel 2016-10-14

    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*:
       var EncryptedDatabase = require('appcelerator.encrypteddatabase');
        
       // Set Password
       EncryptedDatabase.setPassword('testisamspassword');
        
       // Open DB
       EncryptedDatabase.open('test');
       
    *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 the libappcelerator.encrypteddatabase.a, so it doesn't conflict. Thanks!
  4. Chee Kiat Ng 2016-10-29

    APPROVED!
  5. Eric Merriman 2018-08-06

    Cleaning up older fixed issues. If this issue should not have been closed as fixed, please reopen.

JSON Source