-
Notifications
You must be signed in to change notification settings - Fork 564
[xabt] additional fixes for non-integer API levels #10536
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
We found the following errors with many `javac` errors:
class MyTextObjectFont : Android.Graphics.Pdf.Component.PdfPageTextObjectFont
{
public MyTextObjectFont(Android.Graphics.Pdf.Component.PdfPageTextObjectFont font) : base(font)
{
}
}
Such as:
obj\Debug\net10.0-android36.1\android\src\crc643b87557a63e7c027\MainActivity_MyTextObjectFont.java(5,40): error JAVAC0000: error: package android.graphics.pdf.component does not exist
extends android.graphics.pdf.component.PdfPageTextObjectFont
This appears to be caused by the use of:
"C:\Program Files (x86)\Android\android-sdk\platforms\android-36\android.jar"
When the build *should* be using:
"C:\Program Files (x86)\Android\android-sdk\platforms\android-36.1\android.jar"
Update various MSBuild logic to handle non-integer API levels.
Co-authored-by: Jonathan Pryor <jonpryor@vt.edu>
jonpryor
reviewed
Oct 14, 2025
src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest2.cs
Outdated
Show resolved
Hide resolved
grendello
approved these changes
Oct 20, 2025
jonathanpeppers
added a commit
that referenced
this pull request
Oct 20, 2025
We found the following errors with many `javac` errors:
class MyTextObjectFont : Android.Graphics.Pdf.Component.PdfPageTextObjectFont
{
public MyTextObjectFont(Android.Graphics.Pdf.Component.PdfPageTextObjectFont font) : base(font)
{
}
}
Such as:
obj\Debug\net10.0-android36.1\android\src\crc643b87557a63e7c027\MainActivity_MyTextObjectFont.java(5,40): error JAVAC0000: error: package android.graphics.pdf.component does not exist
extends android.graphics.pdf.component.PdfPageTextObjectFont
This appears to be caused by the use of:
"C:\Program Files (x86)\Android\android-sdk\platforms\android-36\android.jar"
When the build *should* be using:
"C:\Program Files (x86)\Android\android-sdk\platforms\android-36.1\android.jar"
Update various MSBuild logic to handle non-integer API levels.
**API Level Property Standardization**
* Replaced `AndroidSdkPlatform` with `AndroidApiLevel` in all relevant
MSBuild targets and task classes, including `Aapt2Link`,
`GenerateMainAndroidManifest`, `GetJavaPlatformJar`, and others.
**Parsing and Usage Improvements**
* Updated logic to parse `AndroidApiLevel` using
`MonoAndroidHelper.TryParseApiLevel` where necessary, supporting
both major and minor versions and defaulting to sensible values when
parsing fails.
**Code Cleanup and Refactoring**
* Removed unused or obsolete parameters and code paths related to
`AndroidSdkPlatform` in several classes and methods, such as
`GenerateJavaStubs` and `JCWGenerator`.
* Updated test cases for `CheckGoogleSdkRequirements` to use
`AndroidApiLevel` instead of `TargetFrameworkVersion`, and corrected
assertions for warnings and errors.
**MSBuild Targets Updates**
* Modified MSBuild target files to use the new `AndroidApiLevel`
property, ensuring that all build steps and tooling reference the
correct property name.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We found the following errors with many
javacerrors:Such as:
This appears to be caused by the use of:
When the build should be using:
Update various MSBuild logic to handle non-integer API levels.
API Level Property Standardization
AndroidSdkPlatformwithAndroidApiLevelin all relevant MSBuild targets and task classes, includingAapt2Link,GenerateMainAndroidManifest,GetJavaPlatformJar, and others.Parsing and Usage Improvements
AndroidApiLevelusingMonoAndroidHelper.TryParseApiLevelwhere necessary, supporting both major and minor versions and defaulting to sensible values when parsing fails.Code Cleanup and Refactoring
AndroidSdkPlatformin several classes and methods, such asGenerateJavaStubsandJCWGenerator.CheckGoogleSdkRequirementsto useAndroidApiLevelinstead ofTargetFrameworkVersion, and corrected assertions for warnings and errors.MSBuild Targets Updates
AndroidApiLevelproperty, ensuring that all build steps and tooling reference the correct property name.