Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Unresolved class" error in in AndroidManifest.xml

Tags:

android

xml

I get an error in my manifest xml file:

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

and it gives me an error at this line:

 android:name=".PlaySongService"

and the error reads:

Unresolved class 'PlaySongService'

Validates resource reference inside Android XML files.

I haven't found anything that helps to resolve my error here on Stackoverflow, and elsewhere. Anyone that knows what I'm doing wrong?

like image 787
userdxb Avatar asked May 30 '17 12:05

userdxb


1 Answers

Put PlaySongService.java and MainActivity.java in the same package, named com.example.shaikhaalothman.playsongservice. It will resolve automatically.

like image 54
Aniruddh Parihar Avatar answered Nov 10 '22 17:11

Aniruddh Parihar