tauri-apps / tauri-apps/plugins-workspace

Geolocation permissions to recognized in AndroidManifest.xml

Open
#2,823 4 comments 0 reactions 0 assignees View on GitHub
platform: android plugin: geolocation type: question
Dominant language
Rust
Stars
1.8k
Forks
602
Avg merge
4d 14h
Merged PRs (30d)
9

Description

I've followed the installation instructions but cannot get the geolocation plugin to work. After installing with:

```bash
pnpm add @tauri-apps/plugin-geolocation
```

My `AndroidManifest.xml` file was not updated. I manually added the necessary permissions.

`src-tauri/gen/android/app/src/main/AndroidManifest.xml`:
```xml




...
```

I have this in the `layout.svelte` file in my SvelteKit app:

```typescript
onMount(async () => {
let permissions = await checkPermissions();
if (permissions.location === "prompt" || permissions.location === "prompt-with-rationale") {
permissions = await requestPermissions(["location"]);
}
console.log(JSON.stringify(permissions));
});
```

However, upon running the app, I get this error:

```
Uncaught (in promise) Missing the following permissions in AndroidManifest.xml:
android.permission.ACCESS_FINE_LOCATION
android.permission.ACCESS_COARSE_LOCATION
```

What am I missing?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.