1

I am cloning Repo and facing this issue

as im using android emulator in macbook air M1

my AndroidMenifest.xml is as below

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

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

    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
    <uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />

   <application
        android:label="Green Co"
        android:allowBackup="false"
        android:fullBackupOnly="false"
        android:icon="@mipmap/ic_launcher">

        <meta-data android:name="com.google.android.geo.API_KEY"
           android:value="-----------------------------"/>

           <meta-data
        android:name="com.google.firebase.messaging.default_notification_channel_id"
        android:value="@string/default_notification_channel_id" />

        <meta-data
   android:name="com.google.firebase.messaging.default_notification_icon"
   android:resource="@mipmap/ic_launcher" />

        <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:screenOrientation="portrait"
            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>

            <intent-filter>
              <action android:name="FLUTTER_NOTIFICATION_CLICK" />
              <category android:name="android.intent.category.DEFAULT" />
            </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" />
            <!-- Add your Google Maps API Key here -->
<meta-data android:name="com.google.android.geo.API_KEY"
               android:value="----------------------------"/>
    </application>
</manifest>

and im facing the error

Error: ADB exited with exit code 1 Performing Streamed Install

adb: failed to install /Users/gajanan/Ampra/flutter/greencorridor_package/build/app/outputs/flutter-apk/app.apk: Failure [INSTALL_PARSE_FAILED_MANIFEST_MALFORMED: Failed parse during installPackageLI: /data/app/vmdl760273936.tmp/base.apk (at Binary XML file line #64): com.ampra.greencorridor.MainActivity: Targeting S+ (version 31 and above) requires that an explicit value for android:exported be defined when intent filters are present] Error launching application on sdk gphone64 arm64.

Hoping to find some solution about it its really appriciate if some one help me to find the solution for this!!!

Gajanan Shinde
  • 183
  • 1
  • 4
  • 15
  • Does this answer your question? [Manifest merger failed targeting Android 12](https://stackoverflow.com/questions/67654506/manifest-merger-failed-targeting-android-12) – griffins Dec 03 '21 at 07:05

1 Answers1

0

You need to add this line of code within the activity in the above AndroidManifest.xml file -

android:exported="true"
Shrikant Shetty
  • 1,206
  • 1
  • 8
  • 3