0
votes

Error while executing: am start -n

"com.example.myapplication/com.example.myapplication.Detail" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.example.myapplication/.Detail } Error type 3 Error: Activity class {com.example.myapplication/com.example.myapplication.Detail} does not exist.

Error while Launching activity

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.myapplication">

<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>
    <activity android:name=".Detail"
        android:label="SQLite Example - Details"></activity>
</application>

</manifest>
1

1 Answers

0
votes

It is a easy problem which is happened when you migrate to androidX (at least it happened for me by this reason). An easy solution is:

  1. making a new project (same package name as the current one)
  2. go to app\src\main and delete all files in main directory (for this new project)
  3. go to app\src\main and copy all files in main directory (for the old project)
  4. past the files in app\src\main directory (the new project)
  5. run the new project