小编Zah*_*hra的帖子

如何解决 Google Play 商店缺少在 Flutter 中显示谷歌地图的警告

W/GooglePlayServicesUtil( 4892): Google Play Store is missing.
Run Code Online (Sandbox Code Playgroud)

此警告阻止 google 地图在 genymotion 设备中显示。

这是 genymotion 中 android 9 中地图的输出: 在此输入图像描述

我怎么解决这个问题?为 android 和 ios 启用 google 地图 sdk 并获取 ApiKey 所需的所有步骤均已完成并添加。这是地图屏幕的代码。

import 'package:flutter/material.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
class MapScreen extends StatefulWidget {
  @override
  _MapScreenState createState() => _MapScreenState();
}

class _MapScreenState extends State<MapScreen> {
  static final CameraPosition _kGooglePlex = CameraPosition(
    target: LatLng(37.42796133580664, -122.085749655962),
    zoom: 14.4746,
  );

  @override
  Widget build(BuildContext context) {
    return new Scaffold(
      appBar: AppBar(title:Text("map") ,),
        body:Container(
          width: 400,
          height: 400,
          child:  GoogleMap(
            mapType: …
Run Code Online (Sandbox Code Playgroud)

google-maps android-studio genymotion flutter

17
推荐指数
3
解决办法
3万
查看次数

颤振发布apk错误:任务':app:lintVitalRelease'的执行失败

我不能再发布我的应用程序了。我正在使用 AndroidStudio 4.0 和 flutter sdk 版本 1.17.5 。我上个月发布了两次我的应用程序,但现在我真的不知道错误的原因是什么。当我输入flutter build apk --release终端时,会发生这些错误:

        Running Gradle task 'assembleRelease'...


FAILURE: Build failed with an exception.



* What went wrong:

Execution failed for task ':app:lintVitalRelease'.

> Could not resolve all artifacts for configuration ':app:profileRuntimeClasspath'.

   > Failed to transform libs.jar to match attributes {artifactType=processed-jar, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime}.

      > Execution failed for JetifyTransform: ....\build\app\intermediates\flutter\profile\libs.jar.

         > Failed to transform '....\build\app\intermediates\flutter\profile\libs.jar' using Jetifier. Reason: FileNotFoundException, message: ....\build\app\intermediates\flutter\profile\libs.jar (The system cannot find the path specified). (Run with --stacktrace …
Run Code Online (Sandbox Code Playgroud)

android release build gradle flutter

17
推荐指数
3
解决办法
1万
查看次数

SocketException:连接失败(操作系统错误:网络无法访问,errno = 101),地址 = 10.0.2.2,端口 = 80

当我点击登录时,在颤动中制作登录屏幕,它会给出错误“网络无法访问”。

我已经更改了 IP 地址“10.0.2.2”、“8.7.7.7”,但不起作用。

错误 :

E/flutter (16082): [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled 
Exception: SocketException: Connection failed 
(OS Error: Network is unreachable, errno = 101), address = 10.0.2.2, port = 80
Run Code Online (Sandbox Code Playgroud)

代码 :

TextEditingController user=new TextEditingController();
TextEditingController pass=new TextEditingController();

Future<List> _login() async{
  final response = await http.post("http://127.0.0.1/my_store/login.php", body: {
    "username": user.text,
    "password": pass.text,
   
  });

  print(response.body);
  }
Run Code Online (Sandbox Code Playgroud)

dart flutter

7
推荐指数
3
解决办法
2万
查看次数

Flutter web:无法加载资源:net::ERR_NAME_NOT_RESOLVED

Flutter web 只是在 chrome 中显示空白页面,我通过使用 inpectFailed to load resource: net::ERR_NAME_NOT_RESOLVED进入chrome控制台。即使使用 web 上的 flutter 计数器应用程序,它也可以重现。

我有 Flutter Channel stable 2.0.2and Android Studio (version 4.1.0)。它在模拟器中运行良好。我该如何解决这个问题? 错误图像

我尝试在 cmd 中执行以下命令,但仍然有问题:

ipconfig /flushdns
ipconfig /renew
ipconfig /registerdns
Run Code Online (Sandbox Code Playgroud)

flutter flutter-web

7
推荐指数
1
解决办法
7345
查看次数

flutter 工具无法访问文件

我尝试运行 Flutter 项目但出现错误

Flutter failed to write to a file at
"C:\Users\Dell\flutter-development\projects\flutter_complete_guide\ios\Runner\GeneratedPluginRegistrant.h". The flutter
tool cannot access the file.
Please ensure that the SDK and/or project is installed in a location that has read/write permissions for the current
user.
Run Code Online (Sandbox Code Playgroud)

版本:

颤振 1.22.4,

视窗 10

我试图用 cmd 和 android-studio 创建一个 Flutter 项目,但结果是一样的。

我还为 flutter-sdk 目录、flutter 项目及其子目录授予了所有(包括 Dell 用户)的完全权限。

一旦尝试使用flutter create myapp从头开始构建项目,则会出现 下一个错误

PS C:\src1\project> flutter create myapp
Recreating project myapp...
  myapp\android\app\src\main\res\mipmap-mdpi\ic_launcher.png (created)
Failed to send crash report due …
Run Code Online (Sandbox Code Playgroud)

permissions android android-studio windows-10 flutter

5
推荐指数
1
解决办法
1430
查看次数

如何在flutter中显示多个谷歌原生广告

我试图在 a 中动态调用广告listview,但抛出此错误:

If you placed this AdWidget in a list, make sure you create a new instance in the builder function with a unique ad object.
Make sure you are not using the same ad object in more than one AdWidget. 
Run Code Online (Sandbox Code Playgroud)

这是代码

导入包google_mobile_ads

import 'package:google_mobile_ads/google_mobile_ads.dart';
Run Code Online (Sandbox Code Playgroud)

然后实例化包

NativeAd _nativeAd;

final Completer<NativeAd> nativeAdCompleter = Completer<NativeAd>();
Run Code Online (Sandbox Code Playgroud)

我的功能是加载广告

loadAd(){
    _nativeAd = NativeAd(
      adUnitId: "ca-app-pub-3940256099942544/1044960115",
      request: AdRequest(),
      factoryId: 'adFactoryExample',
      listener: AdListener(
        onAdLoaded: (Ad ad) {
          print('$NativeAd loaded.');
          nativeAdCompleter.complete(ad as NativeAd); …
Run Code Online (Sandbox Code Playgroud)

admob flutter google-mobile-ads

5
推荐指数
1
解决办法
1956
查看次数

Flutter项目调试在我的vivo手机中无法运行

我现在面临着一个难题。现在我无法在我的真实 Vivo-v2020 手机设备上进行 flutter 调试。我已经尝试了一切可能的方法,但仍然出现此错误并且无法调试。但是,安装的应用程序运行正常。\n在我的设备中一切正常,开发人员模式打开,USB 调试模式也打开\n有什么解决方案吗?请帮助我...这对我来说非常重要。

\n

日志:

\n
Launching lib\\main.dart on V2022 in debug mode...\nRunning Gradle task 'assembleDebug'...\nParameter format not correct -\n\xe2\x88\x9a Built build\\app\\outputs\\flutter-apk\\app-debug.apk.\nInstalling build\\app\\outputs\\flutter-apk\\app.apk...\nI/flutter ( 4243): Observatory listening on ************************************\n
Run Code Online (Sandbox Code Playgroud)\n

dart flutter

5
推荐指数
1
解决办法
2943
查看次数

如何在网页中使用 file_picker 显示选取的图像?

当文件路径位于网络平台中时,如何显示在网络中选取file_picker图像?null

如果路径不为空,则显示图像就太容易了Image.file(File)

Image.file(context.select<BlogProvider, File>((BlogProvider p) => p.image))
Run Code Online (Sandbox Code Playgroud)

但它无法在网络中为图像创建文件,因为浏览器不提供文件路径并且它为空。

Future<void> pickImage() async {
    /// If [withReadStream] is set, picked files will have its byte data available as a [Stream<List<int>>]
    /// which can be useful for uploading and processing large files.
    FilePickerResult result = await FilePicker.platform.pickFiles(
      type: FileType.custom,
      allowedExtensions: ['jpg', 'jpeg'],
      withReadStream: true,
    );
    if (result != null) {
      PlatformFile file = result.files.single; //single means I am Picking just One file not more
      _blogImage …
Run Code Online (Sandbox Code Playgroud)

flutter flutter-web

3
推荐指数
1
解决办法
4763
查看次数

ValueError: 无法找到字体 DejaVu Sans:style=normal:variant=normal:weight=normal... 并禁用回退到默认字体

我在尝试绘制一些数据时收到此错误:

findfont: Font family ['STIXGeneral'] not found. Falling back to DejaVu Sans.
Traceback (most recent call last):
  File "F:/Python/compairing-epsilons/main.py", line 71, in <module>
    c_1=Bandit.experiment(m1,m2,m3 ,0.1 ,100000)
  File "F:/Python/compairing-epsilons/main.py", line 62, in experiment
    plt.show()
  File "F:\Python\compairing-epsilons\lib\site-packages\matplotlib\pyplot.py", line 368, in show
    return _backend_mod.show(*args, **kwargs)
  File "E:\MyProgramFiles\JetBrains\PyCharm 2020.1\plugins\python\helpers\pycharm_matplotlib_backend\backend_interagg.py", line 27, in __call__
    manager.show(**kwargs)
  File "E:\MyProgramFiles\JetBrains\PyCharm 2020.1\plugins\python\helpers\pycharm_matplotlib_backend\backend_interagg.py", line 99, in show
    self.canvas.show()
  File "E:\MyProgramFiles\JetBrains\PyCharm 2020.1\plugins\python\helpers\pycharm_matplotlib_backend\backend_interagg.py", line 64, in show
    self.figure.tight_layout()
  File "F:\Python\compairing-epsilons\lib\site-packages\matplotlib\figure.py", line 3199, in tight_layout
    pad=pad, h_pad=h_pad, w_pad=w_pad, rect=rect)
  File "F:\Python\compairing-epsilons\lib\site-packages\matplotlib\tight_layout.py", line 325, …
Run Code Online (Sandbox Code Playgroud)

python matplotlib

2
推荐指数
1
解决办法
2026
查看次数