File tree Expand file tree Collapse file tree 2 files changed +20
-3
lines changed Expand file tree Collapse file tree 2 files changed +20
-3
lines changed Original file line number Diff line number Diff line change 1
1
<Project Sdk =" Microsoft.NET.Sdk" >
2
2
3
3
<PropertyGroup >
4
- <TargetFrameworks >net8.0;net7.0;netstandard2.0;netstandard2.1;net472</TargetFrameworks >
4
+ <TargetFrameworks >net8.0;net7.0;netstandard2.0;netstandard2.1;net472;net8.0-android </TargetFrameworks >
5
5
<ImplicitUsings >enable</ImplicitUsings >
6
6
<Nullable >enable</Nullable >
7
7
<AllowUnsafeBlocks >true</AllowUnsafeBlocks >
11
11
<RepositoryUrl >https://github.com/JunaMeinhold/HexaGen</RepositoryUrl >
12
12
13
13
<AssemblyVersion >1.1.0</AssemblyVersion >
14
- <PackageVersion >1.1.7 </PackageVersion >
14
+ <PackageVersion >1.1.8 </PackageVersion >
15
15
<Description >The C Runtime for all C Wrappers generated with the HexaGen Code Generator.</Description >
16
16
<Authors >Juna Meinhold</Authors >
17
17
<PackageProjectUrl >https://github.com/JunaMeinhold/HexaGen</PackageProjectUrl >
36
36
<ItemGroup Condition =" '$(TargetFramework)' == 'netstandard2.0' OR '$(TargetFramework)' == 'netstandard2.1' OR '$(TargetFramework)' == 'net472'" >
37
37
<PackageReference Include =" System.Memory" Version =" 4.5.5" />
38
38
</ItemGroup >
39
+
40
+ <ItemGroup Condition =" '$(TargetFramework)' == 'net8.0-android'" >
41
+ <PackageReference Include =" Xamarin.AndroidX.Core" Version =" 1.13.1.3" />
42
+ </ItemGroup >
39
43
</Project >
Original file line number Diff line number Diff line change 8
8
using HexaGen . Runtime ;
9
9
#endif
10
10
11
+ #if ANDROID
12
+ using Android . Content . PM ;
13
+ #endif
14
+
11
15
public enum TargetPlatform
12
16
{
13
17
Unknown = 0 ,
@@ -181,7 +185,16 @@ public static nint LoadLibrary()
181
185
182
186
private static string GetNativeAssemblyPath ( string osPlatform , string architecture , string libraryName )
183
187
{
184
- var assemblyLocation = AppContext . BaseDirectory ;
188
+ #if ANDROID
189
+ // Get the application info
190
+ ApplicationInfo appInfo = Application . Context . ApplicationInfo ! ;
191
+
192
+ // Get the native library directory path
193
+ string assemblyLocation = appInfo . NativeLibraryDir ! ;
194
+
195
+ #else
196
+ string assemblyLocation = AppContext . BaseDirectory ;
197
+ #endif
185
198
186
199
var paths = new [ ]
187
200
{
You can’t perform that action at this time.
0 commit comments