1

我想在我的 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>

你能在这种情况下帮助我吗?谢谢你们!

4

1 回答 1

1

我正在使用 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>
于 2019-11-05T02:19:04.037 回答