flutter-geolocator
flutter-geolocator copied to clipboard
Unhandled Exception: No location permissions are defined in the manifest. Make sure at least ACCESS_FINE_LOCATION or ACCESS_COARSE_LOCATION are defined in the manifest.
🐛 Bug Report
Unhandled Exception: No location permissions are defined in the manifest. Make sure at least ACCESS_FINE_LOCATION or ACCESS_COARSE_LOCATION are defined in the manifest.
I've added the permissions on the manifest and the info.plist, still the library will give this error when I run the app.
Expected behavior
Run and ask for permission.
This seems a configuration mistake. I cannot reproduce the problem (apart from removing the permissions form the AndroidManifest.xml
file).
Please make sure you added the permissions to the AndroidManifest.xml
file located in the android/app/src/main
folder and the syntax is correct.
As an sample have a look at the example configuration.
If that doesn't help please provide the following information:
- Output of the
flutter doctor -v
command. - Contents of your
android/app/src/main/AndroidManifest.xml
file.
@mvanbeusekom flutter doctor shows all good. I suspect it has something to do with Gradle but I don't know why.
Here's the manifest:
Hi @joao10martins,
Another option that might give some a clue is to check the build/app/outputs/logs/manifest-merger-release-report.txt
file? This is generated after you make a release build. This file contains all information on how the final AndroidManifest.xml is created and which merge actions occurred.
This log might give some information about the permissions being removed or skipped during the build process and help locate the mistake. The log might contain some sensitive information so be careful to post it anywhere.
Another thing you might want to try is to build the .apk and use Android Studio Build -> Analyse APK...
feature to look at the final AndroidManifest.xml file that is shipped with the binary, just to make sure this .apk file contains the required permissions. If not, some script (possible other plugin) explicitly removes them resulting in the exception. This should show up in the earlier mentioned log.
Hope this will help you on the way debugging this issue, if you have any follow up information please don't hesitate to leave a comment.
I fixed it, notice that permissions is written with 3 's' characters :)
Hahaha nice, I also completely missed that. Good to hear it is fixed and thanks for letting us know.
@mvanbeusekom flutter doctor shows all good. I suspect it has something to do with Gradle but I don't know why. Here's the manifest:
i face this problem how i can fix that androidxml for android geolocator pleas help me