Skip to content

Commit 8a774ca

Browse files
committed
Updated error docs and include aka.ms link
1 parent 2f79426 commit 8a774ca

File tree

2 files changed

+23
-4
lines changed

2 files changed

+23
-4
lines changed

Documentation/guides/messages/xa5207.md

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,33 @@ ms.date: 06/26/2019
77

88
## Example messages
99

10-
```
10+
```dotnetcli
1111
XA5207: Could not find android.jar for API Level 28. This means the Android SDK platform for API Level 28 is not installed. Either install it in the Android SDK Manager (Tools > Android > Android SDK Manager...), or change your Xamarin.Android project to target an API version that is installed.
1212
```
1313

1414
## Issue
1515

16-
In order to build a project, the Android SDK Platform matching the target API level must be installed.
16+
In order to build a project, the Android SDK Platform matching the target API level must be installed.
1717

1818
## Solution
1919

20-
Use the Android SDK Manager to install the Android SDK Platform for the desired API level.
20+
Use the Android SDK Manager (Tools > Android > Android SDK Manager...) to install the Android SDK Platform for the desired API level. Alternatively you can install the missing API level by running the following from a terminal or command prompt
21+
22+
`dotnet build -t:InstallAndroidDependencies -f net8.0-android -p:AndroidSdkDirectory=<path to sdk directory>`
23+
24+
Part of the new .net android system is when upgrading projects you will automatically be
25+
upgraded to the latest API level. For example net7.0-android allowed you to target API 33,
26+
but net8.0-android will automatically target API 34. If you want to keep your current
27+
target API level you will need to add the 'uses-sdk' `android:targetSdkVersion` to your `AndroidManifest.xml` file.
28+
29+
```xml
30+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
31+
android:versionCode="1"
32+
android:versionName="1.0"
33+
package="com.companyname.myapp">
34+
<uses-sdk android:targetSdkVersion="33">
35+
<application android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" />
36+
</manifest>
37+
```
38+
39+
You might then need to run the `InstallAndroidDependencies` target as mentioned above to ensure that the required API level is installed.

src/Xamarin.Android.Build.Tasks/Properties/Resources.resx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -867,7 +867,7 @@ Remove the '{0}' reference from your project and add the '{1}' NuGet package ins
867867
{0} - The missing tool name</comment>
868868
</data>
869869
<data name="XA5207" xml:space="preserve">
870-
<value>Could not find android.jar for API level {0}. This means the Android SDK platform for API level {0} is not installed. {2} ({1} missing.)</value>
870+
<value>Could not find android.jar for API level {0}. This means the Android SDK platform for API level {0} is not installed. {2} ({1} missing.) See https://aka.ms/xa5207 for more details.</value>
871871
<comment>The following are literal names and should not be translated: android.jar
872872
{0} - The API level name
873873
{1} - The expected path of the android.jar file

0 commit comments

Comments
 (0)