Android Maps v2 无法获取连接工厂客户端

编程入门 行业动态 更新时间:2024-10-06 01:37:36
本文介绍了Android Maps v2 无法获取连接工厂客户端的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

我有问题.我得到一个空白的谷歌地图.我尝试了网络上的一切.但似乎没有什么能解决这个问题.我已经粘贴了下面的 logcat.我试过调试键和释放键.但两者都不起作用.地图不起作用.我只是得到一个灰色背景,谷歌写在下面:(请帮忙

I have a problem. I am getting a blank google map. I tried everything around the net. But nothing seems to solve this issue. I have pasted the logcat below. I have tried both debug key and release key. But both are not working. The map is not working. I just get a grey background with Google written below :( Please help

09-04 12:29:57.037: E/MapActivity(9569): Couldn't get connection factory client
09-04 12:29:57.067: D/dalvikvm(9569): GC_FOR_ALLOC freed 54K, 2% free 9295K/9464K, paused 14ms, total 14ms
09-04 12:29:57.637: W/System.err(9569): IOException processing: 26
09-04 12:29:57.637: W/System.err(9569): java.io.IOException: Server returned: 3
09-04 12:29:57.647: W/System.err(9569):     at android_maps_conflict_avoidance.google.googlenav.map.BaseTileRequest.readResponseData(BaseTileRequest.java:115)
09-04 12:29:57.647: W/System.err(9569):     at android_maps_conflict_avoidance.google.googlenav.map.MapService$MapTileRequest.readResponseData(MapService.java:1473)
09-04 12:29:57.657: W/System.err(9569):     at android_maps_conflict_avoidance.google.googlenav.datarequest.DataRequestDispatcher.processDataRequest(DataRequestDispatcher.java:1117)
09-04 12:29:57.657: W/System.err(9569):     at android_maps_conflict_avoidance.google.googlenav.datarequest.DataRequestDispatcher.serviceRequests(DataRequestDispatcher.java:994)
09-04 12:29:57.657: W/System.err(9569):     at android_maps_conflict_avoidance.google.googlenav.datarequest.DataRequestDispatcher$DispatcherServer.run(DataRequestDispatcher.java:1702)
09-04 12:29:57.657: W/System.err(9569):     at java.lang.Thread.run(Thread.java:841)

我的 XML

<LinearLayout xmlns:android="http://schemas.android/apk/res/android"
    xmlns:tools="http://schemas.android/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    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" >

    <TextView 
        android:id="@+id/textlat"
        android:layout_height="wrap_content"
        android:layout_width="fill_parent"/>
    <TextView 
        android:id="@+id/textlong"
        android:layout_height="wrap_content"
        android:layout_width="fill_parent"/>
    <com.google.android.maps.MapView
    xmlns:android="http://schemas.android/apk/res/android"
    android:id="@+id/mapview"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:clickable="true"
    android:apiKey="API Key"/>  

</LinearLayout>

我的清单

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

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

    <uses-feature
        android:glEsVersion="0x00020000"
        android:required="true"/>
    <permission
    android:name="com.rrj.maps.permission.MAPS_RECEIVE" android:protectionLevel="signature" />
    <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-permission android:name="com.rrj.maps.permission.MAPS_RECEIVE" />
    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >

        <activity
            android:name="com.rrj.maps.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>
        <meta-data
         android:name="com.google.android.maps.v2.API_KEY"
         android:value="API_KEY"/>
        <uses-library android:name="com.google.android.maps"/>
    </application>

</manifest>

[更新]:我再次尝试生成 sha1fingerprint.我观察到所使用的签名算法是 SHA256withRSA,例如 google dev site show SHA1withRSA 这会导致任何问题吗?

[UPDATE]: I tried generating the sha1fingerprint again. I observed that the signature algorithm used is SHA256withRSA where as the example in the google dev site show SHA1withRSA could this be causing any problem?

推荐答案

在您的 XML 文件中,您使用的是 pld Google Map API v1.. 在您的清单文件中,您已经为 Google Map V2 编写了代码.. 所以只需添加这个在 xml 中替换为旧的.

In your XML file you are using pld Google Map API v1.. And in your Manifest file you have wrote code for Google Map V2.. SO just add this in xml replace with old.

<fragment xmlns:android="http://schemas.android/apk/res/android"
android:id="@+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"
class="com.google.android.gms.maps.SupportMapFragment"/>

并且是的也删除

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

来自清单文件....

你也可以参考这个:

仍然获取无法获取连接工厂客户端";错误

android google map 无法获取连接工厂客户端

这篇关于Android Maps v2 无法获取连接工厂客户端的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-04-18 02:57:20,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/928325.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:客户端   工厂   Android   Maps

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!