【问题标题】:Error in adding location service to android custom ROM将位置服务添加到android自定义ROM时出错
【发布时间】:2017-06-17 05:56:43
【问题描述】:

我在 android 中编写了一个定位服务。在 AndroidManifest.xml 我定义了两个意图过滤器:

<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>

但是当我在 Nexus 5x 中在 logcat 中运行时会显示此错误:

com.example.user.nlpservice 解析服务com.android.location.service.v3.NetworkLocationProvider,但签名错误,忽略 错误的签名是什么意思,我该如何解决这个问题?

【问题讨论】:

    标签: android location-services


    【解决方案1】:

    要在android中添加定位服务,你应该在AOSP构建树的以下文件中添加定位服务的包名来注册它。

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

    在上面的文件中,有一个名为config_locationProviderPackageNames的配置 添加一个项目并在其中写入您的位置服务包名称(例如 com.example.app1)。

    然后构建你的 android 操作系统,系统绑定到它并且它可以工作。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-05-26
      • 2021-12-28
      • 1970-01-01
      相关资源
      最近更新 更多