title: Android firebase integration with Google Maps
body: <p>I am trying to integrate my firebase database with Google Maps but I am having issues. Here is my code:</p>
  
  <pre><code>package com.test.googlemap;
  
  import android.Manifest;
  import android.content.pm.PackageManager;
  import android.location.Criteria;
  import android.location.Location;
  import android.location.LocationManager;
  import android.support.v4.app.FragmentActivity;
  import android.os.Bundle;
  
  import com.firebase.client.DataSnapshot;
  import com.firebase.client.Firebase;
  import com.firebase.client.FirebaseError;
  import com.firebase.client.ValueEventListener;
  import com.google.android.gms.common.api.GoogleApiClient;
  import com.google.android.gms.location.LocationServices;
  import com.google.android.gms.maps.CameraUpdateFactory;
  import com.google.android.gms.maps.GoogleMap;
  import com.google.android.gms.maps.OnMapReadyCallback;
  import com.google.android.gms.maps.SupportMapFragment;
  import com.google.android.gms.maps.UiSettings;
  import com.google.android.gms.maps.model.LatLng;
  import com.google.android.gms.maps.model.MarkerOptions;
  
  
  
  public class MapsActivity extends FragmentActivity implements    OnMapReadyCallback {
  
  private static GoogleMap mMap;
  private GoogleApiClient mGoogleApiClient;
  
  
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      Firebase.setAndroidContext(this);
      setContentView(R.layout.activity_maps);
      // Obtain the SupportMapFragment and get notified when the map is ready to be used.
      SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
              .findFragmentById(R.id.map);
      mapFragment.getMapAsync(this);
  
      /*if (mGoogleApiClient == null) {
          mGoogleApiClient = new GoogleApiClient.Builder(this)
                  .addConnectionCallbacks(this)
                  .addOnConnectionFailedListener(this)
                  .addApi(LocationServices.API)
                  .build();
      }*/
  }
  
  
  /**
   * Manipulates the map once available.
   * This callback is triggered when the map is ready to be used.
   * This is where we can add markers or lines, add listeners or move the camera. In this case,
   * we just add a marker near Sydney, Australia.
   * If Google Play services is not installed on the device, the user will be prompted to install
   * it inside the SupportMapFragment. This method will only be triggered once the user has
   * installed Google Play services and returned to the app.
   */
  @Override
  public void onMapReady(GoogleMap googleMap) {
      mMap = googleMap;
      UiSettings UiSettings = googleMap.getUiSettings();
      UiSettings.setZoomControlsEnabled(true);
  
      LocationManager service = (LocationManager) getSystemService(LOCATION_SERVICE);
      Criteria criteria = new Criteria();
      String provider = service.getBestProvider(criteria, true);
      //Location myLocation = service.getLastKnownLocation(provider);
  
      mMap.setMyLocationEnabled(true);
  
  
  
  
      //double latitude = myLocation.getLatitude();
      //double longitude = myLocation.getLongitude();
      //LatLng startingPosition = new LatLng(latitude, longitude);
  
      LatLng sydney = new LatLng(-34, 151);
      createMarker();
      //mMap.moveCamera(CameraUpdateFactory.newLatLng(sydney));
  }
  
  private void createMarker() {
      Firebase ref = new Firebase("https://shining-fire-3472.firebaseio.com/locations");
      //Query queryRef = ref.orderByChild("latitude");
      ref.addListenerForSingleValueEvent(new ValueEventListener() {
          @Override
          public void onDataChange(DataSnapshot dataSnapshot) {
              for (DataSnapshot userSnapshot : dataSnapshot.getChildren()) {
                  markerLocation marker = userSnapshot.getValue(markerLocation.class);
                  Double lat = Double.parseDouble(marker.getLatitude());
                  Double log = Double.parseDouble(marker.getLongtitude());
                  LatLng latLng = new LatLng(lat, log);
                  mMap.addMarker(new MarkerOptions().position(latLng));
              }
          }
  
          @Override
          public void onCancelled(FirebaseError firebaseError) {
  
          }
      });
  }
  }
  </code></pre>
  
  <p>Here is the appbuild gradle:</p>
  
  <pre><code>apply plugin: 'com.android.application'
  
  android {
  compileSdkVersion 23
  buildToolsVersion "23.0.2"
  
  defaultConfig {
      applicationId "com.test.googlemap"
      minSdkVersion 17
      targetSdkVersion 23
      versionCode 1
      versionName "1.0"
      multiDexEnabled true
  }
  buildTypes {
      release {
          minifyEnabled false
          proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
      }
  }
  packagingOptions {
      exclude 'META-INF/LICENSE'
      exclude 'META-INF/LICENSE-FIREBASE.txt'
      exclude 'META-INF/NOTICE'
      exclude 'META-INF/services/com.fasterxml.jackson.core.ObjectCodec'
  }
  dexOptions {
      preDexLibraries = false
      incremental = true;
      javaMaxHeapSize "4g"
  }
  }
  
  dependencies {
  compile fileTree(include: ['*.jar'], dir: 'libs')
  testCompile 'junit:junit:4.12'
  compile 'com.android.support:appcompat-v7:23.2.0'
  compile 'com.google.android.gms:play-services:8.4.0'
  
  compile files('libs/firebase-client-android-2.5.2.jar')
  
  }
  </code></pre>
  
  <p>I am trying to retrieve marker location objects in order to create custom markers that will show up the Map. The project will sync but whenever I try and build an APK I get this error: </p>
  
  <p>Error:Execution failed for task ':app:dexDebug'.> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files (x86)\Java\jdk1.8.0_60\bin\java.exe'' finished with non-zero exit value 1</p>
  
  <p>I've tried all of the fixes from other similar questions but none have worked for me. </p>