App crash! when used Realm.copyBundledRealmFiles().
See original GitHub issueGoals
I have a test.realm
file. I want import and open this database file in react-native.
Code Sample
After searching about it.I found Realm.copyBundledRealmFiles()
method in realm…
So I did something like this…
- create a fresh new react-native app
- install realm. (with manual linking)
- paste
test.realm
file intoandroid/app/src/main/assets/test.realm
App.js
code as fellow
import React from 'react';
import { Text } from 'react-native';
import Realm from 'realm';
Realm.copyBundledRealmFiles(); // with out this line every thing work fine also realm working perfectly!
// let realm = new Realm({path: 'test.realm'});
// console.log(realm.objects('Test'));
export default () => <Text children="Hello World"/>
I create new react-native app for testing this Realm.copyBundledRealmFiles()
method. Those are all step I did. (not more nor less)
Note : I found out that by using Realm.copyBundledRealmFiles();
Only crash App if there is any realm database file in android/app/src/main/assets/
directory.
So did I something wrong? If so How to import realm file and open in react-native?
Actual Results
Android app automatically exit with message ‘unfortunately stop…’ or something. React-native did not report any error stack track.
Version of Realm and Tooling
- Realm JS SDK Version: 6.15
- Node or React Native: React Native
- Client OS & Version: Only Android
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Updating from 3.3.0 to 5.03 broke Realm ... - GitHub
I'd like to copy a realm bundled with my app, with Realm.copyBundledRealmFiles, and consume it with react-realm-context.
Read more >App crashes after using useQuery or Realm.objects()
Hello friends I come to ask for help because I'm developing an application using React Native, Expo and Realm and I got stuck...
Read more >Crash after attempting to restore realm - android
I'm attempting to implement a backup/restore functionality for my android application using Realm. After I restore the data from the backup, if ...
Read more >realm | Yarn - Package Manager
Realm is a mobile database that runs directly inside phones, tablets or wearables. This project hosts the JavaScript versions of Realm. Currently we...
Read more >Source - GitHub
None ### Compatibility * React Native >= v0.70.0 * Atlas App Services. ... ([#4722](https://github.com/realm/realm-js/pull/4722)) * Fixed a crash on Android ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@kraenhansen Yes, Here’s my realm file. https://drive.google.com/file/d/1EvHNpMAgl8r0Cr8ZMfI8LBBj4vm2SwtG/view?usp=sharing And I have pre-loaded it with data. The crash doesn’t happen on Android version 10 but it happens with Android version 6.0.1
PS: It happens on opening first, It crashes then second time I open it doesn’t crash, And when I kill the app again and reopen, it crashes again.
This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don’t have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.