Schelmuffsky
Schelmuffsky

Reputation: 320

How to fix "Error running 'app': Default Activity not found"

I changed the characterset from utf-8 to utf-16 in the manifest and in the ParseActivity. At first, the app launched just fine, but then said problem occurred. I could even publish the apps APK and install it on my phone, where it works without problems. Idnd't change anything on the code since.

Here is what I tried so far:

unfortunately, i had problems to post the first 3 lines of the manifest. the just seem to become invisible in the "code-layout", but here they are ([<] = <, and [>] = >):

[<] ?xml version="1.0" encoding="utf-16"?[>]

[<]manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.hjgjhftf.smartcards"[>]

<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

<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=".PracticeActivity" />
    <activity
        android:name=".LoadCreate"
        android:configChanges="keyboardHidden|orientation|screenSize" />
    <activity android:name=".CreateActivity" />
    <activity android:name=".BrowseActivity" />
    <activity android:name=".ParseActivity" />
    <activity android:name=".EndPracticeActivity"></activity>
</application>

Upvotes: 3

Views: 2534

Answers (3)

Umut Can
Umut Can

Reputation: 51

I got the same problem too, I solve this with:

flutter clean 
flutter doctor

Upvotes: 0

Shiva Gyawali
Shiva Gyawali

Reputation: 61

I got the same problem. Edit Configuration--> Launch option to nothing And solved by:

  • Selecting module name and then Edit Configuration
  • Launch option : select nothing [Default is default activity] Then apply changes.

Posted here, because it may work for someone else.

Upvotes: 0

Schelmuffsky
Schelmuffsky

Reputation: 320

I solved the problem by changing the file encoding in the MainActivity from UTF-8 to UTF-16. After doing that, Android Studio could recognise the default activity, in this case MainActivity, once again.

Upvotes: 0

Related Questions