Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

no permissions found in manifest for : 2 [flutter]

im using permission_handle to take permission for location.

and it always saying "No permissions found in manifest" even i tried "flutter clean"

import 'package:permission_handler/permission_handler.dart';


class PermissionsService {


  final PermissionHandler _permissionHandler = PermissionHandler();

   Future<bool> _requestPermission(PermissionGroup permission) async {
    var result = await _permissionHandler.requestPermissions([permission]);
    if (result[permission] == PermissionStatus.granted) {
      print('innnn');
      return true;
    }
    return false;
  }

  Future<bool> requestLocationPermission({Function onPermissionDenied} ) async {
    // return _requestPermission(PermissionGroup.locationWhenInUse);
    var granted = await _requestPermission(PermissionGroup.location );
    if(!granted){
      onPermissionDenied();
    }
    return granted;
  }
}

my Manifest.xml file

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.artistry">
    <!-- Flutter needs it to communicate with the running application
         to allow setting breakpoints, to provide hot reload, etc.
    -->
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
    <uses-permission android:name="android.permission.INTERNET"/>
</manifest>
like image 281
lokesh paladugula Avatar asked May 04 '20 11:05

lokesh paladugula


People also ask

Where do I put user permissions in manifest in flutter?

Add the permissions your app needs to the android/app/src/main/AndroidManifest. xml. Put the permissions in the manifest tag, infront of the application tag.

How do I check if permission is granted in flutter?

You can get a Permission 's status , which is either granted , denied , restricted or permanentlyDenied . var status = await Permission. camera. status; if (status.


1 Answers

You added permission in the Wrong Manifest File, You have to add location permission inside Android Manifest of this Directory android\app\src\main\AndroidManifest

enter image description here

like image 103
Muhammad Usama Siddiqui Avatar answered Sep 20 '22 10:09

Muhammad Usama Siddiqui