I was working on a project a couple days ago, which was saved and closed, only to get an error in the MainActivity, when I opened it today.
Error: Cannot access 'androidx.core.app.ComponentActivity' which is a supertype of 'com.careerinfluencer.fivehundreddays.MainActivity'. Check your module classpath for missing or conflicting dependencies
I don't even know the module classpath to check nor what to include here..
But I'm just going to add some of the AndroidManifest file.
AndroidManifest :
<application
...
<activity
android:name=".MainActivity"
android:exported="true"
android:label="@string/app_name"
android:theme="@style/Theme.FiveHundredDays">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
Here's an image of this error :

I just noticed I get an error in the AndroidManifest file also. At .MainActivity in activity to be precise.
error: MainActivity must extend android.app.Activity
Here's an image of this error :

I would really appreciate and welcome any Idea on how to fix this.
Thanks in Advance for your help.
Finaly fixed it..
Base on my research, I think because my internet connection was off-line. Gradle couldn't reach the library, it thought that was missing.
To Fix it I simply went; File -> Sync Project with Gradle Files
You could also try; File -> Invalidate Cache & Restart
i haven't imported androidx activity package, it might help you
implementation "androidx.activity:activity-ktx:1.7.1"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With