解决“has leaked ServiceConnection [email protected] that was originally bound here”的错误,需要修改AndroidManifest.xml文件。
配置Map定位权限和远程链接机制。不然,就会报下面的错误:
has leaked ServiceConnection [email protected] that was originally bound here android.app.ServiceConnectionLeaked: Activity XX.XX.XX.XXXXActivity has leaked ServiceConnection [email protected] that was originally bound here at android.app.LoadedApk$ServiceDispatcher.<init>(LoadedApk.java:969)
方法:
添加定位权限:
<uses-permission android:name="android.permission.BAIDU_LOCATION_SERVICE" />
再<application></application>之间添加下面service标签。
<service android:name="com.baidu.location.f" android:enabled="true" android:process=":remote" > </service>
配置完成后,启动app。发现运行OK。
时间: 2024-12-28 23:55:35