admin管理员组文章数量:1356097
I have a .NET 9 MAUI project, targeting Android devices only, built with Visual Studio 2022 17.13.5.
After adding a reference to a third-party DLL, I cannot compile in Debug configuration because of this error:
Errore (attivo) XAAMM0000 C:\myProject\obj\Debug\net9.0-android35.0\AndroidManifest.xml:14:225-250 Error:
Attribute application@debuggable value=(true) from AndroidManifest.xml:14:225-250
is also present at AndroidManifest.xml:15:9-35 value=(false).
Suggestion: add 'tools:replace="android:debuggable"' to <application> element at AndroidManifest.xml:14:3-31:17 to override. myProject (net9.0-android35.0) C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\35.0.39\tools\Xamarin.Android.Common.targets 1561
Following the suggestion, I added the ,android:debuggable
attribute to my AndroidManifest.xml
manifest and the projects compiles.
The situation in Release mode is the opposite: I cannot compile the project if I leave there the attribute, but it compiles if I remove it.
Errore (attivo) AMM0000
tools:replace specified at line:14 for attribute android:debuggable, but no new value specified
C:\repos\myProject\myProject\obj\Release\net9.0-android35.0\AndroidManifest.xml
Error:
Validation failed, exiting myProject (net9.0-android35.0) C:\repos\myProject\myProject\obj\Release\net9.0-android35.0\AndroidManifest.xml 14
Errore (attivo) XAAMM0000 C:\repos\myProject\myProject\obj\Release\net9.0-android35.0\AndroidManifest.xml:14:3-31:17
Error:
tools:replace specified at line:14 for attribute android:debuggable, but no new value specified
C:\repos\myProject\myProject\obj\Release\net9.0-android35.0\AndroidManifest.xml
Error:
Validation failed, exiting myProject (net9.0-android35.0) C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\35.0.39\tools\Xamarin.Android.Common.targets 1561
Now, I was expecting that the debuggable attribute would have been automatically replaced based on the configuration, but this doesn't happen in Release mode.
How can I solve this? Is there a way, in Release mode, to either:
- Replace with
false
the,android:debuggable
value - Remove the
,android:debuggable
attribute
I have a .NET 9 MAUI project, targeting Android devices only, built with Visual Studio 2022 17.13.5.
After adding a reference to a third-party DLL, I cannot compile in Debug configuration because of this error:
Errore (attivo) XAAMM0000 C:\myProject\obj\Debug\net9.0-android35.0\AndroidManifest.xml:14:225-250 Error:
Attribute application@debuggable value=(true) from AndroidManifest.xml:14:225-250
is also present at AndroidManifest.xml:15:9-35 value=(false).
Suggestion: add 'tools:replace="android:debuggable"' to <application> element at AndroidManifest.xml:14:3-31:17 to override. myProject (net9.0-android35.0) C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\35.0.39\tools\Xamarin.Android.Common.targets 1561
Following the suggestion, I added the ,android:debuggable
attribute to my AndroidManifest.xml
manifest and the projects compiles.
The situation in Release mode is the opposite: I cannot compile the project if I leave there the attribute, but it compiles if I remove it.
Errore (attivo) AMM0000
tools:replace specified at line:14 for attribute android:debuggable, but no new value specified
C:\repos\myProject\myProject\obj\Release\net9.0-android35.0\AndroidManifest.xml
Error:
Validation failed, exiting myProject (net9.0-android35.0) C:\repos\myProject\myProject\obj\Release\net9.0-android35.0\AndroidManifest.xml 14
Errore (attivo) XAAMM0000 C:\repos\myProject\myProject\obj\Release\net9.0-android35.0\AndroidManifest.xml:14:3-31:17
Error:
tools:replace specified at line:14 for attribute android:debuggable, but no new value specified
C:\repos\myProject\myProject\obj\Release\net9.0-android35.0\AndroidManifest.xml
Error:
Validation failed, exiting myProject (net9.0-android35.0) C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\35.0.39\tools\Xamarin.Android.Common.targets 1561
Now, I was expecting that the debuggable attribute would have been automatically replaced based on the configuration, but this doesn't happen in Release mode.
How can I solve this? Is there a way, in Release mode, to either:
- Replace with
false
the,android:debuggable
value - Remove the
,android:debuggable
attribute
1 Answer
Reset to default 0Did you check your AndroidManifest.xml? The first error means that the debuggable property has different value in AndroidManifest.xml or the other dependency' Manifest. And this made the gradle can't merge the Manifest automatically. So you can use tools:replace="android:debuggable"
to fix it.
And the second error means that when you used tools:replace="android:debuggable"
, you have to set the new value for android:debuggable
. Such as:
<manifest xmlns:android="http://schemas.android/apk/res/android"
xmlns:tools="http://schemas.android/tools">
<application android:debuggable="true" tools:replace="android:debuggable" ....
本文标签: androidCompile MAUI NET 9 project with external DLLStack Overflow
版权声明:本文标题:android - Compile MAUI .NET 9 project with external DLL - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744049508a2582160.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
a reference to a third-party DLL
.. what exactly is this? does it contains it's own AndroidManifest.xml? – Bhavanesh N Commented Mar 28 at 9:22