Skip to content

Commit

Permalink
fix: Use the *OnLoad init func now
Browse files Browse the repository at this point in the history
  • Loading branch information
mrousavy committed Jan 15, 2025
1 parent 8ff2777 commit 66e1948
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions docs/docs/nitrogen.md
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ Inside `NitroMathPackage.java`, add:
public class NitroMathPackage extends TurboReactPackage {
// ...
static {
System.loadLibrary("NitroMath");
NitroMathOnLoad.initializeNative();
}
}
```
Expand All @@ -319,7 +319,7 @@ class MainApplication {
// ...
companion object {
init {
System.loadLibrary("NitroMath")
NitroMathOnLoad.initializeNative()
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ std::shared_ptr<HybridObject> HybridObjectRegistry::createHybridObject(const std
std::string(hybridObjectName) +
"` on this platform.\n"
"- If you use Nitrogen, make sure your library (*Package.java)/app (MainApplication.java) calls "
"`System.loadLibrary(\"$$androidCxxLibName$$\")` somewhere on app-startup.\n"
"`$$androidCxxLibName$$OnLoad.initializeNative()` somewhere on app-startup.\n"
"- If you use Nitrogen, make sure your cpp-adapter.cpp calls `margelo::nitro::$$cxxNamespace$$::initialize(vm)`.\n"
"- If you use Nitrogen, inspect the generated `$$androidCxxLibName$$OnLoad.cpp` file.\n"
"- If you don't use Nitrogen, make sure you called `HybridObjectRegistry.registerHybridObject(...)`.";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ public ReactModuleInfoProvider getReactModuleInfoProvider() {
}

static {
System.loadLibrary("$$androidCxxLibName$$");
$$androidCxxLibName$$OnLoad.initializeNative();
}
}

0 comments on commit 66e1948

Please sign in to comment.