fix: new NativeEventEmitter() was called with a non-null argument #3869
Conversation
…hout the required XX method
|
patch:
diff --git a/node_modules/@rnmapbox/maps/android/src/main/java/com/rnmapbox/rnmbx/modules/RNMBXLocationModule.kt b/node_modules/@rnmapbox/maps/android/src/main/java/com/rnmapbox/rnmbx/modules/RNMBXLocationModule.kt
index 7c87fc2..5d78df7 100644
--- a/node_modules/@rnmapbox/maps/android/src/main/java/com/rnmapbox/rnmbx/modules/RNMBXLocationModule.kt
+++ b/node_modules/@rnmapbox/maps/android/src/main/java/com/rnmapbox/rnmbx/modules/RNMBXLocationModule.kt
@@ -132,12 +132,12 @@ class RNMBXLocationModule(reactContext: ReactApplicationContext) :
}
@ReactMethod
- fun addListener(eventName: String?) {
+ override fun addListener(eventName: String?) {
// Required for rn built in EventEmitter Calls.
}
@ReactMethod
- fun removeListeners(count: Int?) {
+ override fun removeListeners(count: Int?) {
// Required for rn built in EventEmitter Calls.
}
diff --git a/node_modules/@rnmapbox/maps/android/src/main/old-arch/com/rnmapbox/rnmbx/NativeRNMBXLocationModuleSpec.java b/node_modules/@rnmapbox/maps/android/src/main/old-arch/com/rnmapbox/rnmbx/NativeRNMBXLocationModuleSpec.java
index e5db5cb..cf854f7 100644
--- a/node_modules/@rnmapbox/maps/android/src/main/old-arch/com/rnmapbox/rnmbx/NativeRNMBXLocationModuleSpec.java
+++ b/node_modules/@rnmapbox/maps/android/src/main/old-arch/com/rnmapbox/rnmbx/NativeRNMBXLocationModuleSpec.java
@@ -65,4 +65,12 @@ public abstract class NativeRNMBXLocationModuleSpec extends ReactContextBaseJava
@ReactMethod
@DoNotStrip
public abstract void setLocationEventThrottle(double throttle);
+
+ @ReactMethod
+ @DoNotStrip
+ public abstract void addListener(String eventName);
+
+ @ReactMethod
+ @DoNotStrip
+ public abstract void removeListeners(Integer count);
} |
|
Nice one, Hopefully someone take a look on this |
|
+1 |
fresnel-bruno
left a comment
There was a problem hiding this comment.
I don't fully understand the fix
but looks like it's ok
|
@fresnel-bruno it’s a common pattern with the event emitters, if you search for the keywords on github you will find out that this is how they are handled on other packages too. |
Using this patch gives compilation error |
|
@allthetime which react-native version? fabric or paper? |
|
@efstathiosntonas thanks much for the PR, looks good to me Can you please rebase, so CI can run? |
|
Hi @mfazekas, will rebase in a while. Just booting the app showed the warnings in the console, nothing special. |
* [android] add easeTo, moveBy and scaleBy using screen coordinates * cleanup * [ios] add easeTo, moveBy and scaleBy using screen coordinates * update docs * align ios camera animation mode to androids numeric values * fix: nonnull error on ios * final adjustments * fix missing nonnull * rm easeTo * update docs
…nmapbox#3908) * up mapbox to 11.13.4 * update lockfiles, update @types/react * update generated and update node to node 22
…cation (rnmapbox#3838) * fix(android): prevent crash in old architecture when updating user location * fix(android): move update location callback from auto generated code * Update android/src/main/java/com/rnmapbox/rnmbx/modules/RNMBXLocationModule.kt --------- Co-authored-by: Miklós Fazekas <mfazekas@szemafor.com>
…nmapbox#3890) This bug appears using the new react architecture. This is because of the id allowOverlap = RNMBXConvertFollyDynamicToId(newProps.allowOverlap); conversions that returns a pointer that is always true instead of the value of the pointed object according to rnmapbox#3730
* fix(android): ignore camera padding for marker view * fix(android): mapbox 10 build error (due to cameraIgnorePadding option)
* feat: Upgrade example project to React Native 0.80.2 ## Changes ### Dependencies - Upgrade React Native from 0.79.1 to 0.80.2 - Upgrade React from 19.0.0 to 19.1.0 (required for RN 0.80) - Upgrade React Native CLI to 19.0.0 - Upgrade all @react-native/* packages to 0.80.2 - Upgrade react-native-screens to 4.13.1 for RN 0.80 compatibility ### Android - Update Kotlin version to 2.1.20 (RN 0.80 recommended) - Update Gradle to 8.14.1 - Fix nullability issues in 20+ Kotlin files for stricter type checking - Update MainApplication.kt to use loadReactNative() instead of SoLoader - Add proper null checks with error logging throughout codebase ### iOS - Enable bridgeless mode in AppDelegate.mm - Update iOS pods for RN 0.80 compatibility ### Configuration - Update metro.config.js (blacklistRE → blockList) - Enable New Architecture (newArchEnabled=true) - Enable Hermes (hermesEnabled=true) Fixes rnmapbox#3915 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * pnpm -> yarn * run generate * fix: Use correct gradle-wrapper.jar from RN 0.80.2 template * fix(android): Handle nullable sourceLayerID in RNMBXModelLayer for Kotlin 2.1.20 compatibility * fix: Revert pnpm references back to yarn --------- Co-authored-by: Claude <noreply@anthropic.com>
|
@mfazekas just rebased to add some context on the previous comment about reproducing, I use rn@0.79.5 on Paper |
Experiencing this too, main difference is that I'm on fabric (RN 0.79). |
|
Any updates here? @efstathiosntonas @mcastets Also facing the compilation error |
I haven't applied the patch and I just live with the original warning. I don't think it's harmful. |
|
@efstathiosntonas I think most of this PR is already merged? |
|
@mfazekas I think so yeah, feel free to close it |
Description
Fixes on Android:
introduced in this PR: #3789
Checklist
CONTRIBUTING.mdyarn generatein the root folder/exampleapp./example)