xamarin.android 除錯時出現部署出錯(There were deployment errors.Continue?)
阿新 • • 發佈:2022-05-16
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