码农知识堂 - 1000bd
  •   Python
  •   PHP
  •   JS/TS
  •   JAVA
  •   C/C++
  •   C#
  •   GO
  •   Kotlin
  •   Swift
  • Flutter 遇到的问题整理


    Flutter 遇到的问题整理

    • 1. Provisioning profile "iOS Team Provisioning Profile: x x x x" doesn't include the currently selected device "iPhone" (identifier b6b9a3d3c6bdea4812394a6c24f6572625c46300).
      • 解决方案
    • 2.安卓Plugin project :ur_launcher web not found. Please update settings.gradle.
      • 解决方案
    • 3.安卓一直报没有网络权限pipe 'gemud:network': Invalid argument Permission denied
      • 解决方案
    • 3.安卓状态栏阴影去除
      • 解决方案
    • 4.Flutter 输入框Textfiled设置内容后,让光标cursor位置处于文字末尾.
    • 5.Dart Analysis Server client: couldn't create connection to server.The Dart Analysis Server server crashed 5 times in the last 3 minutes. The server will not be restarted.
      • 解决方案:
    • 6.flutter 报错 Command PhaseScriptExecution failed with a nonzero exit code
      • 解决方案:

    1. Provisioning profile “iOS Team Provisioning Profile: x x x x” doesn’t include the currently selected device “iPhone” (identifier b6b9a3d3c6bdea4812394a6c24f6572625c46300).

    解决方案

    用Xcode 重新编译一下

    2.安卓Plugin project :ur_launcher web not found. Please update settings.gradle.

    解决方案

    查看android/gradle/wrapper/gradle-wrapper.properties
    distributionUrl gradle 版本是否正确
    然后flutter clear 并且删除 pubspec.lock
    重新 flutter pub get

    3.安卓一直报没有网络权限pipe ‘gemud:network’: Invalid argument Permission denied

    qemu_pipe_open_ns:62: Could not  connect  to the  'pipe: gemud:network' service:
    Invalid argument
    08-04 16:22:14.190 - netmar Failed to open OEMU pipe 'gemud:network': Invalid argument
    08-0416:99:39.880E andro1d.system.suspend@1.0-service: Error opening kernel wakelock stats for: wakeup34: Permission denied
    08-04 16:22:39 W Binder: 212 2: tvpe=1400 audit(0.0:602): avc: denied { read } for name="wakeup34" dev="svsfs' ino=19159 sco ntext=u:r:system_suspend:s0 tcontext=u:object_r:systs:s0 tclass=dlr permissive=l
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6

    但是下面的权限都已经添加

    
    
    
    ....
    <--res/xml/network_security_config.xml -->
    
    
        
            
                
            
        
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16

    解决方案

    修改AndroidManifest.xml 权限位置
    把权限都放到下面

    
      
       
          。。。。
        
        
        
        
        
        
        
        
        
        
        
        
    
    
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26

    3.安卓状态栏阴影去除

    解决方案

    1./android/app/src/main/kotlin/com/example/xxx/MainActivity.kt

    package com.example.yyy
    
    import io.flutter.embedding.android.FlutterActivity
    //引入
    import android.os.Build;
    import android.os.Bundle;
    
    class MainActivity: FlutterActivity() {
      //设置状态栏沉浸式透明(修改flutter状态栏黑色半透明为全透明)
        override fun onCreate(savedInstanceState: Bundle?) {
            super.onCreate(savedInstanceState);
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
                window.statusBarColor = 0
            }
        }
    }
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    1. 入口文件main.dart
    main() async {
       。。。。
        runApp(const MyApp());
        SystemUiOverlayStyle uiStyle = const SystemUiOverlayStyle(
          systemNavigationBarColor: Color(0x00000000),
          systemNavigationBarDividerColor: null,
          statusBarColor: Color(0x00000000),
          systemNavigationBarIconBrightness: Brightness.dark,
          statusBarIconBrightness: Brightness.dark,
          statusBarBrightness: Brightness.dark,
        );
        SystemChrome.setSystemUIOverlayStyle(uiStyle);
     
    }
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14

    4.Flutter 输入框Textfiled设置内容后,让光标cursor位置处于文字末尾.

    controller.text = 'xxxx';
    controller.selection = TextSelection.fromPosition(TextPosition(offset: controller.text.length));
    
    
    
    • 1
    • 2
    • 3
    • 4

    5.Dart Analysis Server client: couldn’t create connection to server.The Dart Analysis Server server crashed 5 times in the last 3 minutes. The server will not be restarted.

    问题: 不小心更新了vscode 导致一直Analysis…;而且错误提示不显示,代码提示加载中。。。

    解决方案:

    1.Deleting ~/.dartServer/.analysis-driver/ might be worth a try.
    2. 重启vscode
    参考:https://stackoverflow.com/questions/64500143/dart-analysis-server-has-terminated

    6.flutter 报错 Command PhaseScriptExecution failed with a nonzero exit code

    解决方案:

    我犯的错误:检查配置文件中 flutter root 是否错误

  • 相关阅读:
    【网络篇】第八篇——多进程版的TCP网络程序
    大数据毕业设计选题推荐-消防监控平台-Hadoop-Spark-Hive
    编程中的插槽(slot)含义介绍
    地表温度LST计算教程
    在Ubuntu 18.04安装Docker
    区块链智能合约
    实时时钟和日历电路芯片MS85163/MS85163M
    字节一面:深拷贝浅拷贝的区别?如何实现一个深拷贝?
    无人值守的共享台球室:微信小程序实现自助服务
    redis学习2-测试性能
  • 原文地址:https://blog.csdn.net/qq_43383334/article/details/126478158
  • 最新文章
  • 攻防演习之三天拿下官网站群
    数据安全治理学习——前期安全规划和安全管理体系建设
    企业安全 | 企业内一次钓鱼演练准备过程
    内网渗透测试 | Kerberos协议及其部分攻击手法
    0day的产生 | 不懂代码的"代码审计"
    安装scrcpy-client模块av模块异常,环境问题解决方案
    leetcode hot100【LeetCode 279. 完全平方数】java实现
    OpenWrt下安装Mosquitto
    AnatoMask论文汇总
    【AI日记】24.11.01 LangChain、openai api和github copilot
  • 热门文章
  • 十款代码表白小特效 一个比一个浪漫 赶紧收藏起来吧!!!
    奉劝各位学弟学妹们,该打造你的技术影响力了!
    五年了,我在 CSDN 的两个一百万。
    Java俄罗斯方块,老程序员花了一个周末,连接中学年代!
    面试官都震惊,你这网络基础可以啊!
    你真的会用百度吗?我不信 — 那些不为人知的搜索引擎语法
    心情不好的时候,用 Python 画棵樱花树送给自己吧
    通宵一晚做出来的一款类似CS的第一人称射击游戏Demo!原来做游戏也不是很难,连憨憨学妹都学会了!
    13 万字 C 语言从入门到精通保姆级教程2021 年版
    10行代码集2000张美女图,Python爬虫120例,再上征途
Copyright © 2022 侵权请联系2656653265@qq.com    京ICP备2022015340号-1
正则表达式工具 cron表达式工具 密码生成工具

京公网安备 11010502049817号