在清单文件中引用的类 com.example.bottomnav.ClientBottomNav 在项目或库中未找到。

huangapple go评论69阅读模式
英文:

Class referenced in the manifest, com.example.bottomnav.ClientBottomNav, was not found in the project or the libraries

问题

com.example.bottomnav.ClientBottomNav 类在项目中存在,但在 Android 清单文件中仍然显示以下错误:

清单文件中引用的类 com.example.bottomnav.ClientBottomNav 未在项目或库中找到 未解决的类 'ClientBottomNav'

正如您在图像中所见,项目包含所有必要的类。

英文:

The Class com.example.bottomnav.ClientBottomNav is present in the project still in the android Manifest it shows the following error-

Class referenced in the manifest, com.example.bottomnav.ClientBottomNav, was not found in the project or the libraries  Unresolved class 'ClientBottomNav' 

As you can see in the image, the project contains all the neccessary classes.
在清单文件中引用的类 com.example.bottomnav.ClientBottomNav 在项目或库中未找到。

答案1

得分: 1

很有可能清单中定义的包与项目中的包不匹配,所以由于您只是在类名上使用了引用,无法解析它。请检查清单顶部的"package"标记。

您应该有类似以下的内容:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.bottomnav"
    android:versionCode="1"
    android:versionName="1.0" >

另外,您可以尝试在活动声明中设置完整的路径,例如:

<activity android:name="com.example.bottomnav.ClientBottomNav" 
android:label="ClientBottomNav">

另外,请确保您不要在清单中声明片段,只需要声明活动。

<details>
<summary>英文:</summary>

It is very probable that the package defined in the manifest doesn&#39;t match the one you have in the project, so as you are using just a reference to the class name is not able to resolve it. 
Check the tag &quot;package&quot; at the top of your manifest.

You should have something like:

        &lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
    &lt;manifest xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
        package=&quot;com.example.bottomnav&quot;
        android:versionCode=&quot;1&quot;
        android:versionName=&quot;1.0&quot; &gt;

Also you might try to set the full path in the activity declaration like:

    &lt;activity android:name=&quot;com.example.bottomnav.ClientBottomNav&quot; 
    android:label=&quot;ClientBottomNav&quot;&gt;

Also, make sure that you don&#39;t declare fragments in the manifest, only activities have to be declared.


</details>



huangapple
  • 本文由 发表于 2020年10月9日 20:53:43
  • 转载请务必保留本文链接:https://go.coder-hub.com/64280494.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定