3

I wrote a Location Service in android . and in AndroidManifest.xml i defined two intent-filters :

<service
        android:name=".LocationServiceV2"
        android:exported="true"
        android:permission="android.permission.ACCESS_COARSE_LOCATION">
        <intent-filter>
            <action android:name="com.android.location.service.v3.NetworkLocationProvider" />
            <action android:name="com.android.location.service.v2.NetworkLocationProvider" />
        </intent-filter>

        <meta-data
            android:name="serviceVersion"
            android:value="2" />
        <meta-data
            android:name="serviceIsMultiuser"
            android:value="false" />
    </service>

but when I run in Nexus 5x in logcat displays this error :

com.example.user.nlpservice resolves service com.android.location.service.v3.NetworkLocationProvider , but has wrong signature , ignoring What means by wrong signature and how I can fix this problem?

ofskyMohsen
  • 1,121
  • 1
  • 12
  • 26

1 Answers1

0

For adding a location service in android , you should add package name of location service in following file in AOSP build tree to register it.

{AOSP BUILD TREE}/frameworks/base/core/res/res/values/config.xml

In above file ,there is a config named config_locationProviderPackageNames add an item and write your location service package name (for example com.example.app1) in it.

Build your android os then, the system binds to it and it works.

ofskyMohsen
  • 1,121
  • 1
  • 12
  • 26