skip to Main Content

so my issue is that I can’t run my flutter project on android (in android studio), iOS works fine. The error I have is:

adb: failed to install /path.../build/app/outputs/flutter-apk/app.apk: Failure [INSTALL_PARSE_FAILED_MANIFEST_MALFORMED: Failed parse during installPackageLI: /data/app/vmdl687364018.tmp/base.apk (at Binary XML file line #118): com.dexterous.flutterlocalnotifications.ScheduledNotificationBootReceiver: 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.

I figured that the issue was a lack of a android:exported="true" but it still don’t work. I may miss something obvious (I started flutter less than a week ago).

There is

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="secret">
   <application
        android:label="secret"
        android:name="${applicationName}"
        android:icon="@mipmap/ic_launcher">
        <activity
            android:exported="true"
            android:name=".MainActivity"
            android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"

            android:hardwareAccelerated="true"
            android:launchMode="singleTop"
            android:theme="@style/LaunchTheme"
            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. -->

            <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" />
    </application>
</manifest>

also I have an "Unresolved class ‘{applicationName}’ " at android:name="${applicationName}" but I don’t think it’s the problem

Thanks a lot for your time 🙂

2

Answers


  1. Remove android:name="${applicationName}" if you are using Firebase replace it with android:name="androidx.multidex.MultiDexApplication"

    Login or Signup to reply.
  2. Add

    android:exported="true"
    

    to your AndroidManifest file

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search