繁体   English   中英

在项目或库中找不到清单中引用的类

[英]Class referenced in the manifest was not found in the project or the libraries

最近我尝试删除所有 lint 问题,并且在清单中出现了一个问题:
“在清单中引用的类 com.octo.android.robospice.JacksonSpringAndroidSpiceService,在项目或库中未找到”

    <service
        android:name="com.octo.android.robospice.JacksonSpringAndroidSpiceService"
        android:exported="false" >
    </service>

这是一个 maven 依赖项,也包含在 build.gradle 文件中:

dependencies {
  ...
    compile 'com.octo.android.robospice:robospice:1.4.11'
    compile 'com.octo.android.robospice:robospice-spring-android:1.4.11'
   ...
}

还可以做些什么来解决这个 lint 警告,或者我是否必须抑制它?

在我的情况下,我忘记在 kotlin 文件中添加包

package com.user.examplephone;

我知道这是一个老问题,但我今天遇到了类似的问题。 问题出在服务的名称上。 如果您的项目中有该类,则名称应为:

  <service
        android:name="YOUR_PACKAGE.YOUR_CLASS_NAME"
        android:exported="false" />

例子:

            android:name="com.google.android.gms.oss.licenses.OssLicensesActivity"
            android:screenOrientation="portrait"
            android:theme="@style/LicensesTheme"
            tools:ignore="MissingClass"/>


你需要添加

tools:ignore="MissingClass"

就我而言,在擦洗 SO 以解决此问题之后。 我最终将 MainActivity 的完全限定路径名放入我的清单和无效缓存中,然后重新启动。 为我工作。 青年会

转到文件->无效现金并重新启动

这个对我有用

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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