gpt4 book ai didi

Android 谷歌地图只有部分星标

转载 作者:行者123 更新时间:2023-11-30 03:21:14 26 4
gpt4 key购买 nike

我正在尝试让 Google map 在模拟器中运行。我能够在实际设备上启动代码,但模拟器是另一回事。

为此,我正在尝试将模拟器与 Google API 18 结合使用。不过,我的最低 SDK 是 15。

我在模拟器中得到的只是一个空白屏幕,底部写角有 +/- 控件。

当我的 map 运行时,我在 Logcat 中收到以下消息。

09-30 12:35:27.761: ERROR/Google Maps Android API(1327): Google Maps Android API v2 only supports devices with OpenGL ES 2.0 and above 
09-30 12:35:28.441: WARN/EGL_emulation(1327): eglSurfaceAttrib not implemented
09-30 12:36:16.741: ERROR/CheckinTask(550): Checkin failed: https://android.clients.google.com/checkin (request #0): java.net.SocketTimeoutException
09-30 12:37:01.003: ERROR/CheckinTask(550): SSL error, attempting time correction: javax.net.ssl.SSLHandshakeException: javax.net.ssl.SSLProtocolException: SSL handshake aborted: ssl=0x2a2d2368: Failure in SSL library, usually a protocol error
error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol (external/openssl/ssl/s23_clnt.c:766 0x59bf16ba:0x00000000)
09-30 12:38:01.201: ERROR/CheckinTask(550): Checkin failed: https://android.clients.google.com/checkin (request #0): java.net.SocketTimeoutException
09-30 12:38:17.482: WARN/Uploader(545): No account for auth token provided 09-30
12:39:10.121: ERROR/CheckinTask(550): SSL error, attempting time correction: javax.net.ssl.SSLHandshakeException: javax.net.ssl.SSLProtocolException: SSL handshake aborted: ssl=0x2a2daaa0: Failure in SSL library, usually a protocol error
error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol (external/openssl/ssl/s23_clnt.c:766 0x59bf16ba:0x00000000)
09-30 12:40:10.381: ERROR/CheckinTask(550): Checkin failed: https://android.clients.google.com/checkin (request #0): java.net.SocketTimeoutException

这是我的 list 。

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

<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"/>
<!-- The following two permissions are not required to use
Google Maps Android API v2, but are recommended. -->
<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:icon="@drawable/ic_launcher">
<uses-library android:name="com.google.android.maps"/>

<activity android:name="MyActivity" android:label="@string/app_name" android:theme="@android:style/Theme.NoTitleBar">
<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="MY_API_GENERATED_KEY_IS_HERE"/>

</application>
</manifest>

布局main.xml

<?xml version="1.0" encoding="utf-8"?>
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:name="com.google.android.gms.maps.MapFragment"/>

Activity 代码如下

package com.example.Mapper;

import android.app.Activity;
import android.app.Dialog;
import android.os.Bundle;
import android.util.Log;
import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.GooglePlayServicesUtil;

public class MyActivity extends Activity {
/**
* Called when the activity is first created.
*/
@Override
public void onCreate(Bundle savedInstanceState) {
Log.w("........................","................................................");
super.onCreate(savedInstanceState);
Integer resultCode = GooglePlayServicesUtil.isGooglePlayServicesAvailable(MyActivity.this);
if (resultCode == ConnectionResult.SUCCESS) {
setContentView(R.layout.main);
} else {
Dialog dialog = GooglePlayServicesUtil.getErrorDialog(resultCode, MyActivity.this, 0);
if (dialog != null) {
//This dialog will help the user update to the latest GooglePlayServices
dialog.show();
}
}


}
}

我不明白为什么在设备上没有 SSL 错误,而在使用模拟器时却有错误。请协助。

谢谢。

最佳答案

我已经切换到 Genymotion 模拟器,我的问题消失了。问题不是我做错了什么,而是我使用了 GOOGLE 的模拟器。

关于Android 谷歌地图只有部分星标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19099628/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com