react-native-maps: Task :react-native-maps:compileReleaseJavaWithJavac FAILED
Summary
When building React Native 0.70 for Android, it fails with the error:
./node_modules/react-native-maps/android/src/main/java/com/rnmaps/maps/MapUIBlock.java:7: error: package com.facebook.react.fabric.interop does not exist
import com.facebook.react.fabric.interop.UIBlockViewResolver;
^
./node_modules/react-native-maps/android/src/main/java/com/rnmaps/maps/MapUIBlock.java:64: error: package com.facebook.react.fabric.interop does not exist
interface UIBlockInterface extends UIBlock, com.facebook.react.fabric.interop.UIBlock {}
^
./node_modules/react-native-maps/android/src/main/java/com/rnmaps/maps/MapUIBlock.java:35: error: cannot find symbol
public void execute(UIBlockViewResolver uiBlockViewResolver) {
^
symbol: class UIBlockViewResolver
location: class MapUIBlock
./node_modules/react-native-maps/android/src/main/java/com/rnmaps/maps/MapUIBlock.java:39: error: cannot find symbol
private void executeImpl(NativeViewHierarchyManager nvhm, UIBlockViewResolver uiBlockViewResolver) {
^
symbol: class UIBlockViewResolver
location: class MapUIBlock
./node_modules/react-native-maps/android/src/main/java/com/rnmaps/maps/MapUIBlock.java:56: error: cannot find symbol
((FabricUIManager) uiManager).addUIBlock(this);
^
symbol: method addUIBlock(MapUIBlock)
location: class FabricUIManager
This may be related to #5061, which was released in v1.15.5. Was this intended to be a breaking change?
Reproducible sample code
N/A
Steps to reproduce
Install deps:
yarn add react-native-maps react-native@0.70
Build for Android:
react-native run-android --variant=release
Expected result
Android build success
Actual result
Android build error
React Native Maps Version
1.15.6
What platforms are you seeing the problem on?
Android
React Native Version
0.70.15
What version of Expo are you using?
Not using Expo
Device(s)
Android
Additional information
No response
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 1
- Comments: 25 (1 by maintainers)
I resolved an issue using the following setup:
Note:If you are using react-native-reanimated, first check out this link: _https://github.com/software-mansion/react-native-reanimated/issues/6076#issuecomment-2154224601_
React Native version: 0.72.3 react-native-maps version: 1.15.6
The solution involves replacing the MapUIBlock.java file located at node_modules/react-native-maps/android/src/main/java/com/rnmaps/maps/MapUIBlock.java
Here’s the code to use in MapUIBlock.java:
Hello guys there is an something went wrong with Latest Version i change my Maps version 1.15.6 -> 1.14.0 and than clean the build and run again it’s works for me.
here’s what I did to get this working again:
1.15.4npm install./gradlew clean && ./gradlew bundleReleaseExactly. Version 1.14.0 and not ˆ1.14.0 worked for me.
@yogeshBadgujar7 Downgrading from 1.15.6 to 1.14.0 worked for me.
WELDONE BRO. It saved my life , you are a super hero.😍✌
Thanks bro, this code running for my react-native: 0.72.7 - react-native-maps: 1.14.0
Same error is coming. My react native version is 0.73.9 any update on this
Same error is coming. My react native version is 0.73.8 and maps version 1.14.0 and 1.15.4 and it doesn’t work when ues does it. how is it slove
if you use nvm, change version to 1.14.0 then before “yarn install” make “nvm cache clear”
Sadly, the patch version is as a major version change https://github.com/react-native-maps/react-native-maps/issues/5082 and project does not use
peerDependenciesproperlyI just updated the documentations to make this clear compatibility
you need react-native 0.74 and above if you’re using any react-native-maps version above 1.4.0
@Usmanqayyum109 OMG…👍 👀