Cannot compile when specifying uncompressed file extensions in Xamarin Forms for an AAB

Viewed 127

I have an Android app that I have developed using Xamarin Forms in Visual Studio and I have a problem with packaging it for Play Store. Now, when I package it as an APK and install it directly on a device, everything works (it's been tested on multiple different devices).

The problem arises when it's packaged as an AAB and put on Play Store for the Internal Test phase. When I was testing using APKs I had to add '.wav' to the 'leave the following resource extensions uncompressed' option, because it wouldn't compile otherwise. I recall that being a problem specific to APKs, so when I packaged it up for Play Store as a bundle (AAB) I took this out. However, for everyone who now tests it, the app crashes when a sound plays.

So, I thought, let's put '.wav' back in. But now it won't compile and I get two errors, related to a number of objects, that don't look in the slightest bit related to my WAV files or compressing them:

failed to read file: magic value is 0xbebafeca but AAPT expects 0x54504141.

C:\Program Files (x86)\Android\android-sdk\platforms\android-29\android.jar@res/layout/date_picker_month_item_material.xml
C:\Program Files (x86)\Android\android-sdk\platforms\android-29\android.jar@android/app/FragmentManagerNonConfig.class
C:\Program Files (x86)\Android\android-sdk\platforms\android-29\android.jar@android/content/res/ObbScanner.class
C:\Program Files (x86)\Android\android-sdk\platforms\android-29\android.jar@android/hardware/camera2/TotalCaptureResult.class
C:\Program Files (x86)\Android\android-sdk\platforms\android-29\android.jar@android/provider/FontsContract$FontFamilyResult.class
C:\Program Files (x86)\Android\android-sdk\platforms\android-29\android.jar@android/provider/MediaStore$Audio$Radio.class
C:\Program Files (x86)\Android\android-sdk\platforms\android-29\android.jar@android/util/Xml.class
C:\Program Files (x86)\Android\android-sdk\platforms\android-29\android.jar@java/util/prefs/BackingStoreException.class

and

uncompiled PNG file passed as argument. Must be compiled first into .flat file..

C:\Program Files (x86)\Android\android-sdk\platforms\android-29\android.jar@res/drawable-hdpi-v4/btn_check_on_focused_holo_dark.png
C:\Program Files (x86)\Android\android-sdk\platforms\android-29\android.jar@res/drawable-hdpi-v4/dropdown_ic_arrow_disabled_holo_light.png
C:\Program Files (x86)\Android\android-sdk\platforms\android-29\android.jar@res/drawable-hdpi-v4/ic_menu_add.png
C:\Program Files (x86)\Android\android-sdk\platforms\android-29\android.jar@res/drawable-ldpi-v4/ic_menu_archive.png
C:\Program Files (x86)\Android\android-sdk\platforms\android-29\android.jar@res/drawable-ldpi-v4/reticle.png
C:\Program Files (x86)\Android\android-sdk\platforms\android-29\android.jar@res/drawable-mdpi-v4/ab_bottom_transparent_dark_holo.9.png
C:\Program Files (x86)\Android\android-sdk\platforms\android-29\android.jar@res/drawable-mdpi-v4/btn_toggle_on_pressed_holo_dark.9.png
C:\Program Files (x86)\Android\android-sdk\platforms\android-29\android.jar@res/drawable-xhdpi-v4/btn_dropdown_normal.9.png
C:\Program Files (x86)\Android\android-sdk\platforms\android-29\android.jar@res/drawable-xhdpi-v4/btn_toggle_off_disabled_holo_dark.9.png
C:\Program Files (x86)\Android\android-sdk\platforms\android-29\android.jar@res/drawable-xhdpi-v4/textfield_search_pressed.9.png
C:\Program Files (x86)\Android\android-sdk\platforms\android-29\android.jar@res/drawable-xxhdpi-v4/btn_rating_star_off_focused_holo_light.png
C:\Program Files (x86)\Android\android-sdk\platforms\android-29\android.jar@res/drawable/pointer_top_left_diagonal_double_arrow_large_icon.xml

My compile options are below:

Android Options

I've spent quite a bit of time hunting for a solution and there's nothing on the internet that helps, or even mentions these errors. Please does anyone have any idea what's going on?

Edit:

It's just worked. I've updated nothing and made no other changes. After various combinations of restarting VS, cleaning, building and archiving it suddenly worked. I'm leaving this open as I have absolutely no explanation for why, on a single, random occasion without making any changes, it would work, or why it would report all those weird errors every other time.

Now to get it onto the Internal Test on Play Store to see if adding '.wav' to uncompressed file extensions fixes the crash.

0 Answers
Related