-
-
Notifications
You must be signed in to change notification settings - Fork 853
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Android New Architecture Build Issues #3511
Comments
Update to this - I receive the same error even when not overriding a mapbox version. |
@connorpmullins looking at first error:
We do have
in RNMBXPointAnnotationModule.kt and there is the generated
in NativeRNMBXPointAnnotationModuleSpec.java. So looks like the kotlin and java definition doesn't match. Might be a compiler version or kotlin settings issue. |
Can you check your ? maps/android/src/main/old-arch/com/rnmapbox/rnmbx/NativeRNMBXPointAnnotationModuleSpec.java Lines 37 to 39 in 7d72add
Seems like it's related to #3527 |
Hey Miklós - here's my NativeRNMBXPointAnnotationModuleSpec.java (after upgrading to
The issue is still occurring on the most recent release |
@connorpmullins interesting, what is your react-native release? Also are you running autogenerate? How come the module spec NativeRNMBXPointAnnotationModuleSpec.java is different than in our source code? |
0.73.6! And how can I check if I'm running auto-generate? Sorry to not be of more help, but I'm not sure why the module spec is different. I've wiped and re-installed node modules, cleaned android, attempted to match our app (and our shared sandbox app) to the react native docs, and am still getting the above. |
@connorpmullins sorry I cannot help. maps/android/src/main/old-arch/com/rnmapbox/rnmbx/NativeRNMBXPointAnnotationModuleSpec.java Lines 37 to 40 in 32b7ce4
in your fork you have - public abstract void refresh(@Nullable Integer viewRef, Promise promise);
+ public abstract void refresh(@Nullable Double viewRef, Promise promise); Ok I see. This is old version of our code, the latest version of our code supports only RN 0.74 in the new arch. So either you use our code before https://github.com/rnmapbox/maps/releases/tag/v10.1.21 with RN 0.73 on new arch. Or upgrade to RN 0.74 and use the latest version of our code. |
Hello @mfazekas, I have the error with the updateCameraStop, it appears only when I activate the new architecture. updateCameraStop Error: Exception in HostFunction: no non-static method "Lcom/rnmapbox/rnmbx/components/camera/RNMBXCameraModule;.updateCameraStop(Ljava/lang/Double;Lcom/facebook/react/bridge/ReadableMap;Lcom/facebook/react/bridge/Promise;)V" package "@rnmapbox/maps": "10.1.27", node_modules - RNMBXCameraModule.kt package com.rnmapbox.rnmbx.components.camera
import com.facebook.react.bridge.Callback
import com.facebook.react.bridge.Promise
import com.facebook.react.bridge.ReactApplicationContext
import com.facebook.react.bridge.ReadableArray
import com.facebook.react.bridge.ReadableMap
import com.facebook.react.bridge.WritableMap
import com.facebook.react.bridge.WritableNativeMap
import com.rnmapbox.rnmbx.NativeRNMBXCameraModuleSpec
import com.rnmapbox.rnmbx.components.mapview.CommandResponse
import com.rnmapbox.rnmbx.utils.ViewTagResolver
class RNMBXCameraModule(context: ReactApplicationContext, val viewTagResolver: ViewTagResolver) : NativeRNMBXCameraModuleSpec(context) {
private fun withViewportOnUIThread(
viewRef: Double?,
reject: Promise,
fn: (RNMBXCamera) -> Unit
) {
if (viewRef == null) {
reject.reject(Exception("viewRef is null"))
} else {
viewTagResolver.withViewResolved(viewRef.toInt(), reject, fn)
}
}
private fun createCommandResponse(promise: Promise): CommandResponse = object : CommandResponse {
override fun success(builder: (WritableMap) -> Unit) {
val payload: WritableMap = WritableNativeMap()
builder(payload)
promise.resolve(payload)
}
override fun error(message: String) {
promise.reject(Exception(message))
}
}
companion object {
const val NAME = "RNMBXCameraModule"
}
override fun updateCameraStop(viewRef: Double?, stop: ReadableMap, promise: Promise) {
withViewportOnUIThread(viewRef, promise) {
it.updateCameraStop(stop)
promise.resolve(null)
}
}
} |
i tried modify in android\gradle.properties
and it worked |
Environment
Steps to reproduce
Set up a bare-bones react native app with the following package.json:
Then attempt to build Android using the new architecture and mapbox v11.
After doing that, I receive the following build errors:
@mfazekas - I have pushed the code required to replicate this to the
v11Sandbox
branch of our shared repository if you are interested in easily replicating the issue. I believe it's generalizable beyond our repo.Worth noting: this issue does NOT exist in version 10.1.19. I can't downgrade to 10.1.19, however, as iOS newArch apps have build issues with v11 on that release.
The text was updated successfully, but these errors were encountered: