gpt4 book ai didi

android - 链接 Realm 以响应 native 后,应用程序不断停止

转载 作者:行者123 更新时间:2023-11-29 00:55:31 25 4
gpt4 key购买 nike

有人在最新的 realm (2.25.0) 和 React native (0.59.0) 上遇到问题吗?

当我将 Realm 链接到 react-native 时没有问题。但是,当我在真实设备上运行“react-native run-android”时(目前我正在两台设备上进行测试,Oneplus 5 - Android Pie & Oppo F1s - Android Lollipop), bundle 成功,但应用程序从未启动。我取消了 realm 与 react-native 的链接,它返回“Missing Realm Constructor...”(这是我的预期)。

它在模拟器上运行没有任何问题,它只在真实设备上遇到问题。

下面是我的package.json

{
"name": "testing",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"react": "16.8.3",
"react-native": "0.59.0",
"realm": "^2.25.0"
},
"devDependencies": {
"@babel/core": "^7.3.4",
"@babel/runtime": "^7.3.4",
"babel-jest": "^24.5.0",
"jest": "^24.5.0",
"metro-react-native-babel-preset": "^0.53.0",
"react-test-renderer": "16.8.3"
},
"jest": {
"preset": "react-native"
}
}

重现步骤:

  1. react-native 初始化测试
  2. npm install --save realm
  3. react-native 链接 Realm
  4. react-native run-android

有人对这个问题有想法吗?感谢您的帮助。

最佳答案

试试这个:然后转到 build.gradle

android {
...
defaultConfig {
...

并添加这个

ndk {
abiFilters 'armeabi-v7a', 'x86'
}

默认配置。它必须看起来像这样:

defaultConfig {
...
ndk {
abiFilters 'armeabi-v7a', 'x86'
}
}

关于android - 链接 Realm 以响应 native 后,应用程序不断停止,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55135794/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com