Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
- src/tasks/Crossgen2Tasks/Microsoft.NET.CrossGen.targets
- https://github.com/dotnet/sdk repo > src/Installer/redist-installer/targets/GeneratePKG.targets
-->
<AndroidApiLevelMin>21</AndroidApiLevelMin>
Comment thread
simonrozsival marked this conversation as resolved.
<AndroidApiLevelMin>24</AndroidApiLevelMin>
Comment thread
simonrozsival marked this conversation as resolved.
<iOSVersionMin>13.0</iOSVersionMin>
Comment thread
simonrozsival marked this conversation as resolved.
<tvOSVersionMin>13.0</tvOSVersionMin>
<macOSVersionMin>14.0</macOSVersionMin>
Expand Down
2 changes: 1 addition & 1 deletion docs/workflow/building/coreclr/android.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Supported target architectures:

- Download and install [OpenJDK 23](https://openjdk.org/projects/jdk/23/)
- Download and install [Android Studio](https://developer.android.com/studio/install) and the following:
- Android SDK (minimum supported API level is 21)
- Android SDK (minimum supported API level is 24)
- Android NDK r27c

> [!NOTE]
Expand Down
2 changes: 1 addition & 1 deletion eng/native/build-commons.sh
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ build_native()

if [[ "$targetOS" == android || "$targetOS" == linux-bionic ]]; then
# Keep in sync with $(AndroidApiLevelMin) in Directory.Build.props in the repository rooot
Comment thread
simonrozsival marked this conversation as resolved.
local ANDROID_API_LEVEL=21
local ANDROID_API_LEVEL=24
if [[ -z "$ANDROID_NDK_ROOT" ]]; then
echo "Error: You need to set the ANDROID_NDK_ROOT environment variable pointing to the Android NDK root."
exit 1
Expand Down
2 changes: 1 addition & 1 deletion eng/native/gen-buildsys.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ if /i "%__Arch%" == "wasm" (

if /i "%__Os%" == "android" (
:: Keep in sync with $(AndroidApiLevelMin) in Directory.Build.props in the repository rooot
Comment thread
simonrozsival marked this conversation as resolved.
set __ANDROID_API_LEVEL=21
set __ANDROID_API_LEVEL=24
if "%ANDROID_NDK_ROOT%" == "" (
echo Error: You need to set the ANDROID_NDK_ROOT environment variable pointing to the Android NDK root.
exit /B 1
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/nativeaot/docs/android-bionic.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Starting with .NET 8 Preview 7, it's possible to build shared libraries and comm

Not a full Android experience is available - it's only possible to publish for two Bionic RID: linux-bionic-arm64 and linux-bionic-x64. Publishing for Android RIDs (android-arm64/android-x64) is not possible. This limited experience corresponds to building with [Android NDK](https://developer.android.com/ndk) from Native code - the limitations are similar. Interop with Java needs to be done manually through JNI, if necessary.

The minimum API level is 21 at the time of writing the document, but search for AndroidApiLevelMin in this repo for more up-to-date information.
The minimum API level has been raised to 24 in .NET 11. Search for `AndroidApiLevelMin` in this repo for the current value.

To build for Bionic:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public static void IsOSPlatformVersionAtLeast_InvalidArgs_Throws()
public static void TestIsOSVersionAtLeast_Android() => TestIsOSVersionAtLeast("Android");

[Fact, PlatformSpecific(TestPlatforms.Android)]
public static void TestIsOSVersionAtLeast_Android_21() => Assert.True(OperatingSystem.IsAndroidVersionAtLeast(21)); // 21 is our min supported version
public static void TestIsOSVersionAtLeast_Android_24() => Assert.True(OperatingSystem.IsAndroidVersionAtLeast(24)); // 24 is our min supported version
Comment thread
simonrozsival marked this conversation as resolved.
Comment thread
simonrozsival marked this conversation as resolved.

[Fact, PlatformSpecific(TestPlatforms.iOS)]
public static void TestIsOSPlatform_IOS() => TestIsOSPlatform("iOS", OperatingSystem.IsIOS);
Expand Down
2 changes: 1 addition & 1 deletion src/mono/msbuild/android/build/AndroidBuild.targets
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@
</PropertyGroup>

<PropertyGroup>
<AndroidLibraryMinApiLevel Condition="'$(AndroidLibraryMinApiLevel)' == ''">21</AndroidLibraryMinApiLevel>
<AndroidLibraryMinApiLevel Condition="'$(AndroidLibraryMinApiLevel)' == ''">24</AndroidLibraryMinApiLevel>
</PropertyGroup>

<ItemGroup>
Expand Down
8 changes: 0 additions & 8 deletions src/native/libs/System.Native/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -116,14 +116,6 @@ include(${CMAKE_CURRENT_LIST_DIR}/extra_libs.cmake)
set(NATIVE_LIBS_EXTRA)
append_extra_system_libs(NATIVE_LIBS_EXTRA)

if (CLR_CMAKE_TARGET_ANDROID AND NOT HAVE_GETIFADDRS)
Comment thread
simonrozsival marked this conversation as resolved.
add_definitions(-DANDROID_GETIFADDRS_WORKAROUND)
add_compile_options(-Wno-gnu-zero-variadic-macro-arguments)

list (APPEND NATIVE_LIBS_EXTRA -llog)
list (APPEND NATIVE_SOURCES pal_ifaddrs.c)
endif ()

if (GEN_SHARED_LIB)
add_library(System.Native
SHARED
Expand Down
Loading
Loading