So I went to sleep and then when I woke up I opened up my Android project. There is one blaring error all over my Android Manifest file.
All screens in the AndroidManifest show that they are not assignable to 'android.app.activity'
I never had this problem before. Obviously all of my activities are activities and not fragments. (Looking at the answers here, most of it have that kind of error; mistaking fragment for activity)
Also, this Android project has never thrown this kind of error for the past few months.
Right now all of my screens are showing red lines.
Somehow I can run the project just fine even with all those red lines.
Here's what I've tried so far:
I'm running the latest Android Studio.
UPDATE:
Here's my Android Manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.thispackage.thispackagename">
<uses-permission android:name="android.permission.INTERNET"/>
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/facebook_app_id"/>
<activity android:name=".MainActivity">
</activity>
<activity android:name=".SplashScreen"
android:screenOrientation="portrait">
</activity>
<activity android:name=".ScreenOne"
android:screenOrientation="portrait">
</activity>
<activity android:name=".ScreenTwo"
android:screenOrientation="portrait">
</activity>
<activity android:name=".RegisterActivity"
android:screenOrientation="portrait">
</activity>
<activity android:name=".ScreenThree"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".ScreenFour"
android:screenOrientation="portrait">
</activity>
<activity android:name=".ScreenFive"
android:screenOrientation="portrait">
</activity>
<activity android:name="com.facebook.FacebookActivity"
android:configChanges=
"keyboard|keyboardHidden|screenLayout|screenSize|orientation"
android:label="@string/app_name" />
<!--<activity android:name="com.facebook.FacebookActivity"-->
<!--android:configChanges=-->
<!--"keyboard|keyboardHidden|screenLayout|screenSize|orientation"-->
<!--android:theme="@android:style/Theme.Translucent.NoTitleBar"-->
<!--android:label="@string/app_name" />-->
</application>
</manifest>
UPDATE 2: The following is the screenshot of the error.
UPDATE 3: When I clicked more, it shows this:
To declare your activity, open your manifest file and add an <activity> element as a child of the <application> element. For example: <manifest ... > The only required attribute for this element is android:name, which specifies the class name of the activity.
Because it lets you define the structure and metadata of your android application and its components.
The Android manifest file helps to declare the permissions that an app must have to access data from other apps. The Android manifest file also specifies the app's package name that helps the Android SDK while building the app.
You may follow this to clear these types of errors
And in the last if all these not got succeeded then delete build folder from your project directory and app directory.
warning - Deleting build will delete your previously generated apk too as well as all the downloaded and extracted dependencies
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