github mrousavy/nitro v0.35.0
Release 0.35.0

12 hours ago

0.35.0 (2026-03-04)

❗️ Breaking Change

#1238 is the first breaking change after >1 year in Nitro. Unfortunately it is necessary, as it fixes a critical memory leak in Kotlin HybridObjects.

  • For app developers: Try upgrading to Nitro 0.35.x and attempt a build. If it fails due to anything looking like super.updateNative(...), JHybridObject, HybridBase, or AnyMapHolder, the Nitro library you are using needs to update to Nitro 0.35.x as well and re-generate their specs. Swift and C++ libraries will work fine, only Kotlin HybridObjects have a breaking change.
  • For library authors: Upgrade to Nitro 0.35.x (and nitrogen 0.35.x), and re-generate your specs. Follow these steps to migrate your library:
    1. Re-generating specs will automatically make your library compatible and implements the JHybridObject change.
    2. If you use bigint in your specs, replace it with either Int64 or UInt64:
       interface Math extends HybridObject<...> {
      -  calculateFibonacci(n: bigint): bigint
      +  calculateFibonacci(n: UInt64): UInt64
       }
      See #1212 for more information.
    3. Replace your JNI initialization (cpp-adapter.cpp or JNIOnLoad.cpp) with this:
       JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void*) {
      -  return margelo::nitro::$$androidNamespace$$::initialize(vm);
      +  return facebook::jni::initialize(vm, []() {
      +    margelo::nitro::$$androidNamespace$$::registerAllNatives();
      +  });
       }
    As an example, take a look at react-native-nitro-image: PR #103 for a guideline on how to upgrade.

🐛 Bug Fixes

  • Remove a bunch of deprecated APIs (#1245) (0cd8eea)
  • Don't strip HybridSomeExternalObject (f9da753)
  • Fix Kotlin HybridObject jni::global_ref memory leak by separating CxxPart with weak_ptr (#1238) (32a4c86), closes #1239

Don't miss a new nitro release

NewReleases is sending notifications on new releases.