Skip to content

Commit 484342e

Browse files
committed
[android] Update gradle.properties (#30543)
* 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
1 parent 78643d9 commit 484342e

File tree

9 files changed

+32
-11
lines changed

9 files changed

+32
-11
lines changed

eng/cake/dotnet.cake

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -684,10 +684,15 @@ Dictionary<string, string> GetDotNetEnvironmentVariables()
684684
void SetDotNetEnvironmentVariables(string dotnetDir = null)
685685
{
686686
var dotnet = dotnetDir ?? MakeAbsolute(Directory("./.dotnet/")).ToString();
687-
687+
var dotnetHostPath = IsRunningOnWindows() ? $"{dotnet}/dotnet.exe" : $"{dotnet}/dotnet";
688688
SetEnvironmentVariable("VSDebugger_ValidateDotnetDebugLibSignatures", "0");
689689
SetEnvironmentVariable("DOTNET_INSTALL_DIR", dotnet);
690690
SetEnvironmentVariable("DOTNET_ROOT", dotnet);
691+
if (IsRunningOnWindows())
692+
{
693+
//workaround for dev18
694+
SetEnvironmentVariable("DOTNET_HOST_PATH", dotnetHostPath);
695+
}
691696
SetEnvironmentVariable("DOTNET_MSBUILD_SDK_RESOLVER_CLI_DIR", dotnet);
692697
SetEnvironmentVariable("DOTNET_MULTILEVEL_LOOKUP", "0");
693698
SetEnvironmentVariable("DOTNET_SYSTEM_NET_SECURITY_NOREVOCATIONCHECKBYDEFAULT", "true");

src/Core/AndroidNative/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ buildscript {
55
mavenCentral()
66
}
77
dependencies {
8-
classpath "com.android.tools.build:gradle:7.4.2"
8+
classpath "com.android.tools.build:gradle:8.11.1"
99
}
1010
}
1111

12-
task clean(type: Delete) {
12+
tasks.register('clean', Delete) {
1313
delete rootProject.buildDir
1414
}

src/Core/AndroidNative/gradle.properties

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,9 @@ org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
1616
# https://developer.android.com/topic/libraries/support-library/androidx-rn
1717
android.useAndroidX=true
1818
# Automatically convert third-party libraries to use AndroidX
19-
android.enableJetifier=true
19+
android.enableJetifier=true
20+
# Use R8 in full mode
21+
android.enableR8.fullMode=true
22+
# Enable namespacing of each library's R class so that its R class includes only the resources declared in the library itself
23+
# and none from the library's dependencies
24+
android.nonTransitiveRClass=true
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-all.zip
44
networkTimeout=10000
55
zipStoreBase=GRADLE_USER_HOME
66
zipStorePath=wrapper/dists

src/Core/AndroidNative/maui/build.gradle

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@ plugins {
33
}
44

55
android {
6-
compileSdk 34
6+
compileSdk 35
7+
namespace "microsoft.maui"
78

89
defaultConfig {
910
minSdk 21
10-
targetSdk 34
11+
targetSdk 35
1112
versionCode 1
1213
versionName '1.0'
1314
setProperty('archivesBaseName', 'maui')
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.microsoft.maui">
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
33
</manifest>

src/Core/AndroidNative/maui/src/main/java/com/microsoft/maui/PlatformInterop.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,8 @@ public static void loadImageFromFont(Context context, @ColorInt int color, Strin
398398
}
399399

400400
public static ColorStateList getColorStateListForToolbarStyleableAttribute(Context context, int resId, int index) {
401-
TintTypedArray styledAttributes = TintTypedArray.obtainStyledAttributes(context, null, R.styleable.Toolbar, resId, 0);
401+
// Use the appcompat styleable resource ID instead
402+
TintTypedArray styledAttributes = TintTypedArray.obtainStyledAttributes(context, null, androidx.appcompat.R.styleable.Toolbar, resId, 0);
402403
try {
403404
return styledAttributes.getColorStateList(index);
404405
} finally {

src/Core/AndroidNative/maui/src/main/java/com/microsoft/maui/glide/MauiCustomViewTarget.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
import com.bumptech.glide.request.target.CustomViewTarget;
1515
import com.bumptech.glide.request.transition.Transition;
1616

17-
import com.microsoft.maui.R;
17+
import microsoft.maui.R;
1818
import com.microsoft.maui.ImageLoaderCallback;
1919
import com.microsoft.maui.PlatformLogger;
2020
import com.microsoft.maui.glide.MauiTarget;
Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
1+
pluginManagement {
2+
repositories {
3+
google()
4+
mavenCentral()
5+
gradlePluginPortal()
6+
}
7+
}
8+
19
dependencyResolutionManagement {
2-
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
10+
repositoriesMode.set(RepositoriesMode.PREFER_PROJECT)
311
repositories {
412
google()
513
mavenCentral()
614
}
715
}
16+
817
// NOTE: we can't use '.NET MAUI'
918
rootProject.name = "DOTNET MAUI"
1019
include ':maui'

0 commit comments

Comments
 (0)