简体   繁体   English

Flutter 位置 Package 在应用程序发布模式下不工作

[英]Flutter Location Package is Not Working in App Release Mode

Flutter App is working fine with Location Package in Debug Mode but it is not working in Release Mode, the app is not giving location access. Flutter 应用程序在调试模式下与位置 Package 一起工作正常,但在发布模式下不工作,应用程序不提供位置访问权限。 i tried to use Flutter Clean Command but nothing Helped.我尝试使用 Flutter 清洁命令,但没有任何帮助。 Pls Help me请帮助我

If your problem is that the flutter build (APK, bundle) isn't making API calls in a real device, this is because you need to add the Internet permission to Android Manifest before creating the release/build.如果您的问题是 flutter 构建(APK,捆绑包)没有在真实设备中进行 API 调用,这是因为您需要在创建发布/构建清单之前将 Internet 权限添加到 Android 清单。

By default, "internet use" will work fine on the emulator but not on a real device.默认情况下,“互联网使用”可以在模拟器上正常工作,但不能在真实设备上工作。

To fix this, simply:要解决此问题,只需:

Open the file "android/app/src/main/AndroidManifest.xml" and add the proper user-permission打开文件“android/app/src/main/AndroidManifest.xml”并添加正确的用户权限

<manifest> 
...
 <uses-permission android:name="android.permission.INTERNET"/>
...
</manifest>

And then create your build again.然后再次创建您的构建。 Also there is discussion on github, you can visit their and clearify your problem more effectively Github .还有关于 github 的讨论,您可以访问他们并更有效地解决您的问题Github

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Flutter 中的提供程序 package 在发布模式下不工作 - Provider package in Flutter is not working in release mode 横向模式在 App 版本中不起作用 (Flutter) - Landscape mode not working in App release (Flutter) Flutter App 工作调试模式,在发布应用程序中不起作用 - Flutter App working debug mode, in release app not working Flutter app(android)在发布模式下无法在真实设备上运行 - Flutter app(android) not working on real device in release mode Flutter - firebase_app_check 在发布模式下不工作,如何解决? - Flutter - firebase_app_check not working in release mode, how fix it? Flutter:定位软件包在首次安装应用程序时不起作用 - Flutter: Location package Not working on First Time App Install 为什么我的 Flutter 应用程序在发布模式下崩溃而在调试模式下运行良好? - Why is my flutter app crashing in release mode and working fine in debug mode? Flutter 位置 package 不在后台工作 - Flutter location package is not working in background Flutter Firebase 不适用于发布应用程序 - Flutter Firebase not working on release app Flutter 隔离在 Android 上无法在发布模式下工作? - Flutter isolate not working in release mode on Android?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM