由于 Google Play 政策,我需要将我的 Xamarin 项目更新到 API 34。我已将
targetSdkVersion
更改为 34,但没有成功。我需要在 11 月 1 日之前将项目归档为 *.aab 文件格式
我收到如下错误
Skipping target "_CompileToDalvik" because all output files are up-to-date with respect to the input files.
Creating "obj\Release\130\android\assets\shrunk\shrunk.flag" because "AlwaysCreate" was specified.
The TargetFrameworkVersion (Android API level 33) is lower than the targetSdkVersion (34). Please increase the `$(TargetFrameworkVersion)` or decrease the `android:targetSdkVersion` in the `AndroidManifest.xml` so that the API levels match.
XABBA7024: Xamarin.Tools.Zip.ZipIOException: The file 'obj\Release\130\android\bin\base.zip' is not a ZIP archive.
at Xamarin.Tools.Zip.ZipArchive.Open(String path, FileMode mode, String defaultExtractionDir, Boolean strictConsistencyChecks, IPlatformOptions options) in /Users/runner/work/1/s/LibZipSharp/Xamarin.Tools.Zip/ZipArchive.cs:line 282
at Xamarin.Android.Tasks.BuildApk.ExecuteWithAbi(String[] supportedAbis, String apkInputPath, String apkOutputPath, Boolean debug, Boolean compress, IDictionary`2 compressedAssembliesInfo, String assemblyStoreApkName)
at Xamarin.Android.Tasks.BuildApk.RunTask()
at Microsoft.Android.Build.Tasks.AndroidTask.Execute() in /Users/runner/work/1/s/xamarin-android/external/xamarin-android-tools/src/Microsoft.Android.Build.BaseTasks/AndroidTask.cs:line 17
Done building project "Project.Droid.csproj" -- FAILED.
Build FAILED.
我已经尝试过
C:\Program Files (x86)\Android\android-sdk\platforms
bin
和 obj
文件夹并尝试重新打开项目。我仍然遇到同样的问题。targetSdkVersion
<TargetFrameworkVersion>v14.0</TargetFrameworkVersion>
文件上添加
.csproj
AndroidManifest.xml
文件,我只是将
targetSdkVersion
从33更改为34,如下
<uses-sdk android:minSdkVersion="16" android:targetSdkVersion="34" />
发现:
base.zip
上的
\obj\Release\130\android\bin
文件将损坏。
Microsoft Visual Studio Enterprise 2022
Version 17.6.4
我已经阅读了几篇关于此问题的文章,但没有有效的解决方案。有什么想法吗?
谢谢你
请记住,LTSC 并不总是最佳选择。
干杯,