0

Im pretty new to Flutter & Im attempting to run an app on the Android Emulator (works fine on the browser but not the emulator). Im getting this error whenever I attempt to run the command 'flutter run':

Error running path. Default activity not found
Unable to read manifest info from
/Users/tazar/Downloads/ethereal-meditations-app-made-app-runnable/build/app/outputs/flutter-a
pk/app.apk.
No application found for TargetPlatform.android_arm64.
Is your project missing an android/app/src/main/AndroidManifest.xml?
Consider running "flutter create ." to create one.

What's really strange about this is that I DO have a declared Main activity in my AndroidManifest.xml file. I have it declared & everything so I don't understand why I'm getting this error in the place. Here is my manifest file in case that can be of use:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="path">
   <application
        android:label="app name"
        android:icon="@mipmap/ic_launcher">

        <!-- FACEBOOK LOGIN -->
        <meta-data android:name="com.facebook.sdk.ApplicationId"
              android:value="@string/facebook_app_id"/>

          <activity android:name="com.facebook.FacebookActivity"
              android:configChanges=
                      "keyboard|keyboardHidden|screenLayout|screenSize|orientation"
              android:label="@string/app_name" />
          <activity
              android:name="com.facebook.CustomTabActivity"
              android:exported="true">
              <intent-filter>
                  <action android:name="android.intent.action.VIEW" />
                  <category android:name="android.intent.category.DEFAULT" />
                  <category android:name="android.intent.category.BROWSABLE" />
                  <data android:scheme="@string/fb_login_protocol_scheme" />
              </intent-filter>
          </activity>
        <!-- END FACEBOOK LOGIN -->
        
        <activity
            android:name=".MainActivity"
            android:launchMode="singleTop"
            android:theme="@style/LaunchTheme"
            android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
            android:hardwareAccelerated="true"
            android:windowSoftInputMode="adjustResize">
            <!-- Specifies an Android theme to apply to this Activity as soon as
                 the Android process has started. This theme is visible to the user
                 while the Flutter UI initializes. After that, this theme continues
                 to determine the Window background behind the Flutter UI. -->
            <meta-data
              android:name="io.flutter.embedding.android.NormalTheme"
              android:resource="@style/NormalTheme"
              />
            <!-- Displays an Android View that continues showing the launch screen
                 Drawable until Flutter paints its first frame, then this splash
                 screen fades out. A splash screen is useful to avoid any visual
                 gap between the end of Android's launch screen and the painting of
                 Flutter's first frame. -->
            <meta-data
              android:name="io.flutter.embedding.android.SplashScreenDrawable"
              android:resource="@drawable/launch_background"
              />
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
        </activity>
        <!-- Don't delete the meta-data below.
             This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
        <meta-data
            android:name="flutterEmbedding"
            android:value="2" />
            

        <!-- Sample AdMob App ID: ca-app-pub-3940256099942544~3347511713 -->
        <!-- EM account: android:value="ca-app-pub-3706741424467059~5052028195"/> -->
        <meta-data
            android:name="com.google.android.gms.ads.APPLICATION_ID"
            android:value="ca-app-pub-3706741424467059~5052028195"/>

            <!-- android:value="ca-app-pub-8622122832922913~9459724912"/> -->
            <!-- android:value="ca-app-pub-3940256099942544~3347511713"/> -->

    </application>
    <uses-permission android:name="android.permission.INTERNET"/>


</manifest>

Any assistance would be greatly appreciated. Thank you in advance.

Moataz Abdelraouf
  • 149
  • 1
  • 4
  • 13
  • Try it [https://stackoverflow.com/questions/15825081/default-activity-not-found-on-android-studio-upgrade](https://stackoverflow.com/questions/15825081/default-activity-not-found-on-android-studio-upgrade). Maybe it can help u resolve the problem – Bob Lee Jun 01 '22 at 04:18
  • The problem Im facing is that I DO have an main activity declared in my manifest file, but it's not reading it, like, it can't recognize it for some reason. – Moataz Abdelraouf Jun 01 '22 at 04:30
  • `Consider running "flutter create ." to create one`, also are you sure you are in your project root directory? – Huthaifa Muayyad Jun 01 '22 at 04:57
  • I think I'm in my project root directory. As for the "flutter create ." I don't see why I should run it when I already have a manifest file. This is the path to it: android/app/src/main/AndroidManifest.xml is the path to my an – Moataz Abdelraouf Jun 01 '22 at 05:23

0 Answers0