简体   繁体   English

Android | Google Maps API

[英]Android | Google Maps API

Today I've been updating my android app but this isn't going as expected. 今天,我一直在更新我的android应用程序,但是并没有按预期进行。 I'm using google maps and after the update I don't get it to work anymore. 我使用的是Google地图,更新后我无法再使用了。 I got another API key and everything.. Now the difference is I used Google APIs 4.2.2 and after today 4.4 我得到了另一个API密钥以及所有内容。现在不同之处是,我使用的是Google APIs 4.2.2和今天的4.4

Could it be that the code to display a Google Map changed in these APIs? 这些API中显示Google地图的代码是否发生了变化? Is there a way to keep track of the changes and if yes where? 有没有办法跟踪更改,如果是,则在哪里?

In the old app where it works I use following code in an XML file to display a map 在可以运行的旧应用中,我在XML文件中使用以下代码来显示地图

<fragment
        android:id="@+id/map"
        android:name="com.google.android.gms.maps.MapFragment"
        android:layout_below="@id/upper"
        android:layout_width="match_parent"
        android:layout_height="match_parent"/>

================================================ ===============================================

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

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

    <permission
        android:name="be.khk.mmapp.permission.MAPS_RECEIVE"
        android:protectionLevel="signature" />

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

    <application
        android:allowBackup="true"
        android:icon="@drawable/mm_icon"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name="be.khk.mmapp.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>
        <activity
            android:name="be.khk.mmapp.NewsActivity"
            android:label="@string/news_activity" >
        </activity>
        <activity
            android:name="be.khk.mmapp.RetailersActivity"
            android:label="@string/retailers_activity" >
        </activity>
        <activity
            android:name="be.khk.mmapp.VoucherActivity"
            android:label="@string/voucher_activity" >
        </activity>
        <activity
            android:name="be.khk.mmapp.AboutUsActivity"
            android:label="@string/aboutus_activity" >
        </activity>
        <activity
            android:name="be.khk.mmapp.RetailerActivity"
            android:label="@string/retailer_activity" >
        </activity>
        <activity
            android:name="be.khk.mmapp.ContactActivity"
            android:label="@string/contact_activity" >
        </activity>

        <meta-data
            android:name="com.google.android.gms.version"
            android:value="@integer/google_play_services_version" />

        <uses-library android:name="com.google.android.maps" />

        <meta-data
            android:name="com.google.android.maps.v2.API_KEY"
            android:value="AIzaSyBnVb**************************6pUvk" />
    </application>

</manifest>

If anyone could lead me in the right direction that would be nice. 如果有人可以引导我朝正确的方向前进,那将是很好。

The Google Maps SDK is stored in Google Play Services and is updated independently from the Android OS. Google Maps SDK存储在Google Play服务中,并且独立于Android OS进行更新。 What phone are you using? 您正在使用什么电话? If you flashed a custom ROM, make sure it has Google Play Services. 如果您刷新了自定义ROM,请确保它具有Google Play服务。 Can you also provide your AndroidManifest? 您还可以提供AndroidManifest吗?

EDIT: check logcat for authorization failure. 编辑:检查logcat授权失败。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM