Reputation: 6893
In Visual Studio 2017, I am able to set Target Android Version as 9.0 but on Visual Studio 2019, it doesnt offer me.
max. it offers 8.1 version as shown below. I wonder if there is a breaking change and it has something to do with above "compile using target framework", so it automatically uses this setting as Target Android Version. Because when I build my project in VS2019, it builds fine.
i have it v9.0(level 28.0.2) installed and it is shown in Vs2017 but not in Vs2019 as target Android version but as Target Framework.
EDIT: here is how Android SDK looks like. as you can see that Android 9.0 is installed.
Upvotes: 3
Views: 5898
Reputation: 6893
It seems like that it is a bug in VS2019. I have asked it over xamarin gitter and reply from Microsoft engineers:
we have fixed it and the fix will ship soon. For now, you can manually edit the manifest and set it there, and everything will work.
EDIT: latest VS 2019 update has a fix for this problem.
https://learn.microsoft.com/en-us/visualstudio/releases/2019/release-notes#16.0.3
Upvotes: 2
Reputation: 794
batmaci.
You are not the only one. I have exactly the same situation. Neither Minimum Android Version or Target Android Version are even populated when my project is opened with VS2019, where all is normal with VS2017. Not only are they not populated, but like you, I also can't set Target Android Version because Android 9.0 doesn't exist in the list. My guess is that it is not correctly reading the AndroidManifest when loading the project. Updating all the SDK tools resulted in no change. Since the correct settings are in the manifest it doesn't seem to have any effect on the apk produced. The apk runs fine on my Android 9 phone.
The other pain is that you can't remove a reference, because the right-click menu has lost that option. The only way I can get the remove item on the menu is to unload the project, and view the csproj file and then reload it with the file still open. Then like magic, the Remove item is back and you can swap out, for instance, a debug dll for a release dll.
I'm using VS2019 16.0.1 Preview 1.0, so I guess if it is not fixed in that, it sure won't be fixed in the release version of VS2019. Strange that others here don't have the problem.
Upvotes: 0
Reputation: 46
You shoud install Android SDK Platform-Tools 28.0.02 In this case you can acess the adress https://developer.android.com/studio/releases/platform-tools and download it.
After this, restart your pc and open the visual studio 2019. Open your xamarin project, select Xamarin.Android project go to properties and change the target Android version to Android 9.0
Upvotes: 0