Android GoogleMaps无法加载

时间:2014-04-06 07:40:03

标签: java android maps

我想让谷歌地图在我的Android应用程序上工作,但由于某种原因它不会加载。我已在Google文档https://developers.google.com/maps/documentation/android/start#getting_the_google_maps_android_api_v2

上完成了所有操作

此时我不知道发生了什么。 这是我到目前为止编写的代码

   package com.example.postplay;

    import com.google.android.gms.maps.GoogleMap;
    import com.google.android.gms.maps.SupportMapFragment;

    import android.os.Bundle;
    import android.support.v4.app.FragmentActivity;
    import android.view.Menu;

    public class MapActive extends FragmentActivity {

    GoogleMap map;
    double lat;
    double lan;
    boolean flag = false;

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

        map = ((SupportMapFragment) getSupportFragmentManager()
                .findFragmentById(R.id.map)).getMap();

    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.map_active, menu);
        return true;
    }

    }

android manifest

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.postplay"
    android:versionCode="1"
    android:versionName="1.0" >

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

    <permission
        android:name="com.example.postplay.MAPS_RECEIVE"
        android:protectionLevel="signature" />

    <uses-permission android:name="com.example.postplay.permission.MAPS_RECEIVE" />
    <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-feature
        android:glEsVersion="0x00020000"
        android:required="true" />

    <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.example.postplay.MainActivity"
            android:label="@string/app_name" >
            <intent-fenter code hereilter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name="com.example.postplay.AddGame"
            android:label="@string/title_activity_add_game" >
        </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="~HIDDEN~" />

        <activity
            android:name="com.example.postplay.MapActive"
            android:label="@string/title_activity_map_active" >
        </activity>
    </application>

    </manifest>

当我在我的设备上运行应用程序时,我只是得到一个空白屏幕

“设备上的日期似乎不正确。请检查设备上的日期。”

非常感谢任何帮助

这是我的日志消息

01-04 17:27:36.579:W / ResourceType(20372):无法在包0中输入0x01080a03(t = 7 e = 2563)(错误-75) 01-04 17:27:36.689:D / libEGL(20372):已加载/vendor/lib/egl/libEGL_POWERVR_SGX544_115.so 01-04 17:27:36.729:D / libEGL(20372):已加载/vendor/lib/egl/libGLESv1_CM_POWERVR_SGX544_115.so 01-04 17:27:36.749:D / libEGL(20372):已加载/vendor/lib/egl/libGLESv2_POWERVR_SGX544_115.so 01-04 17:27:36.839:D / OpenGLRenderer(20372):启用调试模式0 01-04 17:27:51.079:I / dalvikvm(20372):JIT的竞技场总页数:11 01-04 17:27:51.079:D / dalvikvm(20372):由于和-int / lit16 v0,v5,(#128)拒绝注册 01-04 17:27:51.089:I / dalvikvm(20372):JIT的竞技场总页数:12 01-04 17:27:51.089:D / dalvikvm(20372):由于和-int / lit16 v0,v5,(#128)拒绝注册 01-04 17:27:51.239:W / ResourceType(20372):无法在包0中输入0x01080a03(t = 7 e = 2563)(错误-75) 01-04 17:27:51.239:D / dalvikvm(20372):由于div-int / lit8 v0,v3,(#2)而拒绝注册 01-04 17:27:51.299:D / dalvikvm(20372):由于div-int / lit8 v0,v3,(#2)而拒绝注册 01-04 17:27:51.309:D / dalvikvm(20372):由于div-int / lit8 v0,v3,(#2)而拒绝注册 01-04 17:27:51.689:I / dalvikvm(20372):JIT的竞技场总页数:13 01-04 17:27:51.689:I / dalvikvm(20372):JIT的竞技场总页数:14 01-04 17:27:51.689:I / dalvikvm(20372):JIT的竞技场总页数:15 01-04 17:27:51.689:I / dalvikvm(20372):JIT的竞技场总页数:16 01-04 17:27:51.689:I / dalvikvm(20372):JIT的竞技场总页数:17

0 个答案:

没有答案