0

I retrieved a project from someone else and I'm supposed to work on it. i'm not very familiar with gradle and all the builds, but I've done the classic solutions and my problem still remains.

Here is the error I get when I try to run the project :

Error while executing: am start -n "com.nouveal.note/com.nouveal.note.ui.activities.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.nouveal.note/.ui.activities.MainActivity } Error type 3 Error: Activity class {com.nouveal.note/com.nouveal.note.ui.activities.MainActivity} does not exist.

Error while Launching activity

I did put apply plugin: 'com.android.application' in my build.gradle as recommanded on other posts but still get this mistake.

I also get few lines of warning (that somehow disappear once the error is here) that says :

  • warning: Ignoring InnerClasses attribute for an anonymous inner class that doesn't come up with an associated EnclosingMethod attribute. This class was probably produced by a compiler that did not target the modern.class format. The recommended solution is to recompile the class from source, using an up-to-date compiler and without specifying any -target type options.

I'm really lost on how to fix this, any help appreciated...

EDIT : There is my manifest :

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.nouveal.note" >

    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.RECORD_AUDIO" />
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
    <uses-permission android:name="android.permission.INTERNET"/>

     <compatible-screens>
         <!--&lt;!&ndash;all small size screens&ndash;&gt;
         <screen android:screenSize="small" android:screenDensity="ldpi" />
         <screen android:screenSize="small" android:screenDensity="mdpi" />
         <screen android:screenSize="small" android:screenDensity="hdpi" />
         <screen android:screenSize="small" android:screenDensity="xhdpi" />
         &lt;!&ndash; all normal size screens &ndash;&gt;
         <screen android:screenSize="normal" android:screenDensity="ldpi" />
         <screen android:screenSize="normal" android:screenDensity="mdpi" />
         <screen android:screenSize="normal" android:screenDensity="hdpi" />
         <screen android:screenSize="normal" android:screenDensity="xhdpi" />-->
         <!-- all large size screens - at 4" to 7" -->
         <screen android:screenSize="large" android:screenDensity="ldpi" />
         <screen android:screenSize="large" android:screenDensity="mdpi" />
         <screen android:screenSize="large" android:screenDensity="hdpi" />
         <screen android:screenSize="large" android:screenDensity="xhdpi" />
         <screen android:screenSize="large" android:screenDensity="480" />
         <screen android:screenSize="large" android:screenDensity="640" />
         <!-- all extra large size screens - at 7" to 10" -->
         <screen android:screenSize="xlarge" android:screenDensity="ldpi" />
         <screen android:screenSize="xlarge" android:screenDensity="mdpi" />
         <screen android:screenSize="xlarge" android:screenDensity="hdpi" />
         <screen android:screenSize="xlarge" android:screenDensity="xhdpi" />
         <screen android:screenSize="xlarge" android:screenDensity="480" />
         <screen android:screenSize="xlarge" android:screenDensity="640" />
     </compatible-screens>

    <application
        android:name=".application.NoteApplication"
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:logo="@mipmap/ic_app_logo"
        android:label="${appName}"
        android:theme="@style/AppTheme" >

        <activity
            android:name=".ui.activities.MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name=".ui.activities.MediaListActivity"
            android:parentActivityName=".ui.activities.MainActivity"
            android:label="@string/screen_list_media_title"/>
        <activity
            android:name=".ui.activities.MediaTextActivity"
            android:windowSoftInputMode="adjustResize"
            android:label="@string/screen_media_text_title"/>
        <activity
            android:name=".ui.activities.MediaImageActivity"
            android:label="@string/screen_media_image_title"/>
        <activity
            android:name=".ui.activities.MediaAudioActivity"
            android:label="@string/screen_media_audio_title"/>
        <activity
            android:name=".ui.activities.MediaVideoActivity"
            android:label="@string/screen_media_video_title"/>
        <activity
            android:name=".ui.activities.MediaDrawActivity"
            android:label="@string/screen_media_drawing_title"/>
        <activity
            android:name=".ui.activities.SettingsActivity"
            android:label="@string/screen_settings_title"/>


        <meta-data
            android:name="com.google.android.gms.version"
            android:value="@integer/google_play_services_version" />


        <provider
            android:name=".database.NoteAppProvider"
            android:authorities="com.nouveal.note.NoteProvider" />

    </application>

</manifest>

By the way, my coworker compiled it on android studio 1.4 and it worked, so...

  • Have you taken a look here? http://stackoverflow.com/questions/20915266/error-type-3-error-activity-class-does-not-exist – C0D3LIC1OU5 Jun 22 '16 at 16:31
  • Yeh I did it, but somehow it wasn't enough, I found out a way out though. Had to delete some repositories and reboot the PC. Thanks for the help – RiddlerNewComer Jun 23 '16 at 06:53

2 Answers2

2

Looks like it can't find your Activity: com.nouveal.note.ui.activities.MainActivity. If you have moved thing around, make sure to update your manifest.xml file to reflect the new package structure.

This error doesn't seem to be related to Gradle though.

C0D3LIC1OU5
  • 8,600
  • 2
  • 37
  • 47
0

According with your error log I suppose you have a devices as my LG Stylus 3 Android 7.0, in which when you press and move app from desktop to the trash, app does not removed from device. See my accepted answer on the same question for details.

isabsent
  • 3,683
  • 3
  • 25
  • 46