无法在我的专案中执行react-native-maps

ahd786

我正在尝试在我的项目中安装react-native-maps并遵循https://github.com/react-native-community/react-native-maps/blob/master/docs/installation.md中给出的说明但是在Android中运行项目后,仍然出现错误,并且显示UIBlock的错误,该错误出现在Android Studio的react-native-maps的AirMapModule.java中。有人可以帮我吗?

这是我的项目的版本:

  "react": "16.6.1",
  "react-native": "^0.59.2",
  "react-native-maps": "^0.23.0"

这是我得到的错误:

                                   ^
  symbol:   class UIBlock
  location: package com.facebook.react.uimanager
D:\Maps\Project\node_modules\react-native-maps\lib\android\src\main\java\com\airbnb\android\react\maps\AirMapView.java:129: error: getCurrentActivity() is not public in ReactContext; cannot be accessed from outside package
    if (!contextHasBug(appContext.getCurrentActivity())) {
                                 ^
D:\Maps\Project\node_modules\react-native-maps\lib\android\src\main\java\com\airbnb\android\react\maps\AirMapView.java:130: error: getCurrentActivity() is not public in ReactContext; cannot be accessed from outside package
      superContext = appContext.getCurrentActivity();
                               ^
D:\Maps\Project\node_modules\react-native-maps\lib\android\src\main\java\com\airbnb\android\react\maps\AirMapView.java:133: error: cannot find symbol
      if (!contextHasBug(reactContext.getCurrentActivity())) {
                                     ^
  symbol:   method getCurrentActivity()
  location: variable reactContext of type ThemedReactContext
D:\Maps\Project\node_modules\react-native-maps\lib\android\src\main\java\com\airbnb\android\react\maps\AirMapView.java:134: error: cannot find symbol
        superContext = reactContext.getCurrentActivity();
                                   ^
  symbol:   method getCurrentActivity()
  location: variable reactContext of type ThemedReactContext
D:\Maps\Project\node_modules\react-native-maps\lib\android\src\main\java\com\airbnb\android\react\maps\ViewAttacherGroup.java:23: error: cannot find symbol
    this.setOverflow("hidden"); // Change to ViewProps.HIDDEN until RN 0.57 is base
        ^
  symbol: method setOverflow(String)
D:\Maps\Project\node_modules\react-native-maps\lib\android\src\main\java\com\airbnb\android\react\maps\AirMapMarkerManager.java:127: error: method does not override or implement a method from a supertype
  @Override
  ^
D:\Maps\Project\node_modules\react-native-maps\lib\android\src\main\java\com\airbnb\android\react\maps\AirMapMarkerManager.java:130: error: cannot find symbol
    super.setZIndex(view, zIndex);
         ^
  symbol: method setZIndex(AirMapMarker,float)
D:\Maps\Project\node_modules\react-native-maps\lib\android\src\main\java\com\airbnb\android\react\maps\AirMapModule.java:90: error: cannot find symbol
    uiManager.addUIBlock(new UIBlock() {
                             ^
  symbol:   class UIBlock
  location: class AirMapModule
D:\Maps\Project\node_modules\react-native-maps\lib\android\src\main\java\com\airbnb\android\react\maps\AirMapModule.java:149: error: cannot find symbol
    uiManager.addUIBlock(new UIBlock()
                             ^
  symbol:   class UIBlock
  location: class AirMapModule
D:\Maps\Project\node_modules\react-native-maps\lib\android\src\main\java\com\airbnb\android\react\maps\AirMapModule.java:192: error: cannot find symbol
    uiManager.addUIBlock(new UIBlock()
                             ^
  symbol:   class UIBlock
  location: class AirMapModule
D:\Maps\Project\node_modules\react-native-maps\lib\android\src\main\java\com\airbnb\android\react\maps\AirMapModule.java:229: error: cannot find symbol
    uiManager.addUIBlock(new UIBlock()
                             ^
  symbol:   class UIBlock
  location: class AirMapModule
D:\Maps\Project\node_modules\react-native-maps\lib\android\src\main\java\com\airbnb\android\react\maps\AirMapModule.java:262: error: cannot find symbol
    uiManager.addUIBlock(new UIBlock()
                             ^
  symbol:   class UIBlock
  location: class AirMapModule
D:\Maps\Project\node_modules\react-native-maps\lib\android\src\main\java\com\airbnb\android\react\maps\RegionChangeEvent.java:15: error: no suitable constructor found for Event(int)
    super(id);
    ^
    constructor Event.Event() is not applicable
      (actual and formal argument lists differ in length)
    constructor Event.Event(int,long) is not applicable
      (actual and formal argument lists differ in length)
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
14 errors```
杰克

尝试按照以下说明拆分您的Maven相关性:

allprojects {
repositories {
    mavenLocal()
    jcenter()
    maven {
        // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
        url "$rootDir/../node_modules/react-native/android"
    }
    maven {
        url "https://maven.google.com"
    }
}

}

https://github.com/react-native-community/react-native-maps/issues/2090

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

React Native Maps followUserLocation坐标

来自分类Dev

无法从 react-native-maps 渲染 <MapView/>

来自分类Dev

无法在React Native WebView中打开Google Maps

来自分类Dev

无法在React Native WebView中打开Google Maps

来自分类Dev

如何在React Native中安装React Native Maps?

来自分类Dev

从react-native-maps启动Google Maps应用

来自分类Dev

react-native-maps构建失败

来自分类Dev

React Native:添加Google Maps SDK

来自分类Dev

React-Native-Maps JSON标记示例

来自分类Dev

React Native Maps - 空对象参考

来自分类Dev

React-native-maps 安装失败

来自分类Dev

React-native构建错误:任务':react-native-maps:prepareComAndroidSupportAppApppatV72301Library'的执行失败。>无法展开ZIP

来自分类Dev

无法从React Native Maps使用功能hideCallout

来自分类Dev

Tab 中的 react-native-maps 不起作用

来自分类Dev

如何在React Native Android中实现Google Map(React-Native-Maps)

来自分类Dev

在 react-native 和 redux 以及 react-native-maps 中处理多请求

来自分类Dev

在React Navigation上更新react-native-maps

来自分类Dev

react-native-maps-多边形onPress事件

来自分类Dev

加载后如何打开React Native Maps标记的标注

来自分类Dev

react-native-maps 标记未显示在地图上

来自分类Dev

使用 forEach 显示来自 React Native Maps 的标记

来自分类Dev

react-native 0.19.0的react-native-maps集成问题

来自分类Dev

React native:安装react-native-maps后不存在android文件夹

来自分类Dev

如何在 react-native 中使用 react-native -maps

来自分类Dev

无法评估模块“ react-native-maps”:找不到名称为“ default”的配置

来自分类Dev

在配置react-native-maps中获取“ supportLibVersion”,“ playServicesVersion”和“ androidMapsUtilsVersion”值

来自分类Dev

如何将坐标数组映射到React Native Maps Markers中?

来自分类Dev

React-native Airbnb-Maps:如何在 airbnb 地图弹出框中呈现按钮?

来自分类Dev

为什么 onPress 在 react-native-maps 的标记文档中列为事件?

Related 相关文章

  1. 1

    React Native Maps followUserLocation坐标

  2. 2

    无法从 react-native-maps 渲染 <MapView/>

  3. 3

    无法在React Native WebView中打开Google Maps

  4. 4

    无法在React Native WebView中打开Google Maps

  5. 5

    如何在React Native中安装React Native Maps?

  6. 6

    从react-native-maps启动Google Maps应用

  7. 7

    react-native-maps构建失败

  8. 8

    React Native:添加Google Maps SDK

  9. 9

    React-Native-Maps JSON标记示例

  10. 10

    React Native Maps - 空对象参考

  11. 11

    React-native-maps 安装失败

  12. 12

    React-native构建错误:任务':react-native-maps:prepareComAndroidSupportAppApppatV72301Library'的执行失败。>无法展开ZIP

  13. 13

    无法从React Native Maps使用功能hideCallout

  14. 14

    Tab 中的 react-native-maps 不起作用

  15. 15

    如何在React Native Android中实现Google Map(React-Native-Maps)

  16. 16

    在 react-native 和 redux 以及 react-native-maps 中处理多请求

  17. 17

    在React Navigation上更新react-native-maps

  18. 18

    react-native-maps-多边形onPress事件

  19. 19

    加载后如何打开React Native Maps标记的标注

  20. 20

    react-native-maps 标记未显示在地图上

  21. 21

    使用 forEach 显示来自 React Native Maps 的标记

  22. 22

    react-native 0.19.0的react-native-maps集成问题

  23. 23

    React native:安装react-native-maps后不存在android文件夹

  24. 24

    如何在 react-native 中使用 react-native -maps

  25. 25

    无法评估模块“ react-native-maps”:找不到名称为“ default”的配置

  26. 26

    在配置react-native-maps中获取“ supportLibVersion”,“ playServicesVersion”和“ androidMapsUtilsVersion”值

  27. 27

    如何将坐标数组映射到React Native Maps Markers中?

  28. 28

    React-native Airbnb-Maps:如何在 airbnb 地图弹出框中呈现按钮?

  29. 29

    为什么 onPress 在 react-native-maps 的标记文档中列为事件?

热门标签

归档