0

I am currently running into this issue without even knowing why.

It was working fine yesterday and I just added more code to each activity. I have already perfomed "Invalidate Cache/Restart" and Restarted my computer.

Note that I did not change anything in the Manifest.xml nor have I added a new activity to the Project.

Here's the AndroidManifest.xml file.

<?xml version="1.0" encoding="utf-8"?>

<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=".LoginActivity">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity android:name=".RegisterActivity" />
    <activity android:name=".MainScreenActivity" />
    <activity android:name=".StatisticsActivity" />
    <activity android:name=".UnlockablesActivity"></activity>
</application>

<uses-permission android:name="android.permission.INTERNET" />

Any help would be greatly appreciated.

Edit: I have already tried to Rebuild and Clean multiple times. Same error. The error is a little pop-up on the left corner saying "Error running app: Default Activity not found".

When setting the Default Activity in the settings to Nothing, this error appears in logcat when accessing a different activity.

enter image description here

It is not the full log but you can see that it references Line 25 in LoginActivity (the supposed Default Activity) which leads to its onCreate() function.

JoaoBM
  • 85
  • 8
  • Can you please share the error log? The manifest file won't help to resolve the error. Also, try to clean the project and rebuild it. – Ishtdeep Hora Jan 09 '19 at 02:54
  • @IshtdeepHora Apologies. I have already tried multiple times to clean it and rebuild it. As for the error, upon "Run", a little pop-up shows up on the left corner of the screen saying: "Error running app: Default Activity not found" – JoaoBM Jan 09 '19 at 02:59
  • Okay. Have you gone through all these solutions? Please take a look in this link : https://stackoverflow.com/questions/15825081/error-default-activity-not-found – Ishtdeep Hora Jan 09 '19 at 03:03
  • Yah, everything does not work except for changing the Default Activity to Nothing in the settings. Problem is that I have other activities accessing data from this one and once they load, this one gives an error. – JoaoBM Jan 09 '19 at 03:14
  • Ill update the main post with the error log – JoaoBM Jan 09 '19 at 03:17
  • It's throwing ClassNotFoundException in the error log. Do you have any clue on this? – WasabiTea Jan 09 '19 at 04:06
  • I have no idea why it is not finding the Activity/Class file. Im more inclined to say my Android Studio is corrupted. – JoaoBM Jan 09 '19 at 04:28

1 Answers1

1

I've had exactly the same error a week ago, here's the link to my question. I couldn't find the origin of the error, it is probably a bug with Android Studio (I've had the same thing with all my projects).

I've resolved it by deleting the .AndroidStudio hidden directory in your user folder. Keep in mind, it deletes all the settings you've set before and it will reset Android Studio from scratch.

  • Will my projects be affected? I really do believe my Android Studio is corrupted – JoaoBM Jan 09 '19 at 04:24
  • No, your projects will not change, everything I've had was working the same as before, don't worry! –  Jan 09 '19 at 04:34
  • I could kiss you right now. It worked! I'm less than 20hours away to deliver my final project for this semester and all of the sudden this thing happened and kept me from making any further progresses. Thank you so much for taking your time to answer. Again, thank you very much! – JoaoBM Jan 09 '19 at 04:47
  • I'm really glad it worked! Good luck with your project and your semester :) –  Jan 09 '19 at 14:55