0

I have spent 3 days, but can't find solution... When I launch map on a device with android 2.2 I have blank screen with zoom-buttons. Logcat shows the error message "E/copybit: Error opening frame buffer errno=13 (Permission denied)".

The google-play-services_lib and android-support-v4 were added.

My AndroidManifest:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.testmap"
      android:versionCode="1"
      android:versionName="1.0">

<uses-sdk android:minSdkVersion="8"
          android:targetSdkVersion="17"/>

<uses-feature
        android:glEsVersion="0x00020000"
        android:required="true" />

<permission
        android:name="com.testmap.permission.MAPS_RECEIVE"
        android:protectionLevel="signature"/>
<uses-permission android:name="com.testmap.permission.MAPS_RECEIVE"/>

<uses-permission android:name="android.permission.INTERNET"/>
<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.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

<application android:label="@string/app_name"
             android:allowBackup="true"
             android:icon="@drawable/icon_iphone">

    <activity android:name=".MainActivity.MainActivity"
              android:label="@string/app_name"
              android:screenOrientation="portrait"
              android:theme="@android:style/Theme.NoTitleBar">
        <intent-filter>
            <action android:name="android.intent.action.MAIN"/>
            <category android:name="android.intent.category.DEFAULT"/>
        </intent-filter>
    </activity>


    <meta-data
            android:name="com.google.android.maps.v2.API_KEY"
            android:value="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"/>

</application>

Fragment:

<fragment xmlns:android="http://schemas.android.com/apk/res/android"
              android:id="@+id/mapViewMain"
              android:layout_marginTop="7dp"
              android:name="com.google.android.gms.maps.SupportMapFragment"
              android:layout_width="match_parent"
              android:layout_height="match_parent"/>
Anton Kashpor
  • 1,255
  • 2
  • 18
  • 34
  • any Logcat hint? Perhaps an error in Google authentication? – Cob013 Jun 19 '13 at 16:35
  • @Rob013 no, only it : "E/copybit: Error opening frame buffer errno=13 (Permission denied)". – Anton Kashpor Jun 19 '13 at 16:37
  • @whisperofblood have you found the cause? I think I'm dealing with the same issue. App works fine in 2.3, but not 2.2 (have tried on only one 2.2 device) – The Nail Jun 24 '13 at 20:34
  • @whisperofblood FYI checking answer to this one http://stackoverflow.com/questions/13768681/google-maps-v2-shows-blank-screen-on-android-2-2 – The Nail Jun 24 '13 at 20:52

2 Answers2

0

I think it is caused for sdk version.Try with upper sdk of 13.I use same thing at android 4.0(sdk 14). So if you change your

<uses-sdk android:minSdkVersion="8">

to

<uses-sdk android:minSdkVersion="14"/>

I think it will work.
EDIT :
You are trying to use fragments on an API Level 8 device. So switch to FragmentActivity and SupportMapFragment.

import android.support.v4.app.FragmentActivity;
import com.google.android.gms.maps.SupportMapFragment;

public class MainActivity extends FragmentActivity {

 @Override
 protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_main);
 }

}

To get the map use..

   FragmentManager myFragmentManager = getSupportFragmentManager();
   SupportMapFragment mySupportMapFragment 
    = (SupportMapFragment)myFragmentManager.findFragmentById(R.id.map);
   myMap = mySupportMapFragment.getMap(); 
ridoy
  • 6,274
  • 2
  • 29
  • 60
0

To use Google Maps API V2 in Android version prior to API 12, you will need to use the android-support library for backwards fragments compatibility. In addition you will need to use a FragmentAcitivity as been already said and a SupportMapFragment as you already did.

I will suggest you yo go over this blog post I wrote that will help you to integrate those components in your application and make your map work:

Google Maps API V2

In addition I think that your problem can be caused by a bad produce of the API key, take a look at this blog post as well and see that you did all the steps correctly:

Google Maps API V2 Key

Emil Adz
  • 40,709
  • 36
  • 140
  • 187