Build failed android with error :app:compileDebugJavaWithJavac


#1

I’m trying build app include google maps plugin latest version
please help :confused: I’m trying to solve this problem from yesterday

"@ionic-native/google-maps": "^4.8.2",
"cordova-plugin-googlemaps": "^2.3.6",
"cordova-plugin-googlemaps-sdk": "git+https://github.com/mapsplugin/cordova-plugin-googlemaps-sdk.git#2.7.0",

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
>
Compilation failed; see the compiler error output for details.

* Try:
Run with
--stacktrace option to get the stack trace. Run with --info or
--debug option to get more log output.

* Get more help at https://help.gradle.org

BUILD FAILED in 22s
38 actionable tasks: 38 executed
(node:1267) UnhandledPromiseRejectionWarning: Error: /Users/anspireagency/Desktop/ahmed f/Doctory/platforms/android/gradlew: Command failed with exit code 1 Error output:
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
/Users/anspireagency/Desktop/ahmed f/Doctory/platforms/android/app/src/main/java/plugin/google/maps/PluginMap.java:88: error: cannot find symbol
    GoogleMap.OnMyLocationClickListener, GoogleMap.OnPoiClickListener,
             ^
  symbol:   class OnMyLocationClickListener
  location: class GoogleMap
/Users/anspireagency/Desktop/ahmed f/Doctory/platforms/android/app/src/main/java/plugin/google/maps/PluginStreetViewPanorama.java:17: error: cannot find symbol
import com.google.android.gms.maps.model.StreetViewSource;
                                        ^
  symbol:   class StreetViewSource
  location: package com.google.android.gms.maps.model
/Users/anspireagency/Desktop/ahmed f/Doctory/platforms/android/app/src/main/java/plugin/google/maps/PluginMap.java:413: error: cannot find symbol
              map.setOnMyLocationClickListener(PluginMap.this);
                 ^
  symbol:   method setOnMyLocationClickListener(PluginMap)
  location: variable map of type GoogleMap
/Users/anspireagency/Desktop/ahmed f/Doctory/platforms/android/app/src/main/java/plugin/google/maps/PluginMap.java:832: error: cannot find symbol
                  map.setOnMyLocationClickListener(null);
                     ^
  symbol:   method setOnMyLocationClickListener(<null>)
  location: variable map of type GoogleMap
/Users/anspireagency/Desktop/ahmed f/Doctory/platforms/android/app/src/main/java/plugin/google/maps/PluginMap.java:2571: error: method does not override or implement a method from a supertype
  @Override
  ^
/Users/anspireagency/Desktop/ahmed f/Doctory/platforms/android/app/src/main/java/plugin/google/maps/PluginStreetViewPanorama.java:87: error: cannot find symbol
          StreetViewSource source = "OUTDOOR".equals(cameraOpts.getString("source")) ?
          ^
  symbol:   class StreetViewSource
  location: class PluginStreetViewPanorama
/Users/anspireagency/Desktop/ahmed f/Doctory/platforms/android/app/src/main/java/plugin/google/maps/PluginStreetViewPanorama.java:88: error: cannot find symbol
              StreetViewSource.OUTDOOR : StreetViewSource.DEFAULT;
              ^
  symbol:   variable StreetViewSource
  location: class PluginStreetViewPanorama
/Users/anspireagency/Desktop/ahmed f/Doctory/platforms/android/app/src/main/java/plugin/google/maps/PluginStreetViewPanorama.java:88: error: cannot find symbol
              StreetViewSource.OUTDOOR : StreetViewSource.DEFAULT;
                                         ^
  symbol:   variable StreetViewSource
  location: class PluginStreetViewPanorama
/Users/anspireagency/Desktop/ahmed f/Doctory/platforms/android/app/src/main/java/plugin/google/maps/PluginStreetViewPanorama.java:280: error: cannot find symbol
              StreetViewSource source = "OUTDOOR".equals(cameraOpts.getString("source")) ?
              ^
  symbol: class StreetViewSource
/Users/anspireagency/Desktop/ahmed f/Doctory/platforms/android/app/src/main/java/plugin/google/maps/PluginStreetViewPanorama.java:281: error: cannot find symbol
                  StreetViewSource.OUTDOOR : StreetViewSource.DEFAULT;
                  ^
  symbol: variable StreetViewSource
/Users/anspireagency/Desktop/ahmed f/Doctory/platforms/android/app/src/main/java/plugin/google/maps/PluginStreetViewPanorama.java:281: error: cannot find symbol
                  StreetViewSource.OUTDOOR : StreetViewSource.DEFAULT;
                                             ^
  symbol: variable StreetViewSource
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.
11 errors

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

#2

#3

thank you for the help
i have one more issue in google map that i can’t access any callback variable to display position
i’m getting data from HTTP request including latitude and longitude
i can make a callback to lat and long in any another function except DisplayMap()
i tried to console.log() them outside DisplayMap() and the output was 29.601280 , 30.810670
i tried to console.log() them inside DisplayMap() and the output was undefined
can you help me, please

DisplayMap() {

      let mapOptions: GoogleMapOptions = {
      camera: {
         target: {
           lat: this.ClinicData.lat,
           lng : this.ClinicData.long
         },
         zoom: 18,
         tilt: 30
       }
  };

    this.map = GoogleMaps.create('map_canvas', mapOptions);

    let marker: Marker = this.map.addMarkerSync({
      title: 'Ionic',
      icon: 'icon',
      animation: 'DROP',
      position: {
        lat: this.ClinicData.lat,
        lng : this.ClinicData.long
      }
    });
    marker.on(GoogleMapsEvent.MARKER_CLICK).subscribe(() => {
      alert('clicked');
    });
   }