简体   繁体   中英

MapService is missing from the AndroidManifest.xml file

I want to use HereMap SDK in my android app. I followed official tutorial https://developer.here.com/documentation/android-premium/dev_guide/topics/app-create-simple.html .

When I run app, I get an error message:

MapService is missing from the AndroidManifest.xml file. Please refer to the user guide for details about proper project setup.

The message address missing MapService, but I have already added MapService to AndroidManifest.xml . This is my 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>

Can you help me in this situation? Thank you all!

I am using HereMap SDK version 3.13.3, I have modified HereMap service declaration as folowings so now it works brilliant. Note that I use string directly com.heremapproject.myapp instead of @string/here_map_intent_name inside <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>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM