0

I am using Android Studio 3.4.2 on macOS 10.14.5. Every time I try to run my app, I get the following error:

Error running 'app': Default Activity not found

I tried this solution already (Error: Default Activity Not Found) but it didn't help.

Any help?

bart
  • 1,003
  • 11
  • 24
bsikriwal
  • 178
  • 3
  • 15

2 Answers2

1

If Invalidate Caches/Restart did not help you, then maybe you forget to declare Your Activity in Manifest

   <activity android:name="your.package.YourDefaultActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>

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

Try to add this into your manifest, This lines of code tell the system from which activity Application should start, like an entering point of your app

Jasurbek
  • 2,946
  • 3
  • 20
  • 37
0

Make sure you register your default activity

 <activity
        android:name="org.cocos2dx.cpp.AppActivity"
        android:screenOrientation="portrait"
        android:configChanges="orientation|keyboardHidden|screenSize"
        android:label="@string/app_name"
        android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
        android:launchMode="singleTask"
        android:taskAffinity=""  >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

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

Also make sure your selected module & default activity is correct

enter image description here

Ajay Pandya
  • 2,417
  • 4
  • 29
  • 65