xamarin.android调试时遇到 下述情况
详细信息如下:
Build started…
1>—— Build started: Project: XAndoridVm, Configuration: Debug Any CPU ——
1>C:/Users/ZX/source/repos/XAndoridVm/XAndoridVm/Properties/AndroidManifest.xml : warning XA4211: AndroidManifest.xml //uses-sdk/@android:targetSdkVersion ’30’ is less than $(TargetFrameworkVersion) ”. Using API-31 for ACW compilation.
1> XAndoridVm -> C:/Users/zx/source/repos/XAndoridVm/XAndoridVm/bin/Debug/XAndoridVm.dll
1>C:/Program Files/Microsoft Visual Studio/2022/Community/MSBuild/Xamarin/Android/Xamarin.Android.Legacy.targets(315,5): warning XA0122: Assembly ‘Xamarin.Android.Support.Annotations’ is using a deprecated attribute ‘[assembly: Java.Interop.DoNotPackageAttribute]’. Use a newer version of this NuGet package or notify the library author.
2>Starting deployment to OPPO PCRT00 …
2>Deploying to OPPO PCRT00 …
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
========== Deploy: 0 succeeded, 1 failed, 0 skipped ==========
看了下上述的详细报错信息,怀疑是编译版本有问题,从第一条黄色信息看应该是目标版本可能高了(编译时使用的目标版本是12)。于是决定将编译目标版本调低看看……如下为调整地方。
将目标版本调整为android 9之后,测试成功。
原创文章,作者:奋斗,如若转载,请注明出处:https://blog.ytso.com/272395.html