gpt4 book ai didi

android - 谷歌地图 V2 崩溃

转载 作者:行者123 更新时间:2023-11-30 03:04:43 25 4
gpt4 key购买 nike

一切正常,直到我更新我的 android 工具版本 22.3、android sdk 平台工具版本 19.0.1、android 支持库版本 19.0.1、google play 服务版本 15。

现在,每当我使用谷歌地图访问我的 Activity 时,我的应用程序就会崩溃。登录目录:

02-24 21:18:55.336: E/AndroidRuntime(23474): FATAL EXCEPTION: main
02-24 21:18:55.336: E/AndroidRuntime(23474): java.lang.RuntimeException: Unable to start activity ComponentInfo{packagename}: java.lang.NullPointerException
02-24 21:18:55.336: E/AndroidRuntime(23474): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2343)
02-24 21:18:55.336: E/AndroidRuntime(23474): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2395)
02-24 21:18:55.336: E/AndroidRuntime(23474): at android.app.ActivityThread.access$600(ActivityThread.java:162)
02-24 21:18:55.336: E/AndroidRuntime(23474): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1364)
02-24 21:18:55.336: E/AndroidRuntime(23474): at android.os.Handler.dispatchMessage(Handler.java:107)
02-24 21:18:55.336: E/AndroidRuntime(23474): at android.os.Looper.loop(Looper.java:194)
02-24 21:18:55.336: E/AndroidRuntime(23474): at android.app.ActivityThread.main(ActivityThread.java:5371)
02-24 21:18:55.336: E/AndroidRuntime(23474): at java.lang.reflect.Method.invokeNative(Native Method)
02-24 21:18:55.336: E/AndroidRuntime(23474): at java.lang.reflect.Method.invoke(Method.java:525)
02-24 21:18:55.336: E/AndroidRuntime(23474): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:833)
02-24 21:18:55.336: E/AndroidRuntime(23474): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
02-24 21:18:55.336: E/AndroidRuntime(23474): at dalvik.system.NativeStart.main(Native Method)
02-24 21:18:55.336: E/AndroidRuntime(23474): Caused by: java.lang.NullPointerException
02-24 21:18:55.336: E/AndroidRuntime(23474): at android.app.Activity.performCreate(Activity.java:5122)
02-24 21:18:55.336: E/AndroidRuntime(23474): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1081)
02-24 21:18:55.336: E/AndroidRuntime(23474): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2307)

list :

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

<permission
android:name="packagename.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />

<uses-permission android:name="packagename.permission.MAPS_RECEIVE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />

<activity android:name="packagename.balona.MapDetail" >
</activity>

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

// I add these based on this post http://stackoverflow.com/questions/19724113/google-play-services-update
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />

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

xml:

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

OnCreate 谷歌地图 Activity :

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

googleMap = fm.getMap();

googleMap.setMyLocationEnabled(true);

googleMap.setMapType(GoogleMap.MAP_TYPE_HYBRID);

在我更新我在 Android SDK 管理器中上面所说的内容之前,它工作正常。我应该怎么办?请帮忙。我应该重新安装我的 eclipse adt 吗?

最佳答案

一旦您尝试添加清理项目并刷新甚至尝试重新启动您的虚拟设备..

关于android - 谷歌地图 V2 崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21989202/

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