Google Maps Api v2 Android Error
NickName:Massimiliano Allegretti Ask DateTime:2015-04-16T00:00:05

Google Maps Api v2 Android Error

only Android 5.0 work. Error by Android 5.0 lower

I have installed all SDK package.

Manifest

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

    <uses-sdk
        android:minSdkVersion="16"
        android:targetSdkVersion="19" />

    <permission
        android:name="com.allegretti.triestebus.permission.MAPS_RECEIVE"
        android:protectionLevel="signature" />

    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
    <uses-feature android:glEsVersion="0x00020000" android:required="true"/>
    <!--
 The ACCESS_COARSE/FINE_LOCATION permissions are not required to use
         Google Maps Android API v2, but are recommended.
    -->
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />







    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/Theme.Triestebus" >
        <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="@string/google_maps_key" />

        <activity
            android:name=".MapsActivity"
            android:label="@string/title_activity_maps" >
        </activity>
    </application>

</manifest>

build.grade

apply plugin: 'com.android.application'

android {
    compileSdkVersion 21
    buildToolsVersion "21.1.2"

    defaultConfig {
        applicationId "com.allegretti.triestebus"
        minSdkVersion 16
        targetSdkVersion 21
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:21.0.3'
    compile 'com.google.android.gms:play-services:7.0.0'
}

Java class

public class Fragment2 extends Fragment {
     MapView mMap;
     GoogleMap googleMap;
    View rootView;

    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState){

       rootView = inflater.inflate(R.layout.activity_maps, container, false);
        mMap = (MapView) rootView.findViewById(R.id.mapView);

        mMap.onCreate(savedInstanceState);

        googleMap = mMap.getMap();
//        googleMap.getUiSettings().setMyLocationButtonEnabled(false);
//        googleMap.setMyLocationEnabled(true);


        // Needs to call MapsInitializer before doing any CameraUpdateFactory calls
        MapsInitializer.initialize(this.getActivity());

        // Updates the location and zoom of the MapView
//        CameraUpdate cameraUpdate = CameraUpdateFactory.newLatLngZoom(new LatLng(45.649526, 13.776818), 13);
       // googleMap.animateCamera(cameraUpdate);



      /*  googleMap.addMarker(new MarkerOptions().position(new LatLng(45.631523, 13.780745)).title("Fermata di Via Svevo").snippet("1-8-29-B"));
        googleMap.addMarker(new MarkerOptions().position(new LatLng(45.641204, 13.774329)).title("Fermata di Via Leon Battista Alberti").snippet("29-B"));
        googleMap.addMarker(new MarkerOptions().position(new LatLng(45.628215, 13.820757)).title("Fermata di Via Alpi Giulie").snippet("37-48-C"));
        googleMap.addMarker(new MarkerOptions().position(new LatLng(45.639983, 13.758070)).title("Fermata di Passeggio Sant'Andrea").snippet("8-9-A"));
        googleMap.addMarker(new MarkerOptions().position(new LatLng(45.627767, 13.810545)).title("Fermata di Via Erta Sant'Anna").snippet("34"));
*/
        return (rootView);

    }
    public void onResume() {

        super.onResume();

        mMap.onResume();

    }

    @Override

    public void onPause() {

        super.onPause();

        mMap.onPause();

    }

    @Override

    public void onDestroy() {

        super.onDestroy();

        mMap.onDestroy();

    }

    @Override

    public void onLowMemory() {

        super.onLowMemory();

        mMap.onLowMemory();

    }







}

EROR

VFY: unable to resolve instance field 16
04-15 16:23:18.943    1791-1791/com.allegretti.triestebus D/dalvikvm﹕ VFY: replacing opcode 0x54 at 0x00b3
04-15 16:23:18.953    1791-1791/com.allegretti.triestebus E/dalvikvm﹕ Could not find class 'android.app.AppOpsManager', referenced from method com.google.android.gms.common.GooglePlayServicesUtil.zza
04-15 16:23:18.953    1791-1791/com.allegretti.triestebus W/dalvikvm﹕ VFY: unable to resolve check-cast 25 (Landroid/app/AppOpsManager;) in Lcom/google/android/gms/common/GooglePlayServicesUtil;
04-15 16:23:18.953    1791-1791/com.allegretti.triestebus D/dalvikvm﹕ VFY: replacing opcode 0x1f at 0x000e
04-15 16:23:18.963    1791-1791/com.allegretti.triestebus I/dalvikvm﹕ Could not find method android.content.pm.PackageManager.getPackageInstaller, referenced from method com.google.android.gms.common.GooglePlayServicesUtil.zzg
04-15 16:23:18.963    1791-1791/com.allegretti.triestebus W/dalvikvm﹕ VFY: unable to resolve virtual method 497: Landroid/content/pm/PackageManager;.getPackageInstaller ()Landroid/content/pm/PackageInstaller;
04-15 16:23:18.963    1791-1791/com.allegretti.triestebus D/dalvikvm﹕ VFY: replacing opcode 0x6e at 0x000b
04-15 16:23:18.983    1791-1791/com.allegretti.triestebus W/GooglePlayServicesUtil﹕ Google Play services out of date.  Requires 7095000 but found 3136130
04-15 16:23:18.993    1791-1791/com.allegretti.triestebus W/GooglePlayServicesUtil﹕ Google Play services out of date.  Requires 7095000 but found 3136130
04-15 16:23:19.033    1791-1791/com.allegretti.triestebus W/GooglePlayServicesUtil﹕ Google Play services out of date.  Requires 7095000 but found 3136130
04-15 16:23:19.043    1791-1791/com.allegretti.triestebus W/GooglePlayServicesUtil﹕ Google Play services out of date.  Requires 7095000 but found 3136130
04-15 16:23:19.053    1791-1791/com.allegretti.triestebus W/GooglePlayServicesUtil﹕ Google Play services out of date.  Requires 7095000 but found 3136130

Google Maps Api v2 Android Error Google Maps Api v2 Android Error Google Maps Api v2 Android Error Google Maps Api v2 Android Error Google Maps Api v2 Android Error Google Maps Api v2 Android Error Google Maps Api v2 Android Error Google Maps Api v2 Android Error Google Maps Api v2 Android Error Google Maps Api v2 Android Error Google Maps Api v2 Android Error Google Maps Api v2 Android Error Google Maps Api v2 Android Error Google Maps Api v2 Android Error Google Maps Api v2 Android Error Google Maps Api v2 Android Error Google Maps Api v2 Android Error Google Maps Api v2 Android Error Google Maps Api v2 Android Error Google Maps Api v2 Android Error

Copyright Notice:Content Author:「Massimiliano Allegretti」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/29655172/google-maps-api-v2-android-error

More about “Google Maps Api v2 Android Error” related questions

Google Maps Api v2 Android Error

only Android 5.0 work. Error by Android 5.0 lower I have installed all SDK package. Manifest &lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;manifest xmlns:android="http://schemas.an

Show Detail

Google Maps Android API V2 not show maps on Emulator

I am following the tutorial to run Google Maps Android API V2. I am using an emulator. (I know a real device may solve the problem, but I do want to try emulator) The mapfragment shows a pale yellow

Show Detail

google maps android api v2 error

I'm developing an app. on SDK 17 which involves google maps but the problem is that when I use Google Maps v1 api key, the map works fine but when I try to use Google Maps android V2 api key nothin...

Show Detail

Minimal Android API level to run Google Maps Android API v2

I have developed a mobile application that uses Google Maps Android API v1, and I plan to port it to the recent Google Maps Android API v2, as recommended by Google. However, my application also t...

Show Detail

Cannot activate Google Maps Android API v2 on Google API Console

I am trying to active Google Maps Android API v2 on the Google API console. It does not work. If I try in the new console it just gets stuck on Enabling Google Maps Android API v2 and nothin...

Show Detail

Google Maps Android API v2 - for ARM only?

Google Maps Android API v2 I'm getting error while trying to install sucessfully compiled maps demo app (%android-sdk%\extras\google\google_play_services\samples\maps\) on android-x86 device (Inte...

Show Detail

Monodroid Google Maps API v2 - Error contacting Google servers

I am developing a MonoDroid project and can't seem to get past this issue. I am trying to use the MapsAndLocationDemo_v2 project and can't even get the maps to load on the SimpleMapDemo project. I ...

Show Detail

Open Street Maps with Android Google Maps Api v2

Is it possible to use an open street map provider with the new Google Maps V2 Api on Android? If so can you provide an example, or documentation? I have looked quickly at the docs and found

Show Detail

Google Static Maps API V2 for business on Android

I am trying to use Google Static Maps API V2 for business on Android. Firstly, generated signature using client Id and Crypto Key, and made the below call to Google on Android device. (Modified cli...

Show Detail

Google Maps Android API v2 Moon and Mars

I've been playing with the Javascript Google Maps API and am able to get it to display the Moon and Mars maps that Google have. I am wondering if I can do the same natively for Android. Looking at...

Show Detail