• 常见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
    

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

  • 相关阅读:
    leetcode 54. 螺旋矩阵 js高效实现
    leetcode 141. 环形链表 js 实现
    通过 BFC 实现页面布局
    leetcode 1351. 统计有序矩阵中的负数 js实现
    js 实现元素拖拽
    如何在 chrome控制台快速获取某段 html?
    leetcode 160. 相交链表 js 实现
    leetcode 70. 爬楼梯 js实现
    nodejs中事件循环中的执行顺序
    leetcode 300. 最长递增子序列 js 动态规划实现
  • 原文地址:https://www.cnblogs.com/wulinzi/p/12552097.html
Copyright © 2020-2023  润新知