我想在我的Android应用程序中使用HereMap SDK。我遵循了官方教程https://developer.here.com/documentation/android-premium/dev_guide/topics/app-create-simple.html

当我运行应用程序时,出现错误消息:


  AndroidManifest.xml文件中缺少MapService。有关正确的项目设置的详细信息,请参阅用户指南。


邮件地址缺少MapService,但是我已经将MapService添加到AndroidManifest.xml。这是我的AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="my.Package.Name">
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.VIBRATE" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
    <uses-permission android:name="android.permission.CALL_PHONE" />
    <!--
         The ACCESS_COARSE/FINE_LOCATION permissions are not required to use
         Google Maps Android API v2, but you must specify either coarse or fine
         location permissions for the 'MyLocation' functionality.
    -->
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

    <application
        android:hardwareAccelerated="true"
        android:name=".MyApplication"
        android:allowBackup="true"
        android:icon="@drawable/app_icon"
        android:label="@string/app_name"
        android:largeHeap="true"
        android:roundIcon="@drawable/app_icon"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">

        <!--other activity declerations-->

        <meta-data android:name="com.here.android.maps.appid" android:value="@string/here_map_app_id"/>
        <meta-data android:name="com.here.android.maps.apptoken" android:value="@string/here_map_app_code"/>
        <meta-data android:name="com.here.android.maps.license.key" android:value="@string/here_map_license"/>
        <service
            android:name="com.here.android.mpa.service.MapService"
            android:label="HereMapService"
            android:process="global.Here.Map.Service.v3"
            android:exported="true" >
            <intent-filter>
                <action android:name="@string/here_map_intent_name" >
                </action>
            </intent-filter>
        </service>
    </application>

</manifest>


在这种情况下可以帮我吗?谢谢你们!

最佳答案

我使用的是HereMap SDK版本3.13.3,我已将HereMap服务声明修改为以下内容,因此现在效果很好。请注意,我直接在com.heremapproject.myapp中使用字符串@string/here_map_intent_name而不是<intent-filter>

<service
    android:name="com.here.android.mpa.service.MapService"
    android:label="HereMapService"
    android:exported="false" >
    <intent-filter>
        <action android:name="com.heremapproject.myapp" ></action>
    </intent-filter>
</service>

关于java - AndroidManifest.xml文件中缺少MapService,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/58454774/

10-09 07:32