简体   繁体   English

Fastlane beta 通道无法在 android flutter 中创建应用程序构建

[英]Fastlane beta lane fails to create app build in android flutter

Im not able to build beta app using fastlane and error say -:我无法使用 fastlane 构建 beta 应用程序并且错误说-:

1.AAPT: error: resource android:attr/fontVariationSettings not found. 1.AAPT:错误:资源 android:attr/fontVariationSettings 未找到。 2.AAPT: error: resource android:attr/ttcIndex not found. 2.AAPT:错误:资源 android:attr/ttcIndex 未找到。

App can be build by using flutter app build or using native android studio interface but fails using fastlane beta command.可以使用 flutter 应用程序构建或使用本机 android 工作室界面构建应用程序,但使用 fastlane beta 命令失败。

My lane is -我的车道是-

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

end结尾

app/builld.gradle file - 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'
}

After looking deep into fastlane documentation the following solution worked for me-在深入研究了 fastlane 文档后,以下解决方案对我有用-

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

Updated lane is -更新的车道是 -

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM