【问题标题】:Build failed with an exception - (Build file build.gradle line: 27)构建失败并出现异常 - (构建文件 build.gradle 行:27)
【发布时间】:2023-03-09 21:29:01
【问题描述】:

我想从 App Store 的应用中获取输出,但我收到此错误:

    For more information see https://dart.dev/null-safety/unsound-null-safety
    
    
    FAILURE: Build failed with an exception.
    
    * Where:
    Build file 'C:\Users\Mahan\FlutterProjects\dooneh\android\build.gradle' line: 27
    
    * What went wrong:
    A problem occurred evaluating root project 'android'.
    > A problem occurred configuring project ':app'.
       > Conflicting configuration : 'armeabi-v7a,x86_64,arm64-v8a,x86' in ndk abiFilters cannot be present when splits abi filters are set : x86_64,armeabi-v7a,arm64-v8a
    
    * 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 1s 

build.gradle 的第 27 行,来自android

subprojects {
    project.evaluationDependsOn(':app')
}

我从android/app 这一行添加到文件build.gradle

ndk.abiFilters 'armeabi-v7a','arm64-v8a','x86','x86_64'

我尝试了很多方法,甚至在pub.dev 上使用了build without null safetythis 中提到的方法

【问题讨论】:

    标签: flutter dart gradle


    【解决方案1】:

    This 解决了我的问题。有趣的是,我没有在我的build.gradle 中使用拆分,但是删除这行代码解决了这个问题:

    ndk.abiFilters 'armeabi-v7a','arm64-v8a','x86','x86_64'
    

    【讨论】:

      猜你喜欢
      • 2022-01-13
      • 2021-07-18
      • 1970-01-01
      • 2023-02-15
      • 1970-01-01
      • 2023-03-22
      • 1970-01-01
      • 2021-11-11
      相关资源
      最近更新 更多