Firebase Remote Config: Задача 'assemblyAarRelease' не найдена в root проекте 'firebase_remote_config' - PullRequest
0 голосов
/ 19 апреля 2020

У меня уже есть приложение, опубликованное sh в playstore, и мне нужно проверить версию приложения для функции автоматического обновления приложения. Я использую firebase_remote_config, чтобы сохранить небольшую информацию о версии сборки приложения, после чего я могу сравнить ее. Все выглядит хорошо в режиме отладки, но проблема в том, когда я хочу, чтобы сборка выпустила приложение, используя команду flutter build apk --target-platform android-arm,android-arm64,android-x64 --split-per-abi или flutter build apk, Дайте мне эту ошибку:

Ошибка журнала

PS C:\Project Flutter\playstore_app\atur_semua_aktifitas> flutter build apk --target-platform android-arm,android-arm64,android-x64 --split-per-abi
Parameter format not correct -
Note: C:\flutter\flutter\.pub-cache\hosted\pub.dartlang.org\firebase_remote_config-0.3.0+3\android\src\main\java\io\flutter\plugins\firebase\firebaseremoteconfig\MethodCallHandlerImpl.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Running Gradle task 'assembleRelease'...
Removed unused resources: Binary resource data reduced from 404KB to 358KB: Removed 11%
Removed unused resources: Binary resource data reduced from 404KB to 358KB: Removed 11%
Removed unused resources: Binary resource data reduced from 404KB to 358KB: Removed 11%

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':system_setting:verifyReleaseResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
   > Android resource linking failed
     C:\Users\user\.gradle\caches\transforms-2\files-2.1\e6856c7cff7219f18cbbcc5d8d7cecec\core-1.1.0\res\values\values.xml:142:5-173:25: AAPT: error: resource android:attr/fontVariationSettings not found.

     C:\Users\user\.gradle\caches\transforms-2\files-2.1\e6856c7cff7219f18cbbcc5d8d7cecec\core-1.1.0\res\values\values.xml:142:5-173:25: AAPT: error: resource android:attr/ttcIndex not found.


* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 2m 40s
Running Gradle task 'assembleRelease'...
Running Gradle task 'assembleRelease'... Done                     161.0s (!)
The built failed likely due to AndroidX incompatibilities in a plugin. The tool is about to try using Jetfier to solve the incompatibility.
Building plugin firebase_remote_config...
Running Gradle task 'assembleAarRelease'...
Running Gradle task 'assembleAarRelease'... Done                    3.5s


FAILURE: Build failed with an exception.

* What went wrong:
Task 'assembleAarRelease' not found in root project 'firebase_remote_config'.

* Try:
Run gradlew tasks to get a list of available tasks. Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 3s


The plugin firebase_remote_config could not be built due to the issue above.
PS C:\Project Flutter\playstore_app\atur_semua_aktifitas>

После поиска в сообществе у меня возникла похожая проблема со мной, например , это о AAPT: ошибка: ресурс android: attr / fontVariationSettings не найден. . Но хотя я изменяю compileSDKVersion на 28, проблема не ясна.

Я что-то пропустил?

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 {
        // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
        applicationId "id.zeffry.atur_semua_aktifitas"
        minSdkVersion 16
        targetSdkVersion 28
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
    }

    signingConfigs {
       release {
           keyAlias keystoreProperties['keyAlias']
           keyPassword keystoreProperties['keyPassword']
           storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
           storePassword keystoreProperties['storePassword']
       }
   }
   buildTypes {
       release {
           signingConfig signingConfigs.release
           // Enables code shrinking, obfuscation, and optimization for only
           // your project's release build type.
           minifyEnabled true

           // Enables resource shrinking, which is performed by the
           // Android Gradle plugin.
           shrinkResources true

                       // Includes the default ProGuard rules files that are packaged with
            // the Android Gradle plugin. To learn more, go to the section about
            // R8 configuration files.
            proguardFiles getDefaultProguardFile(
                    'proguard-android-optimize.txt'),
                    'proguard-rules.pro'
       }
   }
}

flutter {
    source '../..'
}

dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'com.google.firebase:firebase-analytics:17.2.2'
}
apply plugin: 'com.google.gms.google-services'
...