@@ -37,8 +37,28 @@ public override string[] _GetExportFeatures(EditorExportPlatform platform, bool
3737
3838 public override Godot . Collections . Array < Godot . Collections . Dictionary > _GetExportOptions ( EditorExportPlatform platform )
3939 {
40- return new Godot . Collections . Array < Godot . Collections . Dictionary > ( )
40+ var exportOptionList = new Godot . Collections . Array < Godot . Collections . Dictionary > ( ) ;
41+
42+ if ( platform . GetOsName ( ) . Equals ( OS . Platforms . Android , StringComparison . OrdinalIgnoreCase ) )
4143 {
44+ exportOptionList . Add
45+ (
46+ new Godot . Collections . Dictionary ( )
47+ {
48+ {
49+ "option" , new Godot . Collections . Dictionary ( )
50+ {
51+ { "name" , "dotnet/android_use_linux_bionic" } ,
52+ { "type" , ( int ) Variant . Type . Bool }
53+ }
54+ } ,
55+ { "default_value" , false }
56+ }
57+ ) ;
58+ }
59+
60+ exportOptionList . Add
61+ (
4262 new Godot . Collections . Dictionary ( )
4363 {
4464 {
@@ -49,7 +69,10 @@ public override string[] _GetExportFeatures(EditorExportPlatform platform, bool
4969 }
5070 } ,
5171 { "default_value" , false }
52- } ,
72+ }
73+ ) ;
74+ exportOptionList . Add
75+ (
5376 new Godot . Collections . Dictionary ( )
5477 {
5578 {
@@ -60,7 +83,10 @@ public override string[] _GetExportFeatures(EditorExportPlatform platform, bool
6083 }
6184 } ,
6285 { "default_value" , true }
63- } ,
86+ }
87+ ) ;
88+ exportOptionList . Add
89+ (
6490 new Godot . Collections . Dictionary ( )
6591 {
6692 {
@@ -72,7 +98,8 @@ public override string[] _GetExportFeatures(EditorExportPlatform platform, bool
7298 } ,
7399 { "default_value" , false }
74100 }
75- } ;
101+ ) ;
102+ return exportOptionList ;
76103 }
77104
78105 private void AddExceptionMessage ( EditorExportPlatform platform , Exception exception )
@@ -158,11 +185,12 @@ private void _ExportBeginImpl(string[] features, bool isDebug, string path, long
158185 throw new NotImplementedException ( "Target platform not yet implemented." ) ;
159186 }
160187
188+ bool useAndroidLinuxBionic = ( bool ) GetOption ( "dotnet/android_use_linux_bionic" ) ;
161189 PublishConfig publishConfig = new ( )
162190 {
163191 BuildConfig = isDebug ? "ExportDebug" : "ExportRelease" ,
164192 IncludeDebugSymbols = ( bool ) GetOption ( "dotnet/include_debug_symbols" ) ,
165- RidOS = DetermineRuntimeIdentifierOS ( platform ) ,
193+ RidOS = DetermineRuntimeIdentifierOS ( platform , useAndroidLinuxBionic ) ,
166194 Archs = new List < string > ( ) ,
167195 UseTempDir = platform != OS . Platforms . iOS , // xcode project links directly to files in the publish dir, so use one that sticks around.
168196 BundleOutputs = true ,
@@ -335,6 +363,14 @@ private void _ExportBeginImpl(string[] features, bool isDebug, string path, long
335363
336364 if ( IsSharedObject ( fileName ) )
337365 {
366+ if ( fileName . EndsWith ( ".so" ) && ! fileName . StartsWith ( "lib" ) )
367+ {
368+ // Add 'lib' prefix required for all native libraries in Android.
369+ string newPath = string . Concat ( path . AsSpan ( 0 , path . Length - fileName . Length ) , "lib" , fileName ) ;
370+ Godot . DirAccess . RenameAbsolute ( path , newPath ) ;
371+ path = newPath ;
372+ }
373+
338374 AddSharedObject ( path , tags : new string [ ] { arch } ,
339375 Path . Join ( projectDataDirName ,
340376 Path . GetRelativePath ( publishOutputDir ,
@@ -450,8 +486,14 @@ private string SanitizeSlashes(string path)
450486 return path ;
451487 }
452488
453- private string DetermineRuntimeIdentifierOS ( string platform )
454- => OS . DotNetOSPlatformMap [ platform ] ;
489+ private string DetermineRuntimeIdentifierOS ( string platform , bool useAndroidLinuxBionic )
490+ {
491+ if ( platform == OS . Platforms . Android && useAndroidLinuxBionic )
492+ {
493+ return OS . DotNetOS . LinuxBionic ;
494+ }
495+ return OS . DotNetOSPlatformMap [ platform ] ;
496+ }
455497
456498 private string DetermineRuntimeIdentifierArch ( string arch )
457499 {
0 commit comments