【发布时间】:2020-10-28 01:28:12
【问题描述】:
在源代码中运行“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'' 以非零退出值 1 结束
- 试试:
使用 --stacktrace 选项运行以获取堆栈跟踪。使用 --info 或 --debug 选项运行以获得更多日志输出。运行 --scan 以获得完整的见解。
- 在https://help.gradle.org 获得更多帮助
在 2m 52s 内构建失败 运行 Gradle 任务 'bundleRelease'... 175.2s (!) Gradle 任务 bundleRelease 失败,退出代码为 1 进程以退出代码 1 结束
app: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 }
【问题讨论】:
-
你有什么解决办法吗?
-
没有兄弟还没有,你有同样的问题
-
是的,我有。我在 pubspec.yaml 中使用 MaterialIcons 字体,我只是删除了它。
-
你能看到我的 pubspec.yaml 并告诉我应该删除哪个部分
-
你有解决这个问题的办法吗?
标签: android firebase android-studio flutter