Closed erwanlpfr closed 12 months ago
@erwanlpfr are you sure you can repro it on a project created with react-native init
? We do support old-arch for sure
@mfazekas As it, I get the issue, you can follow the repro!
Experiencing this issue on Android with 10.1.0-beta.21
. No problems on iOS.
Old arch
Mapbox: 11.0.0-rc.1
expo: 49.0.18
react-native: 0.72.6
rnmapbox/maps: 10.1.0-beta.21
Haven't tested in android, but I get this issue for iOS devices. I have an expo managed project with the following configuration:
[
"@rnmapbox/maps",
{
RNMapboxMapsImpl: "mapbox",
RNMapboxMapsVersion: "11.0.0-beta.5",
RNMapboxMapsDownloadToken:
"sk...",
RNMapboxMapsUseV11: true,
},
],
@rnmapbox/maps: 10.1.0-beta.21
expo: ^49.0.16
react-native: 0.72.4
Can you try with rc? We might not be able with build with beta.5
RNMapboxMapsVersion: "11.0.0-beta.5",
Hello ! With beta 22, I still have the issue :
So with beta22
and mapbox v10
I still can the previous error message.
With beta22
and :
RNMapboxMapsImpl = "mapbox"
RNMapboxMapsVersion = "11.0.0-rc.2"
RNMapboxMapsUseV11 = true
I get :
> Task :rnmapbox_maps:compileDebugKotlin FAILED
Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
See https://docs.gradle.org/8.0.1/userguide/command_line_interface.html#sec:command_line_warnings
825 actionable tasks: 30 executed, 795 up-to-date
info 💡 Tip: Make sure that you have set up your development environment correctly, by running react-native doctor. To read more about doctor command visit: https://github.com/react-native-community/cli/blob/main/packages/cli-doctor/README.md#doctor
e: file:///Users/erwanleprado/Documents/app-user/node_modules/@rnmapbox/maps/android/src/main/java/com/rnmapbox/rnmbx/modules/RNMBXLocationModule.kt:59:51 Type mismatch: inferred type is com.rnmapbox.rnmbx.v11compat.location.Location /* = com.mapbox.common.location.Location */ but com.rnmapbox.rnmbx.v11compat.location.Location /* = android.location.Location */ was expected
e: file:///Users/erwanleprado/Documents/app-user/node_modules/@rnmapbox/maps/android/src/main/java/com/rnmapbox/rnmbx/modules/RNMBXLocationModule.kt:110:59 Type mismatch: inferred type is com.rnmapbox.rnmbx.v11compat.location.Location /* = com.mapbox.common.location.Location */ but com.rnmapbox.rnmbx.v11compat.location.Location /* = android.location.Location */ was expected
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':rnmapbox_maps:compileDebugKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
> Compilation error. See log for more details
Any idea?
Reproducible with the react native init
.
Reproducible with the react native init.
Is it? You're using expo aren't you?!
Have you verified your RNMapboxMapsDownloadToken has the right permissions?
No, no Expo, pure React Native 0.72.7 !
I just retried and here, you can find the repro. It downloads well with my token. It is working in production fine.
npx react-native init sample --version 0.72.7
cd sample
npm i @rnmapbox/maps@10.1.0-beta.22
npx react-native run-android
LOG Running "sample" with {"rootTag":11}
ERROR Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'RNMBXMapViewModule' could not be found. Verify that a module by this name is registered in the native binary., js engine: hermes
at App (http://10.0.2.2:8081/index.bundle//&platform=android&dev=true&minify=false&app=com.sample&modulesOnly=false&runModule=true:122489:54)
at RCTView
at View (http://10.0.2.2:8081/index.bundle//&platform=android&dev=true&minify=false&app=com.sample&modulesOnly=false&runModule=true:59470:43)
at RCTView
at View (http://10.0.2.2:8081/index.bundle//&platform=android&dev=true&minify=false&app=com.sample&modulesOnly=false&runModule=true:59470:43)
at AppContainer (http://10.0.2.2:8081/index.bundle//&platform=android&dev=true&minify=false&app=com.sample&modulesOnly=false&runModule=true:59314:36)
at sample(RootComponent) (http://10.0.2.2:8081/index.bundle//&platform=android&dev=true&minify=false&app=com.sample&modulesOnly=false&runModule=true:108030:28)
ERROR Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'RNMBXMapViewModule' could not be found. Verify that a module by this name is registered in the native binary., js engine: hermes
at App (http://10.0.2.2:8081/index.bundle//&platform=android&dev=true&minify=false&app=com.sample&modulesOnly=false&runModule=true:122489:54)
at RCTView
at View (http://10.0.2.2:8081/index.bundle//&platform=android&dev=true&minify=false&app=com.sample&modulesOnly=false&runModule=true:59470:43)
at RCTView
at View (http://10.0.2.2:8081/index.bundle//&platform=android&dev=true&minify=false&app=com.sample&modulesOnly=false&runModule=true:59470:43)
at AppContainer (http://10.0.2.2:8081/index.bundle//&platform=android&dev=true&minify=false&app=com.sample&modulesOnly=false&runModule=true:59314:36)
at sample(RootComponent) (http://10.0.2.2:8081/index.bundle//&platform=android&dev=true&minify=false&app=com.sample&modulesOnly=false&runModule=true:108030:28)
ERROR TypeError: Cannot read property 'MapView' of undefined
This error is located at:
in App
in RCTView (created by View)
in View (created by AppContainer)
in RCTView (created by View)
in View (created by AppContainer)
in AppContainer
in sample(RootComponent), js engine: hermes
ERROR TypeError: Cannot read property 'MapView' of undefined
This error is located at:
in App
in RCTView (created by View)
in View (created by AppContainer)
in RCTView (created by View)
in View (created by AppContainer)
in AppContainer
in sample(RootComponent), js engine: hermes
It looks like it came from this commit ? https://github.com/rnmapbox/maps/compare/v10.1.0-beta.20...v10.1.0-beta.21#diff-e41dc52beb74b889c738e750118cdb5bb8b3ab2ee412a77b3a248b2b394e1d01R25
Thank you for your work!
EDIT :
Okay, I found my workaround.
In NativeMapViewModuleSpec.java
I added the interface : ReactModuleWithSpec
as removed in the previous commit.
Looks like deprecated as I see on React Native, but it is the fattest workaround.
Maybe, it is specific react native <= 72?
@erwanlpfr thank much, yes so in beta.21 and 22 I've upgraded the codegen to 0.73 and it seems that 0.73 generates code for oldgen that's no longer compatible with 0.72. Ugh.... so even if our example is 0.73 we still need to use 0.72 codegen to generate code that's compatible with older versions.
@erwanlpfr thanks much for the report. 👍
I've release a new beta 23 which should fix the issue
Thanks a lot for taking time on this! 👍🏻
I can confirm that the issue has been resolved in version 10.1.0-beta.23
. Thanks @mfazekas!
@mfazekas This issue still occurs with RN: 0.73.1 and rnmapbox/maps@10.1.3. Any solution for this?
`Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'RNMBXMapViewModule' could not be found. Verify that a module by this name is registered in the native binary.Bridgeless mode: false. TurboModule interop: false. Modules loaded: {"NativeModules":["PlatformConstants","LogBox","Timing","AppState","SourceCode","BlobModule","WebSocketModule","SettingsManager","DevSettings","RedBox","Networking","Appearance","DevLoadingView","UIManager","DeviceInfo","ImageLoader","LinkingManager","RNCSafeAreaContext","I18nManager","NativeAnimatedModule"],"TurboModules":[],"NotFound":["NativePerformanceCxx","NativePerformanceObserverCxx","BugReporting","HeadlessJsTaskSupport","SoundManager","IntentAndroid","RNMBXMapViewModule"]}, js engine: hermes
ERROR Error: Exception in HostObject::get for prop 'RNMBXLocationModule': java.lang.NoClassDefFoundError: Failed resolution of: Lcom/mapbox/android/core/location/LocationEngineCallback;, js engine: hermes`
Can confirm I am getting the same issue for this but I am on v10.1.3-rc.0
I'm facing the same issue in the following environment
I'm getting the same issue with the following:
Can you reproduce with a new project from npx create-expo-app
?! Can you post the steps to reproduce and a link to a repo (pls do not include access tokens).
Got this error too: ERROR Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'RNMBXMapViewModule' could not be found. Verify that a module by this name is registered in the native binary., js engine: hermes
using react native with Expo expo ver: 48.0.21 react native ver: 0.71.14 everything works just fine till I update from @rnmapbox/maps 10.0.15 to @rnmapbox/maps 10.1.5
Can you reproduce with a new project from
npx create-expo-app
?! Can you post the steps to reproduce and a link to a repo (pls do not include access tokens).
steps to reproduce: create account at mapbox...create token with download:read npx create-expo-app MYAPP npm install @rnmapbox/maps add to app.json: "plugins": [ [ "@rnmapbox/maps", { "RNMapboxMapsImpl": "mapbox", "RNMapboxMapsDownloadToken": "sk.", "RNMapboxMapsVersion": "11.0.0", "RNMapboxMapsUseV11": true } ] ] }
make simple component with mapbox:
import React from 'react'; import { StyleSheet, View } from 'react-native'; import Mapbox from '@rnmapbox/maps';
Mapbox.setAccessToken('
const App = () => { return (
); }
export default App;
const styles = StyleSheet.create({ page: { flex: 1, justifyContent: 'center', alignItems: 'center', }, container: { height: 300, width: 300, }, map: { flex: 1 } });
When you try to run it on emulator with: npx expo start --dev-client you will get this crash
I am facing the following issue, Error: @rnmapbox/maps native code not available. Make sure you have linked the library and rebuild your app. See https://rnmapbox.github.io/docs/install?rebuild=expo#rebuild, js engine: hermes
STEPS To fix: 1.npm update
is there any other packages to install
You need to update and after the update do a rebuild to your emulator:
Thanks its working and is there any other steps for production.
For making an apk you use this command: eas build -p android --profile preview
This issue is not yet solved
Same issue here on npx expo run:ios
"@rnmapbox/maps": "^10.1.18",
[
'@rnmapbox/maps',
{
RNMapboxMapsDownloadToken: [SECRET_ACCESS_TOKEN_WITH_DOWNLOAD_PERMISSIONS],
RNMapboxMapsVersion: '11.1.0',
},
]
same issue here.
My fix was opening the project on android, and auto resolving the issue,
to
Environment
Steps to reproduce
Hello!
With :
I get this error after launching the bundler and displaying the map
This happens only with
beta 21
with clear cache. It builds and starts with new arch activated, but my app is not ready yet. I wonder Mapbox is still compatible to old arch?Thank you for your work!
In App.tsx
Additional logs :