Question

Someone can explain to me this error please. Thanks.

enter image description here

AndroidManifest.xml it tel me that: com.ift2905project.tunemyday.MainActivity yes MainActivity dosn't exist but when I create it or it rename my principal activity to MainActivity, this is the problem I upload the code of the manifest

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.ift2905project.tunemyday"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="19" />

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name="com.ift2905project.tunemyday.LoginActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name="com.ift2905project.tunemyday.MainActivity"
            android:label="@string/app_name" >
        </activity>
        <activity
            android:name="com.ift2905project.tunemyday.ShowPlaylistsActivity"
            android:label="@string/title_activity_show_playlists" >
        </activity>
        <activity
            android:name="com.ift2905project.tunemyday.ShowSongsActivity"
            android:label="@string/app_name" >
        </activity>
        <activity
            android:name="com.ift2905project.tunemyday.ShowSongInfosActivity"
            android:label="@string/app_name" >
        </activity>
        <activity
            android:name="com.ift2905project.tunemyday.ShowArtistInfosActivity"
            android:label="@string/app_name" >
        </activity>
        <activity
            android:name="com.ift2905project.tunemyday.ShowAlbumInfosActivity"
            android:label="@string/app_name" >
        </activity>
    </application>

</manifest>
Was it helpful?

Solution

I think you should show the xml code of your manifest in order to understand what's happening, but just as a theory... maybe your class MainActivity doesn't extend from Activity class.

You're using eclipse, if you open the xml and put the mouse pointer over the error line, eclipse will tell you the problem.

Edit (Sorry to make this but I can't comment in your post since I don't have enough reputation)

Reading your manifest, everything seems pretty normal. You should confirm that your MainActivity is in the right package.

Since you defined your package (package="com.ift2905project.tunemyday") you can just make this:

<activity
    android:name=".MainActivity"
    android:label="@string/app_name" >
</activity>

But you have to make sure that the file MainActivity.java is in the folder:

src/com/ift2905project/tunemyday

And the last thing that you have to check is that your MainActivity.java has this structure:

package com.ift2905project.tunemyday;

public class MainActivity extends Activity { ... your code here ...}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top