Skip to content Skip to sidebar Skip to footer

Android Maps V2 App Constantly Crashes

I have a problem with my app that uses the android api v2 in that it won't start it only keeps saying that 'Unfortunately, app_name has stopped working.', I have followed every ste

Solution 1:

EDIT --- I recommend you try the Genymotion instead of the eclipse android emulator.

But you can try the steps below.

You can do this steps if you alred have your API KEY

Step 1:

configuration AndroindManifest.xml:

<?xml version="1.0" encoding="utf-8"?><manifestxmlns:android="http://schemas.android.com/apk/res/android"package="com.br.activitys"android:versionCode="1"android:versionName="1.0" ><uses-sdkandroid:minSdkVersion="16"android:targetSdkVersion="16" /><permissionandroid:name="com.br.activitys.permission.MAPS_RECEIVE"android:protectionLevel="signature" /><uses-permissionandroid:name="com.br.activitys.permission.MAPS_RECEIVE" /><uses-permissionandroid:name="android.permission.INTERNET" /><uses-permissionandroid:name="android.permission.ACCESS_NETWORK_STATE" /><uses-permissionandroid:name="android.permission.WRITE_EXTERNAL_STORAGE" /><uses-permissionandroid:name="com.google.android.providers.gsf.permission.READ_GSERVICES" /><uses-permissionandroid:name="android.permission.ACCESS_COARSE_LOCATION" /><uses-permissionandroid:name="android.permission.ACCESS_FINE_LOCATION" /><uses-featureandroid:glEsVersion="0x00020000"android:required="true" /><applicationandroid:allowBackup="true"android:icon="@drawable/icon"android:label="@string/app_name"android:theme="@android:style/Theme.Holo.Light.DarkActionBar"android:debuggable="true"><meta-dataandroid:name="com.google.android.maps.v2.API_KEY"android:value="YOUR API KEY" /><activity> ... </activity></application></manifest>

Step 2: Create an emulator 4.2.2 API 17

enter image description here

After that, start and wait this completely loaded.   Step 3: Download the files https://www.dropbox.com/s/m8p5jsvg9i4l5j3/com.android.vending-20130716.apk e https://www.dropbox.com/s/a90mjl9nhk4qv45/com.google.android.gms-20130716.apk Install it with ADB On windows exceute type CMD

enter image description here

The prompt will opne and you need to access your android instalation folder, in my case C:\Program Files (x86)\Android\android-sdk\platform-tools

enter image description here

So, you will type ADB INSTALL and the path of the files you downloaded. enter image description here

and

enter image description here

This process take some time(2 or 3 minutes), dont worry.

After that,you need restart the emulator.

step 4: Download https://www.dropbox.com/s/42bz5imaq4uty4j/google_play_services_9.7z extract the folder google_play_services insde of folder extra/google non your SDK directory (in my case C:\Program Files (x86)\Android\android-sdk\extras\google), if the folder alredy exist, delete and replace with this new one. Now, copy the same folder google-play-services_lib which is in google_play_services\libproject to your workspace, and import like an eclipse project. File -> Import

enter image description here

Select Android -> Existing Android Code Into Workspace

enter image description here

Select the folder you copied

enter image description here

and Finish.

Step 5: Now add the library to your project. Right Click in your project and go to properties. In android, scroll down until library and click add.

enter image description here

Choose the project you imported, and click ok

enter image description here

enter image description here

Just for sure, go Project -> Clean and select Clean All Projects

enter image description here

It's done, now just run your app.

enter image description here

Solution 2:

Are you testing your application on Emulator or device..Because the google MapV2 requires a Android device with Google play apk installed in it.

Post a Comment for "Android Maps V2 App Constantly Crashes"