android - FaSTLane beta lane 无法在 android Flutter 中创建应用构建

标签 android flutter gradle fastlane

我无法使用 faSTLane 构建 beta 应用程序并且错误说-:

1.AAPT:错误:找不到资源android:attr/fontVariationSettings。
2.AAPT:错误:找不到资源android:attr/ttcIndex。

可以使用 Flutter app build 或使用原生 android studio 界面构建应用,但使用 faSTLane beta 命令失败。

我的车道是-

lane :beta do
gradle(task: 'assemble', build_type: 'Release')
upload_to_play_store(track: 'beta')
slack(message: 'Successfully distributed a new beta build')

结尾

app/builld.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"
apply plugin: 'com.google.gms.google-services'

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.tudite.mobileapp"
        minSdkVersion 21
        targetSdkVersion 28
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    signingConfigs {
        release {
            keyAlias keystoreProperties['keyAlias']
            keyPassword keystoreProperties['keyPassword']
            storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
            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
        }
    }
}

flutter {
    source '../..'
}

dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'com.google.firebase:firebase-analytics:17.2.3'
    implementation 'com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
}

最佳答案

在深入研究 faSTLane 文档后,以下解决方案对我有用-

1 - 将 gradle(task: 'assemble', build_type: 'Release') 更改为 gradle(task:
' bundle ',build_type:'发布')

更新的车道是 -

lane :beta do
    gradle(task: 'bundle', build_type: 'Release')
    supply(
        skip_upload_changelogs: true,
        skip_upload_screenshots: false,
        skip_upload_images: false,
        skip_upload_metadata: false
    )
    upload_to_play_store(
        track: 'beta',
        version_code: 2,
        version_name: "1.0.1",
       )
    slack(message: 'Successfully distributed a new beta build')
  end

关于android - FaSTLane beta lane 无法在 android Flutter 中创建应用构建,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61585990/

相关文章:

eclipse - 如何在嵌套项目上构建gradle

android - Volley 库中 StringRequest 中的 NullPointer 异常

android - 创建新的偏好并坚持下去?

Flutter:进度对话框没有隐藏

Flutter:使字幕文本扩展到前导widget下的空白区域

Flutter Firestore : specific documents from a collection (Firestore. collection.where)

java - 如何解决 Java 错误 : package javax. 注释不可见,Java 版本 9

android - Gradle uploadArchives 并行运行,导致 oss sonatype nexus 上出现多个暂存存储库

android - 如何在android中使用其包名杀死任何应用程序

android - 适用于 Android 的人脸识别器 opencv 类