0

Whenever i try to run my app i keep getting this message "Error running app cannot find default activity".

I tried cleaning the project and rebuilding, as well as invaliding cache/restarting. I haven't written any code as yet this is the default hello world app so i'm not sure why i'm getting this message.

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

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

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

</manifest>







<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="com.example.android.ipokelist.MainActivity">

</android.support.constraint.ConstraintLayout>
Cryptic
  • 37
  • 6

1 Answers1

0

You are missing the TextView into your XML code. The following will help you.

<?xml version="1.0" encoding="utf-8"?>
    <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        tools:context="com.example.android.ipokelist.MainActivity">

    <TextView
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_centerHorizontal="true"
          android:layout_centerVertical="true"
          android:text="Hello, World!"
          tools:context=".MainActivity" />

    </android.support.constraint.ConstraintLayout>

For More, Visit: https://www.androidfflap.com/learn-android