Android Manifest Build and Deploy

Stewart AC Basterash 26 Reputation points
2021-03-25T22:15:12.383+00:00

I am using the latest incarnation of Visual Studio 2019 (version 16.9.2). I am building a proof of concept automation tool. The code is literally the "tabbed" PCL template for Android ONLY in Visual Studio. I have altered the code just enough to save the List<item> to a JSON file... My simple requirement is to build a "foreground" service to "read" from the JSON file when a system event (aka Receiver) is raised... Everything seems to work just fine with one exception... I need to have the "service" read the file and create an Android PDU data item based on the JSON item element, and the data from the receiver data.. Everything has worked fine but it appears that I need to have a "File Provider" to make this work (based on what I am reading).

There are no errors thrown, but it has been conjectured that I require a File Provider, which entails altering the "manifest". No matter what I do, The Visual Studio compiler is not happy... Simply decorating the manifest with the <application></application> XML element causes the compiler to throw this error upon deployment...

XA0130: Sorry. Fast deployment is only supported on devices running Android 5.0 (API level 21) or higher.

My android emulator is at level 29... so... ??? If I adjust the android manifest property options and turn off "Fast Deployment" it begins to complain about other compiler settings... If I chase these down the app no longer compiles or functions at all... If I remove the application element and set everything back to startup settings... I am back to normal.

If I attempt to add the <Provider> element within the application element (which is the goal) it throws various other compiler errors and am absolutely dead in the water...

Can someone provide some insight? This is quite frustrating...

Developer technologies | .NET | Xamarin
{count} votes

1 answer

Sort by: Most helpful
  1. Stewart AC Basterash 26 Reputation points
    2021-03-26T05:27:56.76+00:00

    The changes that you provided were the default for this template in VS... The problem was an error in the AndroidManifest.xml file. I was in fact able to compile and run the app on both the emu and a test device. This did not solve the problem at hand, but it did allow me to move forward.

    Thank you for your assistance.

    I also needed to resolve a follow-up issue associated with the Android Project Options related to "supported architectures". Once the file provider was entered correctly in the Manifest, the app threw another exception associated with the ABI that was being linked. I was forced to remove the first "arm" entry in order to get by this error as well.


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.