0

I read all discussions solutions but did not work for me.

these are errors:

  01-01 11:02:47.947 21558-21558/com.cursedchico.IstanbulEventPool E/dalvikvm: Could not find class 'android.os.PersistableBundle', referenced from method com.cursedchico.IstanbulEventPool.MainActivity.access$super
01-01 11:02:47.947 21558-21558/com.cursedchico.IstanbulEventPool E/dalvikvm: Could not find class 'android.os.PersistableBundle', referenced from method com.cursedchico.IstanbulEventPool.MainActivity.access$super
01-01 11:02:47.947 21558-21558/com.cursedchico.IstanbulEventPool E/dalvikvm: Could not find class 'android.media.session.MediaController', referenced from method com.cursedchico.IstanbulEventPool.MainActivity.access$super
01-01 11:02:47.947 21558-21558/com.cursedchico.IstanbulEventPool E/dalvikvm: Could not find class 'android.widget.Toolbar', referenced from method com.cursedchico.IstanbulEventPool.MainActivity.access$super
01-01 11:02:47.967 21558-21558/com.cursedchico.IstanbulEventPool E/dalvikvm: Could not find class 'android.app.ActivityManager$TaskDescription', referenced from method com.cursedchico.IstanbulEventPool.MainActivity.access$super
01-01 11:02:47.967 21558-21558/com.cursedchico.IstanbulEventPool E/dalvikvm: Could not find class 'android.app.SharedElementCallback', referenced from method com.cursedchico.IstanbulEventPool.MainActivity.access$super
01-01 11:02:47.967 21558-21558/com.cursedchico.IstanbulEventPool E/dalvikvm: Could not find class 'android.os.PersistableBundle', referenced from method com.cursedchico.IstanbulEventPool.MainActivity.access$super
01-01 11:02:47.977 21558-21558/com.cursedchico.IstanbulEventPool E/dalvikvm: Could not find class 'android.app.SharedElementCallback', referenced from method com.cursedchico.IstanbulEventPool.MainActivity.access$super
01-01 11:02:48.027 21558-21558/com.cursedchico.IstanbulEventPool E/dalvikvm: Could not find class 'android.app.assist.AssistContent', referenced from method com.cursedchico.IstanbulEventPool.MainActivity.access$super
01-01 11:02:48.037 21558-21558/com.cursedchico.IstanbulEventPool E/dalvikvm: Could not find class 'android.view.SearchEvent', referenced from method com.cursedchico.IstanbulEventPool.MainActivity.access$super
01-01 11:02:48.037 21558-21558/com.cursedchico.IstanbulEventPool E/dalvikvm: Could not find class 'android.os.PersistableBundle', referenced from method com.cursedchico.IstanbulEventPool.MainActivity.access$super
01-01 11:06:57.301 21558-21558/com.cursedchico.IstanbulEventPool E/dalvikvm: Could not find class 'android.os.PersistableBundle', referenced from method com.cursedchico.IstanbulEventPool.ListEvents.access$super
01-01 11:06:57.301 21558-21558/com.cursedchico.IstanbulEventPool E/dalvikvm: Could not find class 'android.os.PersistableBundle', referenced from method com.cursedchico.IstanbulEventPool.ListEvents.access$super
01-01 11:06:57.301 21558-21558/com.cursedchico.IstanbulEventPool E/dalvikvm: Could not find class 'android.media.session.MediaController', referenced from method com.cursedchico.IstanbulEventPool.ListEvents.access$super
01-01 11:06:57.301 21558-21558/com.cursedchico.IstanbulEventPool E/dalvikvm: Could not find class 'android.widget.Toolbar', referenced from method com.cursedchico.IstanbulEventPool.ListEvents.access$super
01-01 11:06:57.301 21558-21558/com.cursedchico.IstanbulEventPool E/dalvikvm: Could not find class 'android.app.ActivityManager$TaskDescription', referenced from method com.cursedchico.IstanbulEventPool.ListEvents.access$super
01-01 11:06:57.311 21558-21558/com.cursedchico.IstanbulEventPool E/dalvikvm: Could not find class 'android.app.SharedElementCallback', referenced from method com.cursedchico.IstanbulEventPool.ListEvents.access$super
01-01 11:06:57.311 21558-21558/com.cursedchico.IstanbulEventPool E/dalvikvm: Could not find class 'android.os.PersistableBundle', referenced from method com.cursedchico.IstanbulEventPool.ListEvents.access$super
01-01 11:06:57.311 21558-21558/com.cursedchico.IstanbulEventPool E/dalvikvm: Could not find class 'android.app.SharedElementCallback', referenced from method com.cursedchico.IstanbulEventPool.ListEvents.access$super
01-01 11:06:57.321 21558-21558/com.cursedchico.IstanbulEventPool E/dalvikvm: Could not find class 'android.app.assist.AssistContent', referenced from method com.cursedchico.IstanbulEventPool.ListEvents.access$super
01-01 11:06:57.321 21558-21558/com.cursedchico.IstanbulEventPool E/dalvikvm: Could not find class 'android.view.SearchEvent', referenced from method com.cursedchico.IstanbulEventPool.ListEvents.access$super
01-01 11:06:57.321 21558-21558/com.cursedchico.IstanbulEventPool E/dalvikvm: Could not find class 'android.os.PersistableBundle', referenced from method com.cursedchico.IstanbulEventPool.ListEvents.access$super
01-01 11:06:59.102 21558-21558/com.cursedchico.IstanbulEventPool E/dalvikvm: Could not find class 'android.os.PersistableBundle', referenced from method com.cursedchico.IstanbulEventPool.ShowEventMap.access$super
01-01 11:06:59.102 21558-21558/com.cursedchico.IstanbulEventPool E/dalvikvm: Could not find class 'android.os.PersistableBundle', referenced from method com.cursedchico.IstanbulEventPool.ShowEventMap.access$super
01-01 11:06:59.102 21558-21558/com.cursedchico.IstanbulEventPool E/dalvikvm: Could not find class 'android.media.session.MediaController', referenced from method com.cursedchico.IstanbulEventPool.ShowEventMap.access$super
01-01 11:06:59.102 21558-21558/com.cursedchico.IstanbulEventPool E/dalvikvm: Could not find class 'android.widget.Toolbar', referenced from method com.cursedchico.IstanbulEventPool.ShowEventMap.access$super
01-01 11:06:59.102 21558-21558/com.cursedchico.IstanbulEventPool E/dalvikvm: Could not find class 'android.app.ActivityManager$TaskDescription', referenced from method com.cursedchico.IstanbulEventPool.ShowEventMap.access$super
01-01 11:06:59.102 21558-21558/com.cursedchico.IstanbulEventPool E/dalvikvm: Could not find class 'android.app.SharedElementCallback', referenced from method com.cursedchico.IstanbulEventPool.ShowEventMap.access$super
01-01 11:06:59.112 21558-21558/com.cursedchico.IstanbulEventPool E/dalvikvm: Could not find class 'android.os.PersistableBundle', referenced from method com.cursedchico.IstanbulEventPool.ShowEventMap.access$super
01-01 11:06:59.112 21558-21558/com.cursedchico.IstanbulEventPool E/dalvikvm: Could not find class 'android.app.SharedElementCallback', referenced from method com.cursedchico.IstanbulEventPool.ShowEventMap.access$super
01-01 11:06:59.112 21558-21558/com.cursedchico.IstanbulEventPool E/dalvikvm: Could not find class 'android.app.assist.AssistContent', referenced from method com.cursedchico.IstanbulEventPool.ShowEventMap.access$super
01-01 11:06:59.122 21558-21558/com.cursedchico.IstanbulEventPool E/dalvikvm: Could not find class 'android.view.SearchEvent', referenced from method com.cursedchico.IstanbulEventPool.ShowEventMap.access$super
01-01 11:06:59.122 21558-21558/com.cursedchico.IstanbulEventPool E/dalvikvm: Could not find class 'android.os.PersistableBundle', referenced from method com.cursedchico.IstanbulEventPool.ShowEventMap.access$super
01-01 11:07:00.744 21558-25105/com.cursedchico.IstanbulEventPool E/b: Authentication failed on the server.
01-01 11:07:00.744 21558-25105/com.cursedchico.IstanbulEventPool E/Google Maps Android API: Authorization failure.  Please see https://developers.google.com/maps/documentation/android/start for how to correctly set up the map.
01-01 11:07:00.844 21558-25105/com.cursedchico.IstanbulEventPool 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: AIzaSyBK5siQ2-6xawVO-qxQ6Rpxng2t7NYgr1Y
                                                                                                Android Application (<cert_fingerprint>;<package_name>): F5:47:C4:E7:6E:54:BC:99:67:XX:67:6A:CF:XX:7F:DD:A7:D6:E5:77;com.cursedchico.IstanbulEventPool

I took that fingerprint from signing report , when clicking in the left of android studio. It gave that key.

In google console credentials, my key:

Android key 3   Dec 31, 2015    Android AIzaSyBK5siQ2-6xawVO-qxQ6Rpxng2t7NYgr1Y

my map class:

    package com.cursedchico.IstanbulEventPool;

import android.support.v4.app.FragmentActivity;
import android.annotation.TargetApi;
import android.content.Context;
import android.location.Address;
import android.location.Geocoder;
import android.os.Build;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;
import android.widget.TextView;
/*
import com.google.android.gms.maps.model.CircleOptions;
import com.google.maps.android.SphericalUtil;
import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.api.GoogleApiClient;
import com.google.android.gms.location.LocationListener;
import com.google.android.gms.location.LocationRequest;
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.MapFragment;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.MarkerOptions;*/

import java.io.IOException;
import java.util.List;
import java.util.Locale;

import android.content.Intent;

import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.MapFragment;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.MarkerOptions;
import com.cursedchico.IstanbulEventPool.R;

/**
 * Created by Chico on 12/29/2015.
 */

public class ShowEventMap extends AppCompatActivity  {

    private String location;
    private String description;
    private View showView;
    private TextView desc;
    private String TAG = "Chic";
    private Event event;
    private GoogleMap googleMap;
    private LatLng coors;
    private Geocoder geocoder;
    private Context mContext;
    List<Address> From_geocode = null;

    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Log.v(TAG, "MapEvents activity oncreate");

        mContext =  getApplicationContext();

        Intent myIntent = getIntent(); // gets the previously created intent
        location =  myIntent.getStringExtra("Location");
        description = myIntent.getStringExtra("Description");
        Log.v(TAG,"loc: "+location+"des: "+description);

        showView = getLayoutInflater().inflate(R.layout.show_description, null);
        desc = (TextView) showView.findViewById(R.id.desc);
       // googleMap = (GoogleMap) showView.findViewById(R.id.map);

        desc.setText(description);
        Log.v(TAG, "desc view geçiş");
        handleLocation(getCoors(location,description));
        setContentView(showView);

    }

    @TargetApi(Build.VERSION_CODES.HONEYCOMB)
    private void setUpMap() {
        Log.v(TAG, "setupmapifneeded");
        //if (!isGooglePlayServicesAvailable())
        try {
            if (googleMap == null) {
                Log.v(TAG, "Map created");
                googleMap = ((MapFragment) getFragmentManager().
                        findFragmentById(R.id.map)).getMap();
                googleMap.setMapType(GoogleMap.MAP_TYPE_NORMAL);
            }
            else{
                Log.v(TAG, "hata setupmapifneeded gooogle map null degil");
                //googleMap.addMarker(new MarkerOptions().position(new LatLng(0, 0)).title("Marker"));
            }

        }
        catch (Exception e) {
            e.printStackTrace();
            Log.v(TAG, "catched error setupmap");

        }
    }//setupmap sonu

    private LatLng getCoors(String loc, String desc){
        Log.v(TAG, "getCoors ");
        if (Geocoder.isPresent()) {
            Log.v(TAG, "getCoors geocoder present");
            geocoder = new Geocoder(mContext, Locale.getDefault());
            Log.v(TAG, "location: "+loc);

            try {
                From_geocode = geocoder.getFromLocationName(loc, 1);
            } catch (IOException e) {
                e.printStackTrace();
                Log.v(TAG, "catched error - from geocode");//need to do something
            }

            if (!From_geocode.isEmpty()) {
                Log.v(TAG, " getcoors fromgeocod enot not empty  ");
                coors = new LatLng(From_geocode.get(0).getLatitude(), From_geocode.get(0).getLongitude());


                Log.v(TAG, "LATITUTE=====" + coors.latitude + "   LONGITUTE=====" + coors.longitude);
                return coors;
            }//second if end
            else{
                Log.v(TAG, " hata getcoors fromgeocode empty  ");
            }
        }//first if end
        else{
            Log.v(TAG, " hata getcoors geocoder not preset  ");
        }
        return null;
    }//getcoors end

private void handleLocation(LatLng coor) {
    Log.v(TAG, " handleLocation  ");
    if (coor != null) {
        Log.v(TAG, " handleLocation coor not null ");
        setUpMap();
        MarkerOptions options = new MarkerOptions().position(coor)
                .title("Etkinlik mekani");
        googleMap.addMarker(options);
        float zoomLevel = (float) 12.0; //This goes up to 21
        googleMap.moveCamera(CameraUpdateFactory.newLatLngZoom(coor, zoomLevel));

    }
    else{
        Log.v(TAG, " handleLocation coor nnull ");
        setUpMap();//bu olmalı mı degisr belki
    }
    Log.v(TAG, " handleLocation end ");
}




}//class end

I tried to change manifest, added some permissions and library, i saw from posts but same error goes on:

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

    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
    <uses-permission android:name="com.cursedchico.istanbuleventpool.permission.MAPS_RECEIVE" />

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">

        <uses-library android:name="com.google.android.maps" />


        <activity android:name="com.cursedchico.IstanbulEventPool.MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

        <activity android:name="com.cursedchico.IstanbulEventPool.ListEvents" />
        <activity android:name="com.cursedchico.IstanbulEventPool.ShowEventMap" />
        <activity android:name="com.cursedchico.IstanbulEventPool.AndroidDatabaseManager"
            android:theme="@style/Theme.AppCompat.Light"/>

        <meta-data
            android:name="com.google.android.maps.v2.API_KEY"
            android:value="AIzaSyBK5siQ2-6xawVO-qxQ6Rpxng2t7NYgr1Y" />

    </application>



</manifest>

I only need to show the location geocoded from string.

I use real device.

    <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">

    <ScrollView
        android:layout_width="match_parent"
        android:layout_height="439dp"
        android:id="@+id/scroll_desc">

        <TextView
              android:id="@+id/desc"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"/>

    </ScrollView>

    <fragment
        android:id="@+id/map"
        android:name="com.google.android.gms.maps.MapFragment"
        android:layout_width="match_parent"
        android:layout_height="fill_parent"
        android:layout_below="@+id/scroll_desc" />

</RelativeLayout>

from android project info:

   Project ID   
istanbuleventpool
Project name    
IstanbulEventPool
Project number  
xxxxx

1 Answers1

0

Open your project at google developer console and check if you are "com.cursedchico.IstanbulEventPool" as your package name. If it is different then change it to "com.cursedchico.IstanbulEventPool" then save. Now run your app it will work.In my case it worked.

This is how it looks like. You need to add your "com.cursedchico.IstanbulEventPool" in package name and add the finger print. You will get this from android studio generated resource xml. name as "google_maps_api" enter image description here

Zeeshan Shabbir
  • 6,704
  • 4
  • 38
  • 74
  • project name is istanbuleventpool because while creating the name, it did not let me put . so i could only write the proejct name. but while creating the package name, i put com.cursedchico so now it must be .
    com.cursedchico.istanbuleventpool ' Project ID istanbuleventpool Project name IstanbulEventPool Project number xxxxx'
    –  Jan 01 '16 at 10:25
  • sorry what do you mean by generating "google_maps_api" ? i cant see it. i searched also with file explorer but still couldnot find. i looked from manifest and my package name is as you said package="com.cursedchico.IstanbulEventPool" –  Jan 01 '16 at 10:56
  • Open res folder then open values there you will see google_maps_api.xml open it and copy fingerprint from there – Zeeshan Shabbir Jan 01 '16 at 11:32