I’m migrating my flutter app to Android 12 and I don’t know where exactly I’ve to put the android:export lines in my AndroidManifest.
I’ve tries several options but always the console throws me an error about this.
This is my AndroidManifest
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.atgapp.atgapp">
<application
android:label="atgapp"
android:name="${applicationName}"
android:icon="@mipmap/icono"
android:exported="true">
<meta-data
android:name="com.google.firebase.messaging.default_notification_icon"
android:resource="@mipmap/icon" />
<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">
<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>
<intent-filter>
<action android:name="FLUTTER_NOTIFICATION_CLICK" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<meta-data
android:name="flutterEmbedding"
android:value="2" />
<service
android:name=".MyFirebaseMessagingService">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
</application>
</manifest>
Thank you for your help
2
Answers
Just update your
Service
tagFirst, if you open the app in Android Studio and go through your Manifest you should find warnings for exporting services/activities, fix those by adding the suggested.
After, you should create a API 31 emulator (with Android 12) and try running your app, you will probably receive an error caused by some library that is not updated, like the following:
for the example above, the library TrueTime is outdated, updating it resolved the problem.