Closed s1ro6 closed 4 years ago
What's the workaround for this?
What's the workaround for this?
run npx react-native link realm
then npx jetify
ignore the warning, my project is running properly with that
What's the workaround for this?
run
npx react-native link realm
thennpx jetify
ignore the warning, my project is running properly with that
Jetify is for Android.
I have different issue but I think it is connected with autolinking on iOS. After realm installation, pod install
gives me following error:
[!] Invalid `Podfile` file: no implicit conversion of nil into String.
# from /Users/marcinochyra/projects/classified/ios/Podfile:37
# -------------------------------------------
#
> use_native_modules!
# end
# -------------------------------------------
Related warning:
warn The following packages use deprecated "rnpm" config that will stop working from next release:
- realm: https://realm.io
Please notify their maintainers about it. You can find more details at https://github.com/react-native-community/cli/blob/master/docs/configuration.md#migration-guide.
To fix the pod's use_native_modules!
-error, just add a react-native.config.js
-file in the root of your project with the following code (exclusive example for realm, but you get the idea):
module.exports = {
dependencies: {
realm: {
platforms: {
ios: null // disable iOS platform, other platforms will still autolink if provided
}
}
}
};
👉 autolinking info for more details
Disabling autolinking means we have to use good ol' manual linking, but sadly realm doesn't provide a guide here and the standard way (as told by the react-native-team) doesn't work, either.
I followed this guide, but still get the Cannot read property 'debugHosts' of undefined
error. It looks like the export of NativeModules in RealmJS is undefined, thus no destruction of debugHosts
.
The realm problem I see here is that realm currently doesn't use CocoaPods for iOS, which prohibits auto linking.
Looking forward for this issue being fixed.
Edit: Fix typo react-native.config.js
warn The following packages use deprecated "rnpm" config that will stop working from next release:
Please notify their maintainers about it. You can find more details at https://github.com/react-native-community/cli/blob/master/docs/configuration.md#migration-guide.
same for me
I'm getting the same error as @excitedcat. Has anyone found a solution?
Currently we only support React Native (both iOS & Android)
I would beg to differ. Finally upgraded to RN 0.60 (you know to support 64-bit on Play), and now I gotta go looking for an alternative local db. ugh!
@d14na You don't need to change DB. We've got two RN 0.60.5 apps using Realm 2.29.1 live with the Android 64-bit update.
The only issue right now is that it doesn't support autolinking, but that doesn't mean you can't use the module.
Just tell RN it doesn't support autolinking on ios (Android actually works fine since it works in a different manner) by editing your react-native.config.js
like so:
module.exports = {
dependencies: {
'realm': {
platforms: {
ios: null,
},
},
},
}
Since you're upgrading a project I assume your iOS project already has the manually linked RealmReact.xcodeproj
? That'll be sufficient for the iOS side. On the Android side ensure the implementation project(':realm')
isn't in the app/build.gradle
and:
include ':realm'
project(':realm').projectDir = new File(rootProject.projectDir, '../node_modules/realm/android')
isn't in the settings.gradle
and you should be good to go on both platforms. Android will autolink, iOS won't.
+1
Hey everyone. There are already plans to fix this soon.
Really could do with Hermes at the moment so this is good news
On Wed, 4 Sep 2019, 19:40 blagoev, notifications@github.com wrote:
Hey everyone. There are already plans to fix this soon.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/realm/realm-js/issues/2460?email_source=notifications&email_token=AASPEEOMTET4QQPTUOJVDILQH76JTA5CNFSM4IFC34MKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD54R6EA#issuecomment-528031504, or mute the thread https://github.com/notifications/unsubscribe-auth/AASPEEL7Q4BXGTQLAJPRJXDQH76JTANCNFSM4IFC34MA .
can it be marked as bug? i use custom xcode config file for Develop, Stage, Release. using both Cocoapods and manual linking cause xcode fail due to incorrect CONFIGURATION_BUILD_DIR for staging configuration
I m using React Native 0.60.5 for my project and I am having the same issue. I tried every thing guys suggested here and nothing happened. I added realm 2.29.1 and done react-native link command and linked the library and then added the react-native-config file and added the code suggested by one guy here to ignore pod lookup for realm. Nothing happening and I am still getting an error of 'Native Module cannot be null' Error
I have this problem too :(
Facing same issue :(
I was hyped to use RealmDB for the current project but, I've been chasing errors after errors. This is an awesome project and I really hope to see it up without errors soon :/
any solution or update for react-native 0.60 above??
What's the workaround for this?
run
npx react-native link realm
thennpx jetify
ignore the warning, my project is running properly with that
not work
I'm working on this from https://github.com/realm/realm-js/tree/kh/podspec, after checkout run pod spec lint
to attempt a compilation. Any help getting this to pass linting would be greatly appreciated.
I'm getting the same error as @excitedcat. Has anyone found a solution?
I've tried the solutions posted here, and manual linking works.
react-native.config.js
config file in the root of the project with this content:module.exports = {
dependencies: {
'realm': {
platforms: {
ios: null,
},
},
},
}
That will skip autolinking for Realm for iOS.
Add the project RealmReact.xcodeproj
from node_modules
into your project as a subproject
Be sure to include libRealmReact.a
in the Link Binary With Libraries
step of your target Build Phases
.
Important: I've spent a lot of time chasing the Cannot read property 'debugHosts' of undefined
bug because I was linking to libRealm.a
and not libRealmReact.a
, I'm sure that may happen to someone else.
I'm getting the same error as @excitedcat. Has anyone found a solution?
I've tried the solutions posted here, and manual linking works.
- Add a
react-native.config.js
config file in the root of the project with this content:module.exports = { dependencies: { 'realm': { platforms: { ios: null, }, }, }, }
That will skip autolinking for Realm for iOS.
- Add the project
RealmReact.xcodeproj
fromnode_modules
into your project as a subproject- Be sure to include
libRealmReact.a
in theLink Binary With Libraries
step of your targetBuild Phases
. Important: I've spent a lot of time chasing theCannot read property 'debugHosts' of undefined
bug because I was linking tolibRealm.a
and notlibRealmReact.a
, I'm sure that may happen to someone else.
We have followed the same approach, but ended up with the error "React/RCTBridge+Private.h file noti found"
Can you please suggest us if we have missed specifying any PODs path in HEADER_SEARCH_PATH of the iOS project?
I'm getting the same error as @excitedcat. Has anyone found a solution?
I've tried the solutions posted here, and manual linking works.
- Add a
react-native.config.js
config file in the root of the project with this content:module.exports = { dependencies: { 'realm': { platforms: { ios: null, }, }, }, }
That will skip autolinking for Realm for iOS.
- Add the project
RealmReact.xcodeproj
fromnode_modules
into your project as a subproject- Be sure to include
libRealmReact.a
in theLink Binary With Libraries
step of your targetBuild Phases
. Important: I've spent a lot of time chasing theCannot read property 'debugHosts' of undefined
bug because I was linking tolibRealm.a
and notlibRealmReact.a
, I'm sure that may happen to someone else.We have followed the same approach, but ended up with the error "React/RCTBridge+Private.h file noti found"
Can you please suggest us if we have missed specifying any PODs path in HEADER_SEARCH_PATH of the iOS project?
Add RealmReact target to Podfile,It's work,but can't Archive.
target 'RealmReact' do
pod 'React', :path => '../node_modules/react-native/'
project '../node_modules/realm/react-native/ios/RealmReact.xcodeproj'
end
I have a PR ready for this https://github.com/realm/realm-js/pull/2586. If some of you have experience writing Podspec files and especially in the context of React Native libraries, it would be really awesome if you spent a few minutes reviewing the change and adding a comment on the PR.
It would also be great if one or more of you wanted to test out the changes:
git clone --recurse-submodules --single-branch --branch kh/podspec https://github.com/realm/realm-js.git
npm pack
npm install [path to realm-js]/realm-3.3.0.tgz
pod install
(from your ./ios
directory).react-native unlink realm
first.@kraenhansen I tried cloning your branch as suggested and installing realm from the npm pack output, but i'm getting this error when trying to do pod install
cp: src/object-store/src/*.hpp: No such file or directory
@kraenhansen I tried cloning your branch as suggested and installing realm from the npm pack output, but i'm getting this error when trying to do pod install
cp: src/object-store/src/*.hpp: No such file or directory
I pushed an update to the branch, please pull and try again. I also forgot to add the --recurse-submodules
on the clone command above, please try that again too.
fix my question:
if Podfile
we used use_frameworks!
then it can not be found /Pods/Headers/Public/React-Core anymore
so how could I fix this problem
Hi @kraenhansen: I have tried installing realm using your branch. Post installation, I am encountered with below error during project build, as per issues/2271 I have tried adding JavaScriptCore.framework
but no luck:
Could you please guide me to solve this issue.
Thanks </ Pranav >
I've pushed to the kh/podspec
branch what I believe is a fix for the case where the Podfile calls use_frameworks!
.
@GreyGao Please pull the latest update to the branch and try again.
@prscX You are you using use_frameworks!
in your Podfile, right?
Please pull the latest update to the branch and try again.
Thanks a lot @kraenhansen for quick support. It worked post taking pull 💯.
Yes, I am using use_frameworks!
in Podfile for few Swift library integration.
Thanks </ Pranav >
Thanks for @kraenhansen help!😄 ❤️ It works.
Great! We'll roll-up a release with this ASAP.
@kraenhansen I tried your package but I got this error to run on simulator:
Undefined symbols for architecture x86_64:
"_RCTJSThread", referenced from:
-[RealmReact setBridge:] in RealmReact.o
"_RCTRegisterModule", referenced from:
+[RealmReact load] in RealmReact.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
What's wrong?
@cmeiller
What's wrong?
I believe this is caused by the Podspec incorrectly referencing the RCTBridge headers. Would you mind sharing a bit more information about your setup?
4a404b6
or 910ae34
).use_frameworks!
in your Podfile?ios
folder which contains the Podfile
and Pods
directory and does your root directory contain the node_modules
directory as a direct descendant?@kraenhansen yes I have the latest changes and I'm calling use_frameworks!
in my Podfile.
Here is my directory root structure (I cut the root files below):
Thank you for your answer :)
@cmeiller I've moved our conversation to a new issue https://github.com/realm/realm-js/issues/2590, let's continue there.
@CaptainQuark could you please edit your comment?
File name must be: react-native.config.js
- react-native-config.js <= Wrong !!!!
+ react-native.config.js
@CaptainQuark could you please edit your comment?
File name must be: react-native.config.js
- react-native-config.js <= Wrong !!!! + react-native.config.js
🤦♂️ Sure, fixed.
Apply this
npm install realm@hermes
Work's for me.
Goals
Use the Realm.js with React Native Autolinking correctly.
Expected Results
Don't show warning information.
Let the CocoaPods don't show warning after executing
pod install
.Actual Results
After the
pod install
, it shows the following warning:Steps to Reproduce
Version of Realm and Tooling
realm-js 2.29.1
React Native v0.60.3
iOS 12.2
None