2017-05-30 42 views
-1

我得到了我的清單XML文件中的錯誤:「未解決的類」錯誤在AndroidManifest.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和其他地方的錯誤。任何知道我在做什麼錯的人?

+0

有項目中的任何.PlaySongService類 –

+0

嘗試清理項目。 (假設.PlaySongService類在Nilesh提到的項目中) – Prexx

+0

PlaySongService的包是什麼?它應該是com.example.shaikhaalothman.playsongservice,否則它將找不到該類。 – Chnoch

回答

1

PUT PlaySongService.javaMainActivity.java名爲com.example.shaikhaalothman.playsongservice同一封裝 ,它會自動解決 。