Solve the problem of permission after flutter package_ Handler failure

Because the project requires location, camera, and microphone permissions, the permission_handler library is invoked to implement it.
But in normal debugging without any problem, can pop up to get the rights of the dialog box can also be normal access to each permission;
The release version packaged with the command flutter build apk does not have the dialog box that pops up to get permission, nor does it get permission.
After Posting the problem on CSDN, Zhihu and SegmentFault, I finally decided to solve it by myself. Finally, I found a partner with the same problem on the Issues section of the official GitHub.
Dont work Permission_handler in release mode #406
Find the answer in the comments section:

try to do that in gradle.properties
android.enableR8=true
change to
android.enableR8=false

It means that modify android/gradle. In the properties

android.enableR8=true

for

android.enableR8=false

Pack again and you’re ready!
Thanks to brother!

Read More: