【发布时间】:2017-05-30 12:03:56
【问题描述】:
我的清单 xml 文件中出现错误:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.shaikhaalothman.playsongservice">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<service
android:name=".PlaySongService"
android:enabled="true"
android:exported="true"></service>
</application>
</manifest>
它在这一行给了我一个错误:
android:name=".PlaySongService"
错误显示:
未解决的类“PlaySongService”
验证 Android XML 文件中的资源引用。
我在 Stackoverflow 和其他地方没有找到任何有助于解决我的错误的方法。有谁知道我做错了什么?
【问题讨论】:
-
你的项目中有没有.PlaySongService类
-
尝试清理您的项目。 (假设 .PlaySongService 类在您的项目中,如 Nilesh 所述)
-
PlaySongService 的包是什么?应该是com.example.shaikhaalothman.playsongservice,否则找不到类。
-
请出示您的
PlaySongService.java -
com.example.shaikhaalothman.playsongservice 包中是否提供 PlaySongService?