我无法使用fastlane构建测试版应用,错误说-。
1.AAPT: error: resource android:attrfontVariationSettings not found. 2.AAPT: error: resource android:attrttcIndex not found.
可以使用flutter应用构建或使用原生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')
结束
appbuilld.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: 'Release')
更新后的车道是----------。
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