INSTALL PARSE FAILED MANIFEST MALFORMED: Failed parse - android

I am new to Flutter & I am trying to run an existing app on VS Code. I get this error message on my terminal when I attempt to run it on the Android emulator:
Error: ADB exited with exit code 1
Performing Streamed Install
adb: failed to install
/Users/tazar/Downloads/ethereal-meditations-app-made-app-runnable/build/app/outputs/flutter-apk/app
.apk: Failure [INSTALL_PARSE_FAILED_MANIFEST_MALFORMED: Failed parse during installPackageLI:
/data/app/vmdl469477611.tmp/base.apk (at Binary XML file line #260):
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.
This is my AndroidManifest.xml file:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="path">
<application
android:label="---"
android:icon="#mipmap/ic_launcher">
<!-- FACEBOOK LOGIN -->
<meta-data android:name="com.facebook.sdk.ApplicationId"
android:exported="true"
android:value="#string/facebook_app_id"/>
<activity android:name="com.facebook.FacebookActivity"
android:configChanges=
"keyboard|keyboardHidden|screenLayout|screenSize|orientation"
android:exported="true"
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:exported="true"
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>
The app runs fine on the browser, but not on the emulator. When I attempted to solve this issue, everywhere I looked, I was told to add "android:exported='true'" to each activity. I made those changes, but I still get the same error. I am kinda stuck now & I don't know what to do. Please feel free to share your thoughts, I would really appreciate it.

you have to follow these rules to migrate from targetSdk 30 to 31
https://developer.android.com/google/play/requirements/target-sdk#pre12
As far as I see it your manifest is missing this point
Intent filters: If your app contains activities, services, or
broadcast receivers that use intent filters, you must explicitly
declare the android:exported attribute for these components.

Related

how to resolve "Attribute android: ~ is not allowed here" in android app?

When I run device(emulator) in android studio, it occures some error like below pictures.
enter image description here
I attached code below.
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.egolium">
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<application
android:label="egolium"
android:name="${applicationName}"
android:icon="#mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:exported="true"
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"></meta-data>
<!-- android:name="com.google.android.gms.ads.APPLICATION_ID"-->
<!-- android:value="{admob_appId}"-->
/>
<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>
I tried restart in the menu that 'invalidate cache', but it still be same.
or when I remove the codes, it occures more errors
Could you let me know why it occures and how to resolve these?

You uploaded an APK or Android App Bundle without 'android:exported' property set but already been set in manifest file

I do have a problem with my current flutter project. My project was already built in release and also I put also the correct keystore file and the targetsdkversion. Now, when I am uploading my app in the playstore it always shows android exported property set (which as I was already know how to solve it.) I set all the receivers and tags that uses intent-filter to android:exported' true or false. Now, the problem is when I upload it to playstore it still showing the android exported error. I tried to migrate it to android studio in order to modify the merged manifest but I am unable to do so because I doesn't show the merged manifest. I also tried to manually edit the one on the app/build/intermediates/merged_manifest folder but still same results. I am using latest flutter with dart for it. Any more tips for me to fix? Attached also here is my manifest file.
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.jerrybuyer.app" xmlns:tools="http://schemas.android.com/tools">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="com.google.android.gms.permission.AD_ID" tools:node="remove"/>
<application
android:label="Jerry App"
android:name="${applicationName}"
android:icon="#mipmap/ic_launcher" tools:node="merge">
<activity
android:name=".MainActivity"
android:exported="true"
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"
/>
<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" />
<!-- facebook configs -->
<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="#string/facebook_app_id"/>
<meta-data android:name="com.facebook.sdk.ClientToken" android:value="#string/facebook_client_token"/>
<activity android:name="com.facebook.FacebookActivity"
android:configChanges=
"keyboard|keyboardHidden|screenLayout|screenSize|orientation"
android:label="#string/app_name" android:exported="true"/>
<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>
</application>
</manifest>
PS: I have now managed to unlock my merged manifest but even though I saw the merged manifest file, it doesnt show any intent-filter that needs an android exported
Here is the screenshot of the android merged-manifest that I managed to show. It doesn't show any errors regarding the intent-filter android:exported

Error running Flutter app on Android Emulator

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.

How to resolve android property not set when trying to upload app to the Play Store

I am trying to upload my app to the Play Store but I get the error in the screenshot below
According to Google's suggestion, I added android:exported= "true" to my AndroidManifest.xml file. But after doing so the output is still the same. Please how do I fix this problem. Thank you
Here is a view of my AndroidManifest.xml file
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.lds.jumbocheap">
<queries>
<intent>
<action android:name="android.intent.action.SENDTO" />
<data android:scheme="mailto" />
</intent>
</queries>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<application
android:requestLegacyExternalStorage="true"
android:label="JumboCheap"
android:icon="#mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:exported = "true"
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 buiActivity 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" />
<meta-data android:name="com.startapp.sdk.APPLICATION_ID" android:value="#####" />
</application>
</manifest>
check your minsdk and target sdk version
minSdkVersion 21
targetSdkVersion 30

Error: ADB exited with exit code 1 Performing Streamed Install adb: failed to install Failure [INSTALL_PARSE_FAILED_MANIFEST_MALFORMED:

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!!!
You need to add this line of code within the activity in the above AndroidManifest.xml file -
android:exported="true"

Categories

Resources