Error: Default Activity Not Found

2018-12-31 17:39发布

I upgraded IntelliJ Idea 12.0.4 to 12.10.

Now all the modules in my Android project give the error:

Error: Default Activity Not Found

I reverted to 12.0.4 and it works.

Any ideas ?? I think it might be related to some plugins not being installed cause the only other thing could have been a local config but I deleted the configuration folder to confirm and that didn't change anything.

30条回答
不流泪的眼
2楼-- · 2018-12-31 18:12

Invalidate Caches / Restart


Just Restart


After that, your app must be run!

查看更多
梦该遗忘
3楼-- · 2018-12-31 18:14

If you are working on a widget app this solution should work for you:

  1. Go to Edit Configuration
  2. Set Launch Option to nothing
查看更多
看淡一切
4楼-- · 2018-12-31 18:14

Edit androidmanifest.xml

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

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

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

</manifest>
查看更多
深知你不懂我心
5楼-- · 2018-12-31 18:15

@TouchBoarder almost had it. Although selecting "Do not launch Activity" results in nothing launching.

In Android Studio under Run/Debug Configuration -> Android Application -> General -> Activity -> select the option "Launch:"

Choose your Activity. This doesn't exactly fix the intended behaviour but rather overrides it correctly.

Edit run/debug configurations and specify launch activity

查看更多
妖精总统
6楼-- · 2018-12-31 18:17

If you see that error occur after upgrading versions of IntelliJ IDEA or Android Studio, or after Generating a new APK, you may need to refresh the IDE's cache.

File -> Invalidate Caches / Restart...
查看更多
伤终究还是伤i
7楼-- · 2018-12-31 18:18

You app have launch activity default?

possibly this could be your mistake

enter image description here

Step 1: Select Edit Configurations

enter image description here

Step 2: watch this warning: Default Activity not found enter image description here

Step 3: select a default activity enter image description here

enter image description here

Step 3: Save your changes and finish

enter image description here

Good Luck

enter image description here

查看更多
登录 后发表回答