Search code examples
androidreact-native64-bitpouchdb

React-native on 64-bit devices - debug works fine but not release. No problem with 32-bit devices at all


I googled a lot but none of findings is equal to my case:

  1. Only 64-bit Android devices affected (tried on several - all the same)
  2. Debug build on same devices attached via USB works with no issues
  3. Release signed build hangs on every 64-bit device (tried both 64/32 versions)
  4. 32-bit and universal signed release works like a charm on 32-bit devices

How it could be possible that SAME CODE works differently in debug and release, why? Different JS Core used?

[UPD] catlog shows problem with pouchdb replication:

{ [Error]
10-19 08:55:39.157 22836 22855 I ReactNativeJS:   line: 132,
10-19 08:55:39.157 22836 22855 I ReactNativeJS:   column: 7285,
10-19 08:55:39.157 22836 22855 I ReactNativeJS:   sourceURL: 'index.android.bundle',
10-19 08:55:39.157 22836 22855 I ReactNativeJS:   result: 
10-19 08:55:39.157 22836 22855 I ReactNativeJS:    { ok: false,
10-19 08:55:39.157 22836 22855 I ReactNativeJS:      start_time: '2019-10-19T05:55:38.997Z',
10-19 08:55:39.157 22836 22855 I ReactNativeJS:      docs_read: 0,
10-19 08:55:39.157 22836 22855 I ReactNativeJS:      docs_written: 0,
10-19 08:55:39.157 22836 22855 I ReactNativeJS:      doc_write_failures: 0,
10-19 08:55:39.157 22836 22855 I ReactNativeJS:      errors: [],
10-19 08:55:39.157 22836 22855 I ReactNativeJS:      status: 'aborting',
10-19 08:55:39.157 22836 22855 I ReactNativeJS:      end_time: '2019-10-19T05:55:39.155Z',
10-19 08:55:39.157 22836 22855 I ReactNativeJS:      last_seq: 0 } }

Which works fine in debug on same device. How?


Solution

  • The reason was that in debug build non-https requests are allowed by default, in production you have to specify exceptions otherwise code just dies silently, quite unclear Android approach. In iOS BTW there are similar issues. So nothing to do with Couch/Pouch DB, just OS specific network mess