Google Maps android studio leaked to service connection

I am making a simple application that is related to maps in android studio. When I run it with the release key,

 keytool -list -v -keystore C:\Users\Theodosios\maps.jks -alias mapsalias -storepass   
 larissa -keypass larissa 

      

the card is not working properly. If I use debug.kestore it works fine though. Output message

 01-06 00:17:00.904: E/ActivityThread(1665): 
 Service com.google.android.gms.backup.BackupTransportService has leaked    
 ServiceConnection com.google.android.gms.http.f@3c9e1e50 
 that was originally bound here.

 01-06 00:17:00.904: E/ActivityThread(1665): 
 android.app.ServiceConnectionLeaked: Service  
 com.google.android.gms.backup.BackupTransportService has leaked ServiceConnection 
 com.google.android.gms.http.f@3c9e1e50 
 that was originally bound here

 01-06 00:17:00.904: E/ActivityThread(1665): at  
 android.app.LoadedApk.getServiceDispatcher(LoadedApk.java:966)
 01-06 00:17:00.904: 


 E/ActivityThread(1665):    
 at android.app.ContextImpl.bindServiceCommon(ContextImpl.java:1768)

      

I took the MainActivity code from google.It pretty straight forward.

public class MainActivity extends ActionBarActivity {
GoogleMap googleMap;
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.activity_main);

    createMapView();
    addMarker();
}

/**
 * Initialises the mapview
 */
private void createMapView(){
    /**
     * Catch the null pointer exception that
     * may be thrown when initialising the map
     */
    try {
        if(null == googleMap){
            googleMap = ((MapFragment) getFragmentManager().findFragmentById(
                    R.id.mapView)).getMap();

            /**
             * If the map is still null after attempted initialisation,
             * show an error to the user
             */
            if(null == googleMap) {
                Toast.makeText(getApplicationContext(),
                        "Error creating map", Toast.LENGTH_SHORT).show();
            }
        }
    } catch (NullPointerException exception){
        Log.e("mapApp", exception.toString());
    }
 }
 private void addMarker(){

    /** Make sure that the map has been initialised **/
    if(null != googleMap){
    Marker marker1=    googleMap.addMarker(new MarkerOptions()
                        .position(new LatLng(39.648141,22.413155))
                        .title("Marker")
                        .draggable(true)
        );
    }
  }
}

      

In the manifest file, I add the required permissions.

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="map.example.com.myapplication" >

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission   
 android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name=".MainActivity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
</activity>
    <meta-data
        android:name="com.google.android.gms.version"
        android:value="@integer/google_play_services_version" />

    <meta-data
        android:name="com.google.android.maps.v2.API_KEY"
        android:value="MY KEY FROM GOOLE API CONSOLE GOES HERE" />
</application>

</manifest>

      

+3


source to share





All Articles