Rocket.chat.reactnative: iOS error:Failed to open the database. unable to open database file: file on the Real machine

Created on 29 Oct 2019  路  11Comments  路  Source: RocketChat/Rocket.Chat.ReactNative

  • Your Rocket.Chat Experimental app version: 1.20.1.100
  • Your Rocket.Chat server version: 2.1.1
  • Device (or Simulator) you're running with: iPhone 7P
    Running on a real machine error:
    鎴睆2019-10-29涓嬪崍6 52 32
    鎴睆2019-10-29涓嬪崍6 52 38

Most helpful comment

All 11 comments

@MiaoMiaoai it should fixed by https://github.com/RocketChat/Rocket.Chat.ReactNative/pull/1322 .
Can you confirm?

@djorkaeffalexandre If I change my Bundle ID run on a real machine , I will report an error.
App can't open.

鎴睆2019-10-29涓嬪崍8 07 33
鎴睆2019-10-29涓嬪崍8 07 48
鎴睆2019-10-29涓嬪崍8 07 57

@djorkaeffalexandre What do I need to do to run

@djorkaeffalexandre Thank you very much for solving my problem.

@djorkaeffalexandre Can you explain your solution more, why doesn't it work without this modification? Can we include the fix into the base code? Can we add this to whitelabeling documentation?

You need to change here to your App Group Identifier: https://github.com/RocketChat/Rocket.Chat.ReactNative/blob/develop/app/lib/database/index.js#L28
Hi can you help me with this?
Do I have to change this
const appGroupPath = isIOS ? appGroup.path : '';
to

const appGroupPath = isIOS ? appGroup.path : 'group.com.example.app';

something like that?

@bradroid @zeeshanwarriach93, not exactly, if you don't have an App Group configured you'll need to set App Group Path as an empty string.
Check these steps and make sure you've followed this things on the right way, so you don't need to change anything into the code.
https://docs.rocket.chat/guides/developer/mobile-apps/whitelabeling-mobile-apps#general-setup
We're reading the App Group identifier from each target Info.plist and generating the app group folder path based on it, this is need to the database be shared between our targets/extensions (Share Extension, Notification Extension, Main App).

@djorkaeffalexandre I have followed whitelabeling guide and have app groups setup. Does that mean that I don't need to modify app/lib/database/index.js?

I'm getting this error:

Fatal error: Failed to open the database. unable to open database file: file WatermelonDB/Database.swift, line 19

The issue is I think that your link points to line 19 in a file that changed in the meantime, and now it's not clear what needs to be changed to fix this.

same problem here

You need to change here to your App Group Identifier: https://github.com/RocketChat/Rocket.Chat.ReactNative/blob/develop/app/lib/database/index.js#L28

@djorkaeffalexandre i having same isssue, can you show me example code for this issue ?

I fixed the issue on my side. The problem for me was that my App Group Identifier definition in "Signing & Capabilities" got out of sync from the one defined in Info.plist. Make sure both are using the same value.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sadeghpro picture sadeghpro  路  5Comments

sd1998 picture sd1998  路  4Comments

venkatasubramanis picture venkatasubramanis  路  5Comments

Prateek93a picture Prateek93a  路  6Comments

ggazzo picture ggazzo  路  6Comments