簡體   English   中英

Android上的Googlemaps顯示灰屏

[英]Googlemaps on android is showing grey screen

我剛剛得到了我的google maps應用程序,它不會在啟動時崩潰,但是現在,當它打開時,它僅顯示一個灰色/白色背景和用於縮放的按鈕。 我在網上搜索后發現我的API密鑰可能有問題,因此我從Google那里獲得了一個新密鑰,但這也不起作用。

這是它的外觀截圖。 鏈接到圖像 (我是新用戶,所以無法在此處發布圖片)

這是我的清單文件:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.androidbasic12"
    android:versionCode="1"
    android:versionName="1.0" 
    >
    <uses-feature
    android:glEsVersion="0x00020000"
    android:required="true"/>

<permission 
    android:name="come.example.androidbasics12.permission.MAPS_RECIEVE"
    android:protectionLevel="signature"/>

    <uses-permission      
        android:name="com.example.androidbasics12.permission.MAPS_RECEIVE"/>
    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
    <uses-permission  android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>


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

    <application
        android:allowBackup="true"
        android:icon="@drawable/new_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <!-- First xml to be loaded -->
        <activity
            android:name="com.example.androidbasic12.MainActivity"
            android:label="@string/app_name" 
            android:launchMode="singleInstance"
            android:screenOrientation="portrait">

            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER"   />
            </intent-filter>
        </activity>

        <!-- Opens main menu after splash has loaded -->
        <activity
            android:name=".myMenu"
            android:label="@string/app_name"
            android:screenOrientation="portrait"> >
            <intent-filter>
                <action android:name="com.example.androidbasic12.CLEARSCREEN" />

                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>

        <!-- Opens test -->
        <activity
            android:name=".tutOne"
            android:label="@string/app_name"
            android:screenOrientation="portrait"> >
            <intent-filter>
                <action android:name="com.example.androidbasic12.TUTONE" />

                <category android:name="android.intent.category.DEFAULT" />
             </intent-filter>
        </activity>


        <!-- Opens map page -->
        <activity
            android:name=".map"
            android:label="@string/app_name"
            android:screenOrientation="portrait"> >
            <intent-filter>
                <action android:name="com.example.androidbasic12.MAPS" />

                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>

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

    </application>

</manifest>

有人對此有任何提示嗎?

我遇到了與您相同的問題,在模擬器上一切正常,但在實際設備上,它是帶有縮放按鈕的灰色表面。 然后我嘗試了其他設備,並且可以正常工作。 所有其他電話均具有原始(庫存)固件,只有我一部具有自定義固件。

租用先檢查在模擬器上一切正常,然后檢查帶有備用固件的設備,然后讓我們知道結果。

問題可能不在於您的API密鑰,而是API控制台中的授權應用。 確保在Google API控制台中注冊了正確的密鑰和程序包名稱。 具體來說,如果直接從eclipse進行編譯和啟動,則可能是在debug模式下簽名。 如果是這樣,則需要在API控制台中將調試鍵哈希+程序包名稱添加到允許的應用程序中。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM