fqborges / react-native-maps-osmdroid

React Native Mapview component for iOS + Android
MIT License
67 stars 22 forks source link

Build error method MapView.zoomToBoundingBox(BoundingBox,boolean) is not applicable #1

Closed Peretz30 closed 5 years ago

Peretz30 commented 5 years ago

I had this error after execution of command react-native run-android

Task :react-native-maps-osmdroid:compileDebugJavaWithJavac FAILED
/Volumes/HDD/Projects/React Native/kedr0.57/git/mobile/node_modules/react-native-maps-osmdroid/lib/android/src/main/java/com/airbnb/android/react/maps/osmdroid/OsmMapView.java:34: error: cannot find symbol
import org.osmdroid.views.CustomZoomButtonsController;
                         ^
  symbol:   class CustomZoomButtonsController
  location: package org.osmdroid.views
/Volumes/HDD/Projects/React Native/kedr0.57/git/mobile/node_modules/react-native-maps-osmdroid/lib/android/src/main/java/com/airbnb/android/react/maps/osmdroid/OsmMapView.java:116: error: package CustomZoomButtonsController does not exist
        this.getZoomController().setVisibility(CustomZoomButtonsController.Visibility.NEVER);
                                                                          ^
/Volumes/HDD/Projects/React Native/kedr0.57/git/mobile/node_modules/react-native-maps-osmdroid/lib/android/src/main/java/com/airbnb/android/react/maps/osmdroid/OsmMapView.java:116: error: cannot find symbol
        this.getZoomController().setVisibility(CustomZoomButtonsController.Visibility.NEVER);
            ^
  symbol: method getZoomController()
/Volumes/HDD/Projects/React Native/kedr0.57/git/mobile/node_modules/react-native-maps-osmdroid/lib/android/src/main/java/com/airbnb/android/react/maps/osmdroid/OsmMapView.java:254: error: cannot find symbol
            double zoom = getTileSystem().getBoundingBoxZoom(bounds, width, height);
                          ^
  symbol:   method getTileSystem()
  location: class OsmMapView
/Volumes/HDD/Projects/React Native/kedr0.57/git/mobile/node_modules/react-native-maps-osmdroid/lib/android/src/main/java/com/airbnb/android/react/maps/osmdroid/OsmMapView.java:380: error: no suitable method found for animateTo(IGeoPoint,double,long,Float)
            this.getController().animateTo(center, zoom, (long) duration, bearing);
                                ^
    method IMapController.animateTo(IGeoPoint) is not applicable
      (actual and formal argument lists differ in length)
    method IMapController.animateTo(int,int) is not applicable
      (actual and formal argument lists differ in length)
/Volumes/HDD/Projects/React Native/kedr0.57/git/mobile/node_modules/react-native-maps-osmdroid/lib/android/src/main/java/com/airbnb/android/react/maps/osmdroid/OsmMapView.java:400: error: cannot find symbol
                double zoom = getTileSystem().getBoundingBoxZoom(boundsToMove, width, height);
                              ^
  symbol:   method getTileSystem()
  location: class OsmMapView
/Volumes/HDD/Projects/React Native/kedr0.57/git/mobile/node_modules/react-native-maps-osmdroid/lib/android/src/main/java/com/airbnb/android/react/maps/osmdroid/OsmMapView.java:414: error: no suitable method found for zoomToBoundingBox(BoundingBox,boolean,int,double,long)
            this.zoomToBoundingBox(bounds, true, 0, getMaxZoomLevel(), (long) duration);
                ^
    method MapView.zoomToBoundingBox(BoundingBox,boolean) is not applicable
      (actual and formal argument lists differ in length)
    method MapView.zoomToBoundingBox(BoundingBox,boolean,int) is not applicable
      (actual and formal argument lists differ in length)
/Volumes/HDD/Projects/React Native/kedr0.57/git/mobile/node_modules/react-native-maps-osmdroid/lib/android/src/main/java/com/airbnb/android/react/maps/osmdroid/OsmMapView.java:420: error: no suitable method found for animateTo(IGeoPoint,double,long,float)
        this.getController().animateTo(getMapCenter(),getZoomLevelDouble(), (long) duration, bearing);
                            ^
    method IMapController.animateTo(IGeoPoint) is not applicable
      (actual and formal argument lists differ in length)
    method IMapController.animateTo(int,int) is not applicable
      (actual and formal argument lists differ in length)
/Volumes/HDD/Projects/React Native/kedr0.57/git/mobile/node_modules/react-native-maps-osmdroid/lib/android/src/main/java/com/airbnb/android/react/maps/osmdroid/OsmMapView.java:425: error: no suitable method found for animateTo(IGeoPoint,double,long)
        this.getController().animateTo(coordinate, getZoomLevelDouble(), (long) duration);
                            ^
    method IMapController.animateTo(IGeoPoint) is not applicable
      (actual and formal argument lists differ in length)
    method IMapController.animateTo(int,int) is not applicable
      (actual and formal argument lists differ in length)
/Volumes/HDD/Projects/React Native/kedr0.57/git/mobile/node_modules/react-native-maps-osmdroid/lib/android/src/main/java/com/airbnb/android/react/maps/osmdroid/OsmMapView.java:432: error: no suitable method found for zoomToBoundingBox(BoundingBox,boolean,int,double,<null>)
        this.zoomToBoundingBox(bounds, animated, padding, getMaxZoomLevel(), null);
            ^
    method MapView.zoomToBoundingBox(BoundingBox,boolean) is not applicable
      (actual and formal argument lists differ in length)
    method MapView.zoomToBoundingBox(BoundingBox,boolean,int) 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.
10 errors

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':react-native-maps-osmdroid:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

react-native-maps-osmdroid: 0.23.0-rc2 react-native: 0.57.7 react: 16.6.1

fqborges commented 5 years ago

I did change a bit between RC0 and RC1 versions, now the default provider on Android is osmdroid, with a default version (6.0.3) chosen. This version can be changed using the project wide variable osmdroidVersion, e.g. { osmdroidVersion = '6.0.3' }, in your top-level build.gradle.

Please, verify what osmdroid version you have on the project. Despite the number, there are breaking changes between 6.01 (previous used version) and 6.0.3 (current version).

Peretz30 commented 5 years ago

@fqborges that's worked! Thanks!