![Creative The name of the picture]()
my app is showing blank map
I am using google map api in my app.The map was working perfectly but now it get blanked.Map is still working but not loading the map.I was searching answer for hours but didn't get any results.I have created a new api at google cloud platform and put that api but still not loading the map.
Anyone who can help me with this. Thanks!
Here is the screenshot of blank map.
Screenshot of map
07-21 21:28:59.573 18146-18265/com.example.har.firebaseauthenticationdemo E/Google Maps Android API: Authorization failure. Please see https://developers.google.com/maps/documentation/android-api/start for how to correctly set up the map.
07-21 21:28:59.575 18146-18265/com.example.har.firebaseauthenticationdemo E/Google Maps Android API: In the Google Developer Console (https://console.developers.google.com)
Ensure that the "Google Maps Android API v2" is enabled.
Ensure that the following Android Key exists:
API Key: AIzaSyDWCP4m0DF57jZU4V8Yr7RFP2-DmhpgL34
Android Application (<cert_fingerprint>;<package_name>): 0E:0E:68:77:05:BB:76:A3:5C:BC:62:F8:6A:AB:A5:5F:2A:7F:37:5F;com.example.har.firebaseauthenticationdemo
07-21 21:29:00.571 2256-2451/? E/Auth: [GoogleAccountDataServiceImpl] getToken() -> BAD_AUTHENTICATION. Account: <ELLIDED:-895295850>, App: com.google.android.gms, Service: oauth2:https://www.googleapis.com/auth/login_manager
fkq: Long live credential not available.
at fkr.b(:com.google.android.gms@12529024@12.5.29 (040700-192802242):20)
at fkr.a(:com.google.android.gms@12529024@12.5.29 (040700-192802242):50)
at fjb.a(:com.google.android.gms@12529024@12.5.29 (040700-192802242):35)
at gzf.a(:com.google.android.gms@12529024@12.5.29 (040700-192802242):8)
at gzf.a(:com.google.android.gms@12529024@12.5.29 (040700-192802242):160)
at gyf.a(:com.google.android.gms@12529024@12.5.29 (040700-192802242):2)
at gyc.a(:com.google.android.gms@12529024@12.5.29 (040700-192802242):17)
at gyc.a(:com.google.android.gms@12529024@12.5.29 (040700-192802242):6)
at cug.a(:com.google.android.gms@12529024@12.5.29 (040700-192802242):25)
at cug.a(:com.google.android.gms@12529024@12.5.29 (040700-192802242):79)
at cug.onTransact(:com.google.android.gms@12529024@12.5.29 (040700-192802242):8)
at android.os.Binder.transact(Binder.java:627)
at cwl.onTransact(:com.google.android.gms@12529024@12.5.29 (040700-192802242):3)
at android.os.Binder.execTransact(Binder.java:697)
07-21 21:29:00.611 2256-3646/? E/Auth: [GoogleAccountDataServiceImpl] getToken() -> BAD_AUTHENTICATION. Account: <ELLIDED:-895295850>, App: com.google.android.gms, Service: oauth2:https://www.googleapis.com/auth/login_manager
fkq: Long live credential not available.
at fkr.b(:com.google.android.gms@12529024@12.5.29 (040700-192802242):20)
at fkr.a(:com.google.android.gms@12529024@12.5.29 (040700-192802242):50)
at fjb.a(:com.google.android.gms@12529024@12.5.29 (040700-192802242):35)
at gzf.a(:com.google.android.gms@12529024@12.5.29 (040700-192802242):8)
at gzf.a(:com.google.android.gms@12529024@12.5.29 (040700-192802242):160)
at gyf.a(:com.google.android.gms@12529024@12.5.29 (040700-192802242):2)
at gyc.a(:com.google.android.gms@12529024@12.5.29 (040700-192802242):17)
at gyc.a(:com.google.android.gms@12529024@12.5.29 (040700-192802242):6)
at cug.a(:com.google.android.gms@12529024@12.5.29 (040700-192802242):25)
at cug.a(:com.google.android.gms@12529024@12.5.29 (040700-192802242):79)
at cug.onTransact(:com.google.android.gms@12529024@12.5.29 (040700-192802242):8)
at android.os.Binder.transact(Binder.java:627)
at cwl.onTransact(:com.google.android.gms@12529024@12.5.29 (040700-192802242):3)
at android.os.Binder.execTransact(Binder.java:697)
07-21 21:29:00.673 2256-3646/? E/Auth: [GoogleAccountDataServiceImpl] getToken() -> BAD_AUTHENTICATION. Account: <ELLIDED:-895295850>, App: com.google.android.gms, Service: oauth2:https://www.googleapis.com/auth/login_manager
fkq: Long live credential not available.
at fkr.b(:com.google.android.gms@12529024@12.5.29 (040700-192802242):20)
at fkr.a(:com.google.android.gms@12529024@12.5.29 (040700-192802242):50)
at fjb.a(:com.google.android.gms@12529024@12.5.29 (040700-192802242):35)
at gzf.a(:com.google.android.gms@12529024@12.5.29 (040700-192802242):8)
at gzf.a(:com.google.android.gms@12529024@12.5.29 (040700-192802242):160)
at gyf.a(:com.google.android.gms@12529024@12.5.29 (040700-192802242):2)
at gyc.a(:com.google.android.gms@12529024@12.5.29 (040700-192802242):17)
at gyc.a(:com.google.android.gms@12529024@12.5.29 (040700-192802242):6)
at cug.a(:com.google.android.gms@12529024@12.5.29 (040700-192802242):25)
at cug.a(:com.google.android.gms@12529024@12.5.29 (040700-192802242):79)
at cug.onTransact(:com.google.android.gms@12529024@12.5.29 (040700-192802242):8)
at android.os.Binder.transact(Binder.java:627)
at cwl.onTransact(:com.google.android.gms@12529024@12.5.29 (040700-192802242):3)
at android.os.Binder.execTransact(Binder.java:697)
07-21 21:29:00.748 2426-18282/? E/ChromeSync: [Sync,SyncAdapter] Failed to sync.
mbz: fgj: BadAuthentication
at mfy.a(:com.google.android.gms@12529024@12.5.29 (040700-192802242):5)
at mgm.a(:com.google.android.gms@12529024@12.5.29 (040700-192802242):42)
at mgn.a(:com.google.android.gms@12529024@12.5.29 (040700-192802242):22)
at mgn.a(:com.google.android.gms@12529024@12.5.29 (040700-192802242):73)
at mgn.b(:com.google.android.gms@12529024@12.5.29 (040700-192802242):7)
at mgl.a(:com.google.android.gms@12529024@12.5.29 (040700-192802242):41)
at nrg.onPerformSync(:com.google.android.gms@12529024@12.5.29 (040700-192802242):5)
at android.content.AbstractThreadedSyncAdapter$SyncThread.run(AbstractThreadedSyncAdapter.java:321)
Caused by: fgj: BadAuthentication
at ffx.a(:com.google.android.gms@12529024@12.5.29 (040700-192802242):13)
at ffw.a(:com.google.android.gms@12529024@12.5.29 (040700-192802242):2)
at ffw.e(:com.google.android.gms@12529024@12.5.29 (040700-192802242):6)
at ffw.d(:com.google.android.gms@12529024@12.5.29 (040700-192802242):1)
at ffu.b(:com.google.android.gms@12529024@12.5.29 (040700-192802242):1)
at nms.b(Unknown Source:6)
at nlf.b(:com.google.android.gms@12529024@12.5.29 (040700-192802242):5)
at nlw.a(:com.google.android.gms@12529024@12.5.29 (040700-192802242):58)
at mfy.a(:com.google.android.gms@12529024@12.5.29 (040700-192802242):1)
at mgm.a(:com.google.android.gms@12529024@12.5.29 (040700-192802242):42)
at mgn.a(:com.google.android.gms@12529024@12.5.29 (040700-192802242):22)
at mgn.a(:com.google.android.gms@12529024@12.5.29 (040700-192802242):73)
at mgn.b(:com.google.android.gms@12529024@12.5.29 (040700-192802242):7)
at mgl.a(:com.google.android.gms@12529024@12.5.29 (040700-192802242):41)
at nrg.onPerformSync(:com.google.android.gms@12529024@12.5.29 (040700-192802242):5)
at android.content.AbstractThreadedSyncAdapter$SyncThread.run(AbstractThreadedSyncAdapter.java:321)
07-21 21:29:03.389 1599-1612/? E/memtrack: Couldn't load memtrack module
07-21 21:29:05.559 1599-1612/? E/memtrack: Couldn't load memtrack module
07-21 21:29:05.574 1599-1612/? E/memtrack: Couldn't load memtrack module
07-21 21:29:12.866 2256-18310/? E/Auth: [GoogleAccountDataServiceImpl] getToken() -> BAD_AUTHENTICATION. Account: <ELLIDED:-895295850>, App: com.google.android.gms, Service: oauth2:https://www.googleapis.com/auth/experimentsandconfigs
fkq: Long live credential not available.
at fkr.b(:com.google.android.gms@12529024@12.5.29 (040700-192802242):20)
at fkr.a(:com.google.android.gms@12529024@12.5.29 (040700-192802242):50)
at fjb.a(:com.google.android.gms@12529024@12.5.29 (040700-192802242):35)
at gzf.a(:com.google.android.gms@12529024@12.5.29 (040700-192802242):8)
at gzf.a(:com.google.android.gms@12529024@12.5.29 (040700-192802242):160)
at gyf.a(:com.google.android.gms@12529024@12.5.29 (040700-192802242):2)
at gyc.a(:com.google.android.gms@12529024@12.5.29 (040700-192802242):17)
at gyc.a(:com.google.android.gms@12529024@12.5.29 (040700-192802242):6)
at cug.a(:com.google.android.gms@12529024@12.5.29 (040700-192802242):25)
at cug.a(:com.google.android.gms@12529024@12.5.29 (040700-192802242):79)
at ffx.a(:com.google.android.gms@12529024@12.5.29 (040700-192802242):6)
at ffw.a(:com.google.android.gms@12529024@12.5.29 (040700-192802242):2)
at ffw.e(:com.google.android.gms@12529024@12.5.29 (040700-192802242):6)
at ffu.f(:com.google.android.gms@12529024@12.5.29 (040700-192802242):3)
at ffu.a(:com.google.android.gms@12529024@12.5.29 (040700-192802242):4)
at ffu.a(:com.google.android.gms@12529024@12.5.29 (040700-192802242):7)
at aenk.a(:com.google.android.gms@12529024@12.5.29 (040700-192802242):22)
at aenm.a(:com.google.android.gms@12529024@12.5.29 (040700-192802242):130)
at aenm.a(:com.google.android.gms@12529024@12.5.29 (040700-192802242):243)
at aenm.a(:com.google.android.gms@12529024@12.5.29 (040700-192802242):404)
at com.google.android.gms.phenotype.sync.HeterodyneSyncTaskChimeraService.a(:com.google.android.gms@12529024@12.5.29 (040700-192802242):66)
at com.google.android.gms.phenotype.sync.HeterodyneSyncTaskChimeraService.a(:com.google.android.gms@12529024@12.5.29 (040700-192802242):20)
at ulu.run(:com.google.android.gms@12529024@12.5.29 (040700-192802242):1)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
at java.lang.Thread.run(Thread.java:764)
07-21 21:29:12.884 2256-18310/? E/HeterodyneSyncTaskChime: Failed to get auth token: User intervention required. Notification has been pushed. -- metadata{ service_id: 51 }
fgk: User intervention required. Notification has been pushed.
at ffu.f(:com.google.android.gms@12529024@12.5.29 (040700-192802242):10)
at ffu.a(:com.google.android.gms@12529024@12.5.29 (040700-192802242):4)
at ffu.a(:com.google.android.gms@12529024@12.5.29 (040700-192802242):7)
at aenk.a(:com.google.android.gms@12529024@12.5.29 (040700-192802242):22)
at aenm.a(:com.google.android.gms@12529024@12.5.29 (040700-192802242):130)
at aenm.a(:com.google.android.gms@12529024@12.5.29 (040700-192802242):243)
at aenm.a(:com.google.android.gms@12529024@12.5.29 (040700-192802242):404)
at com.google.android.gms.phenotype.sync.HeterodyneSyncTaskChimeraService.a(:com.google.android.gms@12529024@12.5.29 (040700-192802242):66)
at com.google.android.gms.phenotype.sync.HeterodyneSyncTaskChimeraService.a(:com.google.android.gms@12529024@12.5.29 (040700-192802242):20)
at ulu.run(:com.google.android.gms@12529024@12.5.29 (040700-192802242):1)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
at java.lang.Thread.run(Thread.java:764)
3 Answers
3
Make new app.A week ago i made a webview app after 2 days webview is not load anything umntil make new one.
1.Get Google Maps API Key
https://developers.google.com/maps/documentation/android-sdk/signup?authuser=1
2.Place this API key either in strings.xml or Android Manifest
AndroidManifest.xml
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="@string/google_maps_key" />
string.xml
<string name="google_maps_key">YOUR_API_KEY</string>
3.Put SupportMapFragment inside Your desirable xml
SupportMapFragment
<fragment
android:id="@+id/placesMap"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:tag="@string/tag_places_search_map"
class="com.google.android.gms.maps.SupportMapFragment" />
and finally the Activity class
Activity
class SampleActivity :
GoogleMap.OnMarkerClickListener,
GoogleMap.OnMarkerDragListener,
GoogleMap.OnInfoWindowClickListener,
GoogleMap.OnInfoWindowLongClickListener,
GoogleMap.OnInfoWindowCloseListener,
OnMapAndViewReadyListener.OnGlobalLayoutAndMapReadyListener,
GoogleMap.OnMapLoadedCallback
{
private lateinit var map: GoogleMap
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
val mapFragment = supportFragmentManager.findFragmentById(R.id.placesMap) as SupportMapFragment
OnMapAndViewReadyListener(mapFragment, this)
}
internal inner class CustomInfoWindowAdapter : GoogleMap.InfoWindowAdapter {
// These are both view groups containing an ImageView with id "badge" and two
// TextViews with id "title" and "snippet".
private val window: View = layoutInflater.inflate(R.layout.custom_info_window, null)
private val contents: View = layoutInflater.inflate(R.layout.custom_info_contents, null)
override fun getInfoWindow(marker: Marker): View? {
render(marker, window)
return window
}
override fun getInfoContents(marker: Marker): View? {
render(marker, contents)
return contents
}
private fun render(marker: Marker, view: View) {
// Set the title and snippet for the custom info window
val title: String? = marker.title
val titleUi = view.findViewById<TextView>(R.id.title)
if (title != null) {
// Spannable string allows us to edit the formatting of the text.
titleUi.text = SpannableString(title).apply {
setSpan(ForegroundColorSpan(resources.getColor(R.color.text_grey_heading)), 0, length, 0)
}
} else {
titleUi.text = ""
}
val snippet: String? = marker.snippet
val snippetUi = view.findViewById<TextView>(R.id.snippet)
snippetUi.text = snippet
}
}
override fun onMarkerClick(marker: Marker?): Boolean {
marker?.zIndex = marker?.zIndex?.plus(1.0f)!!
val handler = Handler()
val start = SystemClock.uptimeMillis()
val duration = 1500
val interpolator = BounceInterpolator()
handler.post(object : Runnable {
override fun run() {
val elapsed = SystemClock.uptimeMillis() - start
val t = Math.max(
1 - interpolator.getInterpolation(elapsed.toFloat() / duration), 0f)
marker?.setAnchor(0.5f, 1.0f + 2 * t)
// Post again 16ms later.
if (t > 0.0) {
handler.postDelayed(this, 16)
}
}
})
return false
}
override fun onMarkerDragEnd(p0: Marker?) {
}
override fun onMarkerDragStart(p0: Marker?) {
}
override fun onMarkerDrag(p0: Marker?) {
}
override fun onInfoWindowClick(marker : Marker) {
//Toast.makeText(this, "Click Info Window", Toast.LENGTH_SHORT).show()
}
override fun onInfoWindowClose(marker : Marker) {
//Toast.makeText(this, "Close Info Window", Toast.LENGTH_SHORT).show()
}
override fun onInfoWindowLongClick(marker : Marker) {
//Toast.makeText(this, "Info Window long click", Toast.LENGTH_SHORT).show()
}
override fun onMapLoaded() {
addMarkersToMap()
}
override fun onMapReady(googleMap: GoogleMap?) {
map = googleMap ?: return
with(map) {
// Hide the zoom controls as the button panel will cover it.
uiSettings.isZoomControlsEnabled = false
// Setting an info window adapter allows us to change the both the contents and
// look of the info window.
setInfoWindowAdapter(CustomInfoWindowAdapter())
// Set listeners for marker events. See the bottom of this class for their behavior.
setOnMarkerClickListener(this@SampleActivity)
setOnInfoWindowClickListener(this@SampleActivity)
setOnMarkerDragListener(this@SampleActivity)
setOnInfoWindowCloseListener(this@SampleActivity)
setOnInfoWindowLongClickListener(this@SampleActivity)
setOnMapLoadedCallback(this@SampleActivity)
// Override the default content description on the view, for accessibility mode.
// Ideally this string would be localised.
setContentDescription("Map with lots of markers.")
}
}
fun addMarkersToMap(data: List<Places>) {
// create bounds that encompass every location we reference
val boundsBuilder = LatLngBounds.Builder()
data.map { place -> boundsBuilder.include(LatLng(place.venue.location.lat!!,place.venue.location.lng)) }
val bounds = boundsBuilder.build()
with(map){
moveCamera(CameraUpdateFactory.newLatLngBounds(bounds, 50))
}
val list : MutableList<PlaceDetails> = mutableListOf<PlaceDetails>()
for (place in data){
list.add(PlaceDetails(place.id,LatLng(place.venue.location.lat!!,place.venue.location.lng),
place.venue.name,
place.getDistance()))
}
//add Seattle center as marker on map
var seattlePD : PlaceDetails = PlaceDetails(TConstants.SEATTLLE_ID,
LatLng(resources.getString(R.string.seattle_lat).toDouble(), resources.getString(R.string.seattle_long).toDouble()),
"Seattle","Seattle Center",
BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_CYAN))
map.addMarker(MarkerOptions()
.position(seattlePD.position)
.title(seattlePD.title)
.snippet(seattlePD.snippet)
.icon(seattlePD.icon)
.infoWindowAnchor(seattlePD.infoWindowAnchorX, seattlePD.infoWindowAnchorY)
.draggable(seattlePD.draggable)
.zIndex(seattlePD.zIndex))
for (placeDetails in list){
var marker = map.addMarker(MarkerOptions()
.position(placeDetails.position)
.title(placeDetails.title)
.snippet("Distance : "+placeDetails.snippet)
.icon(placeDetails.icon)
.infoWindowAnchor(placeDetails.infoWindowAnchorX, placeDetails.infoWindowAnchorY)
.draggable(placeDetails.draggable)
.zIndex(placeDetails.zIndex))
searchViewModel.markerTracker.put(marker.id,placeDetails)
}
}
}
Ensure that the "Google Maps Android API v2" is enabled.
Ensure that the following Android Key exists:
Update 1
07-21 21:28:59.573
18146-18265/com.example.har.firebaseauthenticationdemo E/Google Maps
Android API: Authorization failure.
Please see https://developers.google.com/maps/documentation/android-api/start for how to correctly set up the map.
Update 2
build.gradle
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
resValue "string", "google_maps_api_key", "Release_API_KEY"
}
debug {
// KL MBP debug Key
resValue "string", "google_maps_api_key", "DEBUG_API_KEY"
// KL Old Machine debug Key
// resValue "string", "google_maps_api_key", "DEBUG_API_KEY"
}
}
AndroidManifest.xml
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="@string/google_maps_api_key"/>
<uses-library
android:name="com.google.android.maps"
android:required="true" />
Update 3
DEBUG CERTIFICATE
Displaying the debug certificate fingerprint
Locate your debug keystore file. The file name is debug.keystore, and
is created the first time you build your project. By default, it is
stored in the same directory as your Android Virtual Device (AVD)
files:
macOS and Linux: ~/.android/
~/.android/
Windows Vista and Windows 7:
C:Usersyour_user_name.android List the SHA-1 fingerprint:
C:Usersyour_user_name.android List the SHA-1 fingerprint:
For Linux or macOS, open a terminal window and enter the following:
keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android
For Windows Vista and Windows 7, run:
keytool -list -v -keystore "%USERPROFILE%.androiddebug.keystore" -alias androiddebugkey -storepass android -keypass android
build.gradle
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
Do you setup google console settings, like enable map API & adding Api key?
– Khaled Lela
2 days ago