0
votes

I try to run my ionic 4 project on android but the build fail.

39 actionable tasks: 10 executed, 29 up-to-date /appionic4/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.

/appionic4/platforms/android/app/src/main/java/plugin/google/maps/PluginMap.java:91: error: cannot find symbol GoogleMap.OnMyLocationClickListener, GoogleMap.OnPoiClickListener, ^ symbol: class OnMyLocationClickListener location: class GoogleMap

/appionic4/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

/appionic4/platforms/android/app/src/main/java/plugin/google/maps/PluginLocationService.java:461: error: cannot find symbol LocationServices.getFusedLocationProviderClient(cordova.getActivity()) ^ symbol: method getFusedLocationProviderClient(Activity) location: class LocationServices

/appionic4/platforms/android/app/src/main/java/plugin/google/maps/PluginLocationService.java:521: error: cannot find symbol LocationServices.getFusedLocationProviderClient(cordova.getActivity()).requestLocationUpdates(locationRequest, new LocationCallback() { ^ symbol: method getFusedLocationProviderClient(Activity) location: class LocationServices

/appionic4/platforms/android/app/src/main/java/plugin/google/maps/PluginMap.java:428: error: cannot find symbol map.setOnMyLocationClickListener(PluginMap.this); ^ symbol: method setOnMyLocationClickListener(PluginMap) location: variable map of type GoogleMap

/appionic4/platforms/android/app/src/main/java/plugin/google/maps/PluginMap.java:846: error: cannot find symbol map.setOnMyLocationClickListener(null); ^ symbol: method setOnMyLocationClickListener() location: variable map of type GoogleMap

/appionic4/platforms/android/app/src/main/java/plugin/google/maps/PluginMap.java:2769: error: method does not override or implement a method from a supertype @Override ^

/appionic4/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

/appionic4/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

/appionic4/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

/appionic4/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

/appionic4/platforms/android/app/src/main/java/plugin/google/maps/PluginStreetViewPanorama.java:281: error: cannot find symbol StreetViewSource.OUTDOOR : StreetViewSource.DEFAULT; ^ symbol: variable StreetViewSource

/appionic4/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. 13 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.

  • 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 5s

How can I fix this ? Thank you!

1
Uninstall and reinstall your google maps plugin. It looks like it wasn't installed correctly: ionic cordova plugin remove cordova-plugin-googlemaps then ionic cordova plugin add cordova-plugin-googlemaps --variable API_KEY_FOR_ANDROID="..." --variable API_KEY_FOR_IOS="..."Ikenna Anthony Okafor
this problem also occurs with ionic 3, I think its a problem with the version of google maps.Rahul Raj

1 Answers

0
votes

this problem also occurs with ionic 3, I think its a problem with the version of google maps. Check the version of the google maps to be used with ionic 4.