zoukankan      html  css  js  c++  java
  • 常见flutter报错及解决方法

    常见flutter报错及解决方法,希望对有需要的朋友提供参考。

    错误一:tool-replace meta-data .... 插件冲突

    错误信息如下:

    PS F:Develop_xxxxxflu-projectxxxxx> flutter run
    Running "flutter pub get" in xxxxx...                            30.4s
    Using hardware rendering with device sdk gphone x86. If you get graphics artifacts, consider enabling software rendering with
    "--enable-software-rendering".
    Launching libmain.dart on sdk gphone x86 in debug mode...
    Running Gradle task 'assembleDebug'...
    F:Develop_xxxxflu-projectxxxxxandroidappsrcdebugAndroidManifest.xml:18:17-55 Error:
            Attribute meta-data#android.support.FILE_PROVIDER_PATHS@resource value=(@xml/provider_paths) from [:flutter_bugly] AndroidManifest.xml:18:17-55
            is also present at [:open_file] AndroidManifest.xml:20:17-50 value=(@xml/filepaths).
            Suggestion: add 'tools:replace="android:resource"' to <meta-data> element at AndroidManifest.xml to override.
    
    FAILURE: Build failed with an exception.
    
    * What went wrong:
    Execution failed for task ':app:processDebugManifest'.
    > Manifest merger failed : Attribute meta-data#android.support.FILE_PROVIDER_PATHS@resource value=(@xml/provider_paths) from [:flutter_bugly] AndroidManifest.xml:18:17-55
            is also present at [:open_file] AndroidManifest.xml:20:17-50 value=(@xml/filepaths).
            Suggestion: add 'tools:replace="android:resource"' to <meta-data> element at AndroidManifest.xml to override.
    
    * Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
    
    * Get more help at https://help.gradle.org
    
    BUILD FAILED in 2m 6s
    Running Gradle task 'assembleDebug'...
    Running Gradle task 'assembleDebug'... Done                       135.9s (!)
    The built failed likely due to AndroidX incompatibilities in a plugin. The tool is about to try using Jetfier to solve the
    incompatibility.
    Building plugin audioplayers...
    Running Gradle task 'assembleAarRelease'...
    Running Gradle task 'assembleAarRelease'... Done                   65.7s
    √ Built buildappoutputs
    epo.
    Building plugin cipher2...
    Running Gradle tas
    

      解决方法,在项目下的External Libraries下的Flutter Plugins/flutter_bugly-0.2.5/android/src.main/AndroidManifest.xml配置下的<meta-data 里添加 

    tools:replace="android:resource"
    详细见截图如下:

     错误二:Connect to storage.googleapis.com:443 

    Could not resolve all artifacts for configuration ':app:debugCompileClasspath'.
    * What went wrong:
    Execution failed for task ':app:compileDebugKotlin'.
    > Could not resolve all artifacts for configuration ':app:debugCompileClasspath'.
       > Could not download arm64_v8a_debug.jar (io.flutter:arm64_v8a_debug:1.0.0-fdf4f7883f678eb6d5c30c303c485fae1f8ba0cb)
          > Could not get resource 'https://storage.googleapis.com/download.flutter.io/io/flutter/arm64_v8a_debug/1.0.0-fdf4f7883f678eb6d5c30c303c485fae1f8ba0cb/arm64_v8a_debug-1.0.0-fdf4f78
    83f678eb6d5c30c303c485fae1f8ba0cb.jar'.
             > Could not GET 'https://storage.googleapis.com/download.flutter.io/io/flutter/arm64_v8a_debug/1.0.0-fdf4f7883f678eb6d5c30c303c485fae1f8ba0cb/arm64_v8a_debug-1.0.0-fdf4f7883f678
    eb6d5c30c303c485fae1f8ba0cb.jar'.
                > Connect to storage.googleapis.com:443 [storage.googleapis.com/172.217.160.80] failed: Connection timed out: connect
    
    * Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
    
    * Get more help at https://help.gradle.org
    
    BUILD FAILED in 1m 46s
    

      解决方法:要翻墙。可能要下载相应包。

  • 相关阅读:
    zabbix微信报警 风行天下
    centos7环境下的Mysql5.7.22安装 风行天下
    任务计划程序Windows2008及win2016计划任务定时重启 风行天下
    zabbix监控windows磁盘空间 风行天下
    redhat 7安装CentOS 7 yum源 风行天下
    rhel7配置yum的方法 风行天下
    centos7防火墙使用方法 风行天下
    rhel7配置ELK过程 风行天下
    windows巡检 风行天下
    MapX+VB 前一视图功能
  • 原文地址:https://www.cnblogs.com/wulinzi/p/12552097.html
Copyright © 2011-2022 走看看