-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[android] Update gradle.properties #30543
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds a suppression flag to gradle.properties to enable building with Android SDK 34 without warnings from the Android Gradle plugin.
- Introduces
android.suppressUnsupportedCompileSdk=34to silence unsupported compile SDK warnings. - Ensures compatibility when using SDK 34 in Android projects.
|
Build not happy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
C:\a\_work\1\s\.dotnet\packs\Microsoft.Android.Sdk.Windows\35.0.61\tools\Microsoft.Android.Sdk.Bindings.Gradle.targets(83,5): error XAGRDL0000: > A failure occurred while executing com.android.build.gradle.tasks.VerifyLibraryResourcesTask$Action [C:\a\_work\1\s\src\Core\src\Core.csproj::TargetFramework=net9.0-android35.0]
C:\a\_work\1\s\.dotnet\packs\Microsoft.Android.Sdk.Windows\35.0.61\tools\Microsoft.Android.Sdk.Bindings.Gradle.targets(83,5): error XAGRDL0000: > Android resource linking failed [C:\a\_work\1\s\src\Core\src\Core.csproj::TargetFramework=net9.0-android35.0]
C:\a\_work\1\s\.dotnet\packs\Microsoft.Android.Sdk.Windows\35.0.61\tools\Microsoft.Android.Sdk.Bindings.Gradle.targets(83,5): error XAGRDL0000: ERROR:AAPT: aapt2.exe E 07-11 13:51:27 9828 9428 LoadedArsc.cpp:94] RES_TABLE_TYPE_TYPE entry offsets overlap actual entry data. [C:\a\_work\1\s\src\Core\src\Core.csproj::TargetFramework=net9.0-android35.0]
C:\a\_work\1\s\.dotnet\packs\Microsoft.Android.Sdk.Windows\35.0.61\tools\Microsoft.Android.Sdk.Bindings.Gradle.targets(83,5): error XAGRDL0000: aapt2.exe E 07-11 13:51:27 9828 9428 ApkAssets.cpp:149] Failed to load resources table in APK 'C:\Android\android-sdk\platforms\android-35\android.jar'. [C:\a\_work\1\s\src\Core\src\Core.csproj::TargetFramework=net9.0-android35.0]
C:\a\_work\1\s\.dotnet\packs\Microsoft.Android.Sdk.Windows\35.0.61\tools\Microsoft.Android.Sdk.Bindings.Gradle.targets(83,5): error XAGRDL0000: error: failed to load include path C:\Android\android-sdk\platforms\android-35\android.jar. [C:\a\_work\1\s\src\Core\src\Core.csproj::TargetFramework=net9.0-android35.0]
The key error is this line:
aapt2.exe E 07-11 13:51:27 9828 9428 ApkAssets.cpp:149] Failed to load resources table in APK 'C:\Android\android-sdk\platforms\android-35\android.jar'.
|
I would open the project in latest stable Android Studio, and see if it prompts to update various things: gradle, Android gradle plugin, etc. The error itself looks like the build used an older |
| sourceCompatibility JavaVersion.VERSION_1_8 | ||
| targetCompatibility JavaVersion.VERSION_1_8 | ||
| sourceCompatibility JavaVersion.VERSION_17 | ||
| targetCompatibility JavaVersion.VERSION_17 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would undo this line for now, we still build with Java source targeting 1.8, see for example:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it could cause build warnings like:
Invoke-customs are only supported starting with Android O (--min-api 26)
src/Core/AndroidNative/maui/src/main/java/com/microsoft/maui/glide/MauiCustomViewTarget.java
Show resolved
Hide resolved
|
@jonathanpeppers seems those changes made it worst.. maybe we still need the namespace change. |
|
@rmarinho no I think the error to fix is: Did Copilot hallucinate and put it on the wrong element? maui/src/Core/AndroidNative/maui/build.gradle Lines 5 to 7 in 3c54f94
You should also name it
Then you should be able to undo the change to the |
|
/rebase |
This reverts commit 49e7f07.
3c54f94 to
de5b767
Compare
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
* Update gradle.properties * [vs] Workaround for dev18 * Revert "Update gradle.properties" This reverts commit 49e7f07. * [android] Update build gradle for api 35 * Try again * Try update other properties * Remove deprecated lib * [android] Revert some changes * [android] Try fix android gradle namespace * Remove from manifest the package name
* Update gradle.properties * [vs] Workaround for dev18 * Revert "Update gradle.properties" This reverts commit 49e7f07. * [android] Update build gradle for api 35 * Try again * Try update other properties * Remove deprecated lib * [android] Revert some changes * [android] Try fix android gradle namespace * Remove from manifest the package name
Description of Change
This pull request introduces updates to build configurations, Android compatibility, and namespace adjustments to improve project maintainability and compatibility with newer tools and frameworks.
Build Configuration Updates:
gradle-wrapper.propertiesto use Gradle version 8.13, ensuring compatibility with the latest features and optimizations.build.gradleto 8.11.1 for better integration with Gradle 8.x.pluginManagementblock insettings.gradleto centralize plugin repositories and changedrepositoriesModetoPREFER_PROJECTfor improved dependency resolution.Android Compatibility Improvements:
compileSdkandtargetSdkversions to 35 inmaui/build.gradlefor compatibility with the latest Android SDK.gradle.propertiesto optimize resource handling and reduce APK size.sourceCompatibilityandtargetCompatibilityinmaui/build.gradleto Java 17 for leveraging modern Java features.Namespace and Resource Adjustments:
packageattribute fromAndroidManifest.xmlto align with the updated namespace configuration.PlatformInterop.javaandMauiCustomViewTarget.javato use the new namespacemicrosoft.maui. [1] [2]Environment Variable Updates:
DOTNET_HOST_PATHenvironment variable indotnet.caketo address a Windows-specific issue with Dev18.