diff --git a/packages/core/file-system/file-system-access.android.ts b/packages/core/file-system/file-system-access.android.ts index d0eed3c0e..68c43b05c 100644 --- a/packages/core/file-system/file-system-access.android.ts +++ b/packages/core/file-system/file-system-access.android.ts @@ -581,9 +581,9 @@ export class FileSystemAccess implements IFileSystemAccess { } public normalizePath(path: string): string { - const file = new java.io.File(path); - - return file.getAbsolutePath(); + // the [''] is a trick to not have to create a android.net.URI + // and use the method with string signature + return java.nio.file.Paths.get(path, ['']).normalize().toString(); } public joinPath(left: string, right: string): string {