gpt4 book ai didi

android - 应用程序 :compileFlutterBuildRelease error while building app flutter

转载 作者:行者123 更新时间:2023-12-03 13:31:06 51 4
gpt4 key购买 nike

在源代码中运行“flutter pub get”... 5.9s
正在运行 Gradle 任务“bundleRelease”...
在字体中找不到代码点 58848,正在中止。
目标 aot_android_asset_bundle 失败:FontSubset 错误:字体子集设置失败,退出代码为 -1。
构建失败。
FAILURE:构建失败并出现异常。

  • 地点:

  • 脚本 'C:\src\flutter\packages\flutter_tools\gradle\flutter.gradle' 行:838
  • 出了什么问题:

  • 任务 ':app:compileFlutterBuildRelease' 执行失败。

    Process 'command 'C:\src\flutter\bin\flutter.bat'' finished with non-zero exit value 1


  • 试试:

  • 使用 --stacktrace 选项运行以获取堆栈跟踪。使用 --info 或 --debug 选项运行以获得更多日志输出。运行 --scan 以获得完整的见解。
  • https://help.gradle.org 获得更多帮助

  • 在 2m 52s 内构建失败
    运行 Gradle 任务 'bundleRelease'... 175.2s (!)
    Gradle 任务 bundleRelease 失败,退出代码为 1
    进程以退出代码 1 结束
    应用程序:build.gradle
    def localProperties = new Properties()
    def localPropertiesFile = rootProject.file('local.properties')
    if (localPropertiesFile.exists()) {
    localPropertiesFile.withReader('UTF-8') { reader ->
    localProperties.load(reader)
    }
    }

    def flutterRoot = localProperties.getProperty('flutter.sdk')
    if (flutterRoot == null) {
    throw new GradleException("Flutter SDK not found. Define location with
    flutter.sdk in the local.properties file.")
    }

    def flutterVersionCode =
    localProperties.getProperty('flutter.versionCode')
    if (flutterVersionCode == null) {
    flutterVersionCode = '1'
    }

    def flutterVersionName = localProperties.getProperty('flutter.versionName')
    if (flutterVersionName == null) {
    flutterVersionName = '1.0'
    }

    apply plugin: 'com.android.application'
    apply plugin: 'kotlin-android'
    apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

    def keystoreProperties = new Properties()
    def keystorePropertiesFile = rootProject.file('key.properties')
    if (keystorePropertiesFile.exists()) {
    keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
    }

    android {
    compileSdkVersion 28

    sourceSets {
    main.java.srcDirs += 'src/main/kotlin'
    }

    lintOptions {
    disable 'InvalidPackage'
    }

    defaultConfig {
    applicationId "com.indianstore.onlineshopping"
    minSdkVersion 19
    targetSdkVersion 28
    versionCode flutterVersionCode.toInteger()
    versionName flutterVersionName
    testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    multiDexEnabled true
    resConfigs "en"
    }

    signingConfigs {
    release {

    if (System.getenv()["CI"]) { // CI=true is exported by Codemagic
    storeFile file(System.getenv()["FCI_BUILD_DIR"] + "/indianstorekey.jks")
    storePassword System.getenv()["FCI_KEYSTORE_PASSWORD"]
    keyAlias System.getenv()["FCI_KEY_ALIAS"]
    keyPassword System.getenv()["FCI_KEY_PASSWORD"]
    } else {
    keyAlias keystoreProperties['keyAlias']
    keyPassword keystoreProperties['keyPassword']
    storeFile file(keystoreProperties['storeFile'])
    storePassword keystoreProperties['storePassword']
    }
    }
    }

    buildTypes {
    release {
    // TODO: Add your own signing config for the release build.
    // Signing with the debug keys for now, so `flutter run --release` works.
    signingConfig signingConfigs.release
    shrinkResources true
    minifyEnabled true
    useProguard true

    proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }

    debug {
    signingConfig signingConfigs.release
    }
    }
    compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
    }
    }

    flutter {
    source '../..'
    }

    dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
    implementation 'com.android.support:multidex:1.0.3'


    }
    apply plugin: 'com.google.gms.google-services'
    googleServices { disableVersionCheck = true }

    最佳答案

    遇到了同样的问题。
    flutter build appbundle --verbose我找到了根本原因。它基于自定义图标,这是我很久以前用 http://fluttericon.com/ 构建的。 .
    所以有3种可能的解决方案:

  • 添加标志“--no-tree-shake-icons”
  • 删除自定义图标
  • 再次重新生成自定义图标

  • 一切都会奏效!

    关于android - 应用程序 :compileFlutterBuildRelease error while building app flutter,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62781193/

    51 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com