Xamarin Forms / API Level 34 / Deployment Failed

CSharpest 0 Reputation points
2024-10-04T15:53:27.25+00:00

While migrating the mobile app to some new tech, we need to deploy an update to our current app which requires Android 14. I've updated the AndroidManifest.xml to 34:

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

The app builds fine but when I try to deploy and run in an emulator I get this error:

/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Legacy.targets(348,5): warning XA1008: 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. /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(2103,3): error XABLD7024: Xamarin.Tools.Zip.ZipIOException: The file 'obj/Debug/android/bin/com.Funny.apk' is not a ZIP archive. /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(2103,3): error XABLD7024:   at Xamarin.Tools.Zip.ZipArchive.Open (System.String path, System.IO.FileMode mode, System.String defaultExtractionDir, System.Boolean strictConsistencyChecks, Xamarin.Tools.Zip.IPlatformOptions options) [0x0014c] in /Users/runner/work/1/s/LibZipSharp/Xamarin.Tools.Zip/ZipArchive.cs:283  /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(2103,3): error XABLD7024:   at Xamarin.Android.Tasks.ZipArchiveEx..ctor (System.String archive, System.IO.FileMode filemode) [0x0001b] in <2042d6a236404eba9dfd12d3be81a9bd>:0  /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(2103,3): error XABLD7024:   at Xamarin.Android.Tasks.BuildApk.ExecuteWithAbi (System.String[] supportedAbis, System.String apkInputPath, System.String apkOutputPath, System.Boolean debug, System.Boolean compress, System.Collections.Generic.IDictionary`2[TKey,TValue] compressedAssembliesInfo, System.String assemblyStoreApkName) [0x0004d] in <2042d6a236404eba9dfd12d3be81a9bd>:0  /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(2103,3): error XABLD7024:   at Xamarin.Android.Tasks.BuildApk.RunTask () [0x00117] in <2042d6a236404eba9dfd12d3be81a9bd>:0  /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(2103,3): error XABLD7024:   at Microsoft.Android.Build.Tasks.AndroidTask.Execute () [0x00000] in /Users/runner/work/1/s/xamarin-android/external/xamarin-android-tools/src/Microsoft.Android.Build.BaseTasks/AndroidTask.cs:17      1 Warning(s)     1 Error(s)

Note that the app uses Xamarin.Forms version 4.0.0 and Xamarin.Essentials version 1.8.1. We're building on an iMac.

Any ideas?

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,348 questions
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.