New developer but I have spent the past few days trying to resolve this problem of gray boxes showing up instead of a map on Android device.I have read just about everything there is to read about these boxes but the solutions that are working for other people are not working for me.
The api key that I am using comes from keytool in my java JRE 7 folder using the command from bin folder: keytool -list -alias androiddebugkey -keystore "C:\Users\ben.android\debug.keystore" -storepass android -keypass android -v .... I believe this is the debug API key that I have read about here as well as other places.
Here is the error I am getting http://imgur.com/IoHMHQc. I believe I have highlighted the "interesting" part which is java.io.IOException: Server returned: 3.
It seems like that means my API key is faulty but I have made multiple new ones and none seem to fix the problem! I am NOT uploading the application yet so I don't think the "signed/unsigned" exporting matters but that is because I don't understand it completely.
I have tried following multiple tutorials such as one from Lynda.com as well as various youtube tutorials, however they all are Google Maps v2 rather than v3 so that may be the issue. Help would be greatly appreciated and lifesaving!
Here is my main java file:
package com.bentseytlin.gmap2;
import com.google.android.maps.MapActivity;
import com.google.android.maps.MapView;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
public class MainActivity extends MapActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
MapView view = (MapView) findViewById(R.id.themap);
view.setBuiltInZoomControls(true);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
@Override
protected boolean isRouteDisplayed() {
// TODO Auto-generated method stub
return false;
}
}
Here is my xml file:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".MainActivity" >
<com.google.android.maps.MapView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/themap"
android:clickable="true"
android:apiKey="AIzaSyB1gqlqGQZCH1TlrDhp5BP9Pm9k4Jm_2co"
/>
</RelativeLayout>
And here is my Manifest File:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.bentseytlin.gmap2"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="10"
android:targetSdkVersion="17" />
<uses-permission android:name="android.permission.INTERNET"/>
<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" >
<uses-library android:name="com.google.android.maps"/>
<activity
android:name="com.bentseytlin.gmap2.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>
</application>
</manifest>
Thanks again!