2

enter image description here

How I fix this error \android\app\src\debug\AndroidManifest.xml

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.app.kathana">
    <!-- The INTERNET permission is required for development. Specifically,
         the Flutter tool needs it to communicate with the running application
         to allow setting breakpoints, to provide hot reload, etc.
    -->
    <uses-permission android:name="android.permission.INTERNET"/>
</manifest>

build.gradle enter image description here How I fix it

debug console

D:\Working\Intern\Codes\Apps\kathana\android\app\src\debug\AndroidManifest.xml:27:9-33:20 Error: android:exported needs to be explicitly specified for element <activity#androidx.test.core.app.InstrumentationActivityInvoker$EmptyActivity>. Apps targeting Android 12 and higher are required to specify an explicit value for android:exported when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details. D:\Working\Intern\Codes\Apps\kathana\android\app\src\debug\AndroidManifest.xml:34:9-40:20 Error: android:exported needs to be explicitly specified for element <activity#androidx.test.core.app.InstrumentationActivityInvoker$EmptyFloatingActivity>. Apps targeting Android 12 and higher are required to specify an explicit value for android:exported when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details.

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':app:processDebugMainManifest'.

Manifest merger failed with multiple errors, see logs

  • Try:

Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

BUILD FAILED in 4s Exception: Gradle task assembleDebug failed with exit code 1

enter image description here enter image description here

Dasun Dola
  • 541
  • 2
  • 16
  • Can you copy the debug console and paste it here? – My Car Sep 28 '22 at 09:49
  • The `androidx.test.core.app.InstrumentationActivityInvoker$EmptyActivity` would need to be an `` entry in your manifest to add the `exported` flag manually. Either your test/build tools are not setup to support a target of Android 12 or you may have to clean and rebuild. Maybe https://github.com/android/android-test/issues/896 see if you can update those test libraries to a newer version – zapl Sep 28 '22 at 10:14
  • That's already added bro – Dasun Dola Sep 28 '22 at 10:21

3 Answers3

1

Since your application is targeting Android 12, please take a look at your AndroidManifest.xml and make sure to add this android:exported.

It's also answered here - https://stackoverflow.com/a/67412314/12862313
with further reading links.

BlazingRSj
  • 121
  • 6
0

I found the error . That's not "android:exported="true" " , I comment android build.gradle dependencies and run the project one by one. Finally I commented the "implementation 'com.facebook.android:facebook-android-sdk:latest.release'" this facebook dependencies then project worked prefect. But I want facebook dependencies for my project therefore I added newest dependencies " implementation 'com.facebook.android:facebook-login:5.+'"

Dasun Dola
  • 541
  • 2
  • 16
0

check app/build/intermediates/merged_manifests/release/AndroidManifest.xml for any activities that use that do not have android:exported = true.

In my case I had to add these two lines in the main AndroidManifest.xml

Please note that I had this issue on React Native, not on flutter.

<activity android:exported="true" android:name="androidx.test.core.app.InstrumentationActivityInvoker$EmptyFloatingActivity" android:theme="@style/InstrumentationActivityInvokerFloatingActivityTheme">       
    <intent-filter>            
        <action android:name="android.intent.action.MAIN"/>      
    </intent-filter>        
    </activity>

    <activity android:exported="true" android:name="androidx.test.core.app.InstrumentationActivityInvoker$EmptyActivity" android:theme="@style/InstrumentationActivityInvokerEmptyActivityTheme">        
    <intent-filter>      
        <action android:name="android.intent.action.MAIN"/>
    </intent-filter>
    </activity>