You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let me preface by saying I assume this must be an issue with my setup, or there would be more reports. However, I can't seem to get by the lint error and it appears to be the patch for this that causes the other errors.
> Task :realm:lintDebug FAILED
Lint found 1 errors, 0 warnings. First failure:
/Users/{name}/IdeaProjects/project-name/node_modules/realm/react-native/android/src/main/java/io/realm/react/RealmReactModule.java:98: Error: This declaration is opt-in and its usage should be marked with @com.facebook.react.common.annotations.FrameworkAPI or @OptIn(markerClass = com.facebook.react.common.annotations.FrameworkAPI.class) [UnsafeOptInUsageError from androidx.annotation.experimental]
CallInvokerHolderImpl jsCallInvokerHolder = (CallInvokerHolderImpl) getReactApplicationContext().getCatalystInstance().getJSCallInvokerHolder();
Patch:
diff --git a/react-native/android/src/main/java/io/realm/react/RealmReactModule.java b/react-native/android/src/main/java/io/realm/react/RealmReactModule.java
index eda164794b888bebb9f74911cbd1fe6e16fbb55b..0b4cf1fa3e2d9d7648c897b41a551ba8df2618d1 100644
--- a/react-native/android/src/main/java/io/realm/react/RealmReactModule.java
+++ b/react-native/android/src/main/java/io/realm/react/RealmReactModule.java
@@ -22,9 +22,11 @@ import android.os.Handler;
import android.os.HandlerThread;
import android.util.Log;
+import androidx.annotation.OptIn;
import com.facebook.react.bridge.JavaScriptContextHolder;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContextBaseJavaModule;
+import com.facebook.react.common.annotations.FrameworkAPI;
import com.facebook.react.module.annotations.ReactModule;
import com.facebook.react.turbomodule.core.CallInvokerHolderImpl;
import com.facebook.soloader.SoLoader;
@@ -91,6 +93,7 @@ class RealmReactModule extends ReactContextBaseJavaModule {
}
@Override
+ @OptIn(markerClass = FrameworkAPI.class)
public void initialize() {
// Pass the React Native jsCallInvokerHolder over to C++, so that we can access the invokeAsync
// method which we use to flush the React Native UI queue whenever we call from C++ to JS.
Issue on Version 12.11.1
Removing the patch or reverting version fixes these errors
After updating, which still requires the patch (patch was updated to point at the new location under binding), I now get an out of memory error on my azure dev ops pipeline. This doesn't happen locally, so really we can assume it's nothing to do with Realm, but this only happened once I updated to this version. This also doesn't happen all of the time, for example two or three builds passed this morning, but 10+ others have failed.
Related yarn issue: yarnpkg/berry#3972
Error:
➤ YN0001: │ Error: Couldn't allocate enough memory
at ZipFS.getBufferAndClose ([worker eval]:1:298046)
at ZipFS.saveAndClose ([worker eval]:1:299036)
at convertToZipWorker ([worker eval]:1:407956)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async MessagePort.<anonymous> ([worker eval]:1:409728)
Slightly different error (happened one time):
➤ YN0001: │ Error: realm@patch:realm@npm%3A12.11.1#~/.yarn/patches/realm-npm-12.11.1-b36e6a8058.patch::version=12.11.1&hash=2908f6: Couldn't allocate enough memory
at Xi.getBufferAndClose (/home/vsts/work/1/s/.yarn/releases/yarn-4.3.1.cjs:149:196025)
at Xi.saveAndClose (/home/vsts/work/1/s/.yarn/releases/yarn-4.3.1.cjs:149:197010)
at _v.patchPackage (/home/vsts/work/1/s/.yarn/releases/yarn-4.3.1.cjs:710:1879)
at async v (/home/vsts/work/1/s/.yarn/releases/yarn-4.3.1.cjs:199:1576)
at async x (/home/vsts/work/1/s/.yarn/releases/yarn-4.3.1.cjs:199:1916)
at async C (/home/vsts/work/1/s/.yarn/releases/yarn-4.3.1.cjs:199:3253)
at async Nr.fetchPackageFromCache (/home/vsts/work/1/s/.yarn/releases/yarn-4.3.1.cjs:199:3374)
at async _v.fetch (/home/vsts/work/1/s/.yarn/releases/yarn-4.3.1.cjs:710:1060)
at async fE.fetch (/home/vsts/work/1/s/.yarn/releases/yarn-4.3.1.cjs:141:463)
at async /home/vsts/work/1/s/.yarn/releases/yarn-4.3.1.cjs:210:11866
Pipeline .yml (fails at Install dependencies):
name: $(date:yyyyMMdd)$(rev:.r)
pr:
- master
stages:
- stage: Build
jobs:
jobs:
- job: ci
displayName: React Native CI
pool:
vmImage: ubuntu-latest
steps:
- checkout: self
fetchDepth: 1
- task: NodeTool@0
displayName: Set up node version
inputs:
versionSource: 'spec'
versionSpec: '>=18'
- task: CmdLine@2
displayName: Install dependencies
inputs:
script: |
yarn install --immutable
- task: CmdLine@2
displayName: Run tests
inputs:
script: |
yarn test --forceExit
I tried multiple different things to fix this, including setting NODE_OPTIONS to --max-old-space-size=6144 (ado agents have 7gb memory), changing node version, yarn version etc.
Separate 12.11.1 issue
I tried reverting to yarn 3.6.4 (the version used by new react native projects), and on this version, running yarn install causes it to "load" forever locally. This doesn't happen when trying yarn 3.6.4 on version 12.10.0
Stacktrace & log output
See description
Can you reproduce the bug?
Always
Reproduction Steps
I can always reproduce the lint error. The yarn memory error is inconsistent.
tmac24utm
changed the title
Lint error with 12.10.0 and yarn errors with 12.11.1
Gradle lint error with 12.10.0 and yarn errors with 12.11.1
Jul 11, 2024
I now get an out of memory error on my azure dev ops pipeline.
This could be due to the fact that we're now including more (and larger) prebuilt binaries in the archive uploaded to NPM since v12.11.0.
My suggestions would be to either:
beef up the machine on CI if possible
try upgrading yarn to the latest version if you're not already, in case they've fixed a memory issue regarding the unarchiving of the archive downloaded from NPM.
switch to a different package manager that has a better memory footprint when unarchiving.
How frequently does the bug occur?
Always
Description
Let me preface by saying I assume this must be an issue with my setup, or there would be more reports. However, I can't seem to get by the lint error and it appears to be the patch for this that causes the other errors.
package.json
Issue on Version 12.10.0
I get a lint error when running gradle build.
Error:
Patch:
Issue on Version 12.11.1
Removing the patch or reverting version fixes these errors
After updating, which still requires the patch (patch was updated to point at the new location under
binding
), I now get an out of memory error on my azure dev ops pipeline. This doesn't happen locally, so really we can assume it's nothing to do with Realm, but this only happened once I updated to this version. This also doesn't happen all of the time, for example two or three builds passed this morning, but 10+ others have failed.Related yarn issue: yarnpkg/berry#3972
Error:
Slightly different error (happened one time):
Pipeline .yml (fails at
Install dependencies
):I tried multiple different things to fix this, including setting
NODE_OPTIONS
to--max-old-space-size=6144
(ado agents have 7gb memory), changing node version, yarn version etc.Separate 12.11.1 issue
I tried reverting to yarn 3.6.4 (the version used by new react native projects), and on this version, running
yarn install
causes it to "load" forever locally. This doesn't happen when trying yarn 3.6.4 on version 12.10.0Stacktrace & log output
Can you reproduce the bug?
Always
Reproduction Steps
I can always reproduce the lint error. The yarn memory error is inconsistent.
To reproduce the lint error
npx @react-native-community/cli@latest init AwesomeProject
cd AwesomeProject
yarn add realm
cd android
./gradlew build
To reproduce the yarn error
I assume this is a similar error, it just spins forever on install
npx @react-native-community/cli@latest init AwesomeProject
cd AwesomeProject
yarn set version 3.6.4
(despite making a brand new project, my yarn version was set to 4.3.1. I'm sure this is a whole other issue)yarn add realm
ADO Error
npx @react-native-community/cli@latest init AwesomeProject
cd AwesomeProject
yarn add realm
yarn patch realm
Version
12.10.0 & 12.11.1
What services are you using?
Local Database only
Are you using encryption?
No
Platform OS and version(s)
macOS 14.5
Build environment
Yarn: 4.3.1
Gradle: 8.6
Cocoapods version
1.15.2
The text was updated successfully, but these errors were encountered: