maxspan
maxspan

Reputation: 14147

Xamarin form At most one element <application> with namespace '' was expected

I am getting this error as th manifest file contain 2 application element and I know that. Every time I remove the other application element it gets back again. The element item is the network_security_config.xml file I have set the Build Action = AndroidResource Do not Copy. How can I make sure application containing network_security_config gets created in the existing application element.

<?xml version="1.0" encoding="UTF-8"?>

-<manifest android:installLocation="auto" package="Me.Scheduler" android:versionName="1.0" android:versionCode="1" xmlns:android="http://schemas.android.com/apk/res/android">

<uses-sdk android:targetSdkVersion="28" android:minSdkVersion="21"/>

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

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

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

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


-<application android:name="android.app.Application" android:debuggable="true" android:icon="@mipmap/icon" android:allowBackup="true" android:label="Scheduler.Android">


-<activity android:name="crc64c2f66de974599db5.MainActivity" android:icon="@mipmap/icon" android:label="Scheduler" android:theme="@style/MainTheme" android:configChanges="orientation|screenSize">


-<intent-filter>

<action android:name="android.intent.action.MAIN"/>

<category android:name="android.intent.category.LAUNCHER"/>

</intent-filter>

</activity>

<service android:name="crc64a98abb514ffad9f1.KeepAliveService"/>

<receiver android:name="crc64a0e0a82d0db9a07d.BatteryBroadcastReceiver" android:label="Essentials Battery Broadcast Receiver" android:exported="false" android:enabled="true"/>

<receiver android:name="crc64a0e0a82d0db9a07d.EnergySaverBroadcastReceiver" android:label="Essentials Energy Saver Broadcast Receiver" android:exported="false" android:enabled="true"/>

<receiver android:name="crc64a0e0a82d0db9a07d.ConnectivityBroadcastReceiver" android:label="Essentials Connectivity Broadcast Receiver" android:exported="false" android:enabled="true"/>


-<provider android:name="xamarin.essentials.fileProvider" android:exported="false" android:grantUriPermissions="true" android:authorities="Me.Scheduler.fileProvider">

<meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/xamarin_essentials_fileprovider_file_paths"/>

</provider>

<receiver android:name="crc643f46942d9dd1fff9.PowerSaveModeBroadcastReceiver" android:exported="false" android:enabled="true"/>

<provider android:name="mono.MonoRuntimeProvider" android:exported="false" android:authorities="Me.Scheduler.mono.MonoRuntimeProvider.__mono_init__" android:initOrder="1999999999"/>

<!--suppress ExportedReceiver-->



-<receiver android:name="mono.android.Seppuku">


-<intent-filter>

<action android:name="mono.android.intent.action.SEPPUKU"/>

<category android:name="mono.android.intent.category.SEPPUKU.Me.Scheduler"/>

</intent-filter>

</receiver>

</application>

<application android:networkSecurityConfig="@xml/network_security_config"/>

</manifest>

Upvotes: 0

Views: 103

Answers (1)

Woj
Woj

Reputation: 833

I would assume you are actually changing the Android Manifest in bin folder. I guess you access it by double tapping on error you getting? I was making the same mistake. That Manifest is auto generated from Manifest in Properties folder.

Make that change in an actual android manifest in Properties folder, and see if problem persists.

Upvotes: 1

Related Questions