Maps版本V1在Android 10中崩溃 [英] Maps version V1 is crashing in Android 10
问题描述
我在我的Android应用中使用的是地图版本V1.直到Android Pie(9)都可以正常工作,但是在Android 10中崩溃了. 我正在获得例外
I am using map version V1 in my android app. It's working fine till Android Pie(9) but it's crashing in Android 10. I am getting below exception
UncaughtException: java.lang.NoClassDefFoundError: Failed resolution of: Lorg/apache/http/client/HttpClient;
at com.google.android.maps.MapActivity.<init>(MapActivity.java:356)
我已经尝试过以下清单文件中的代码
I have already tried below code in android manifest file
<uses-library android:name="org.apache.http.legacy" android:required="false"/>
我的gradle文件中的以下代码
and below code in my gradle file
useLibrary 'org.apache.http.legacy'
推荐答案
确保已在<application>
元素(即:
<application ...>
<uses-library
android:name="org.apache.http.legacy"
android:required="false" />
<application/>
如果您使用的是com.google.android.gms:play-services-maps:16.1.0
或更高版本,则完全不需要添加.请参阅Google的文档.
If you're using com.google.android.gms:play-services-maps:16.1.0
or above then you don't need to add this at all. Refer to Google's documentation.
我刚刚创建了一个针对Android 10(API级别29)的地图活动项目,该项目对我来说没有任何问题.希望对您有帮助.
I just created a map activity project targeting Android 10 (API level 29) and it ran without problem for me. Hope this helps you.
这篇关于Maps版本V1在Android 10中崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!