【问题标题】:Flutter project fails to build after adding huawei agconnectFlutter项目添加华为agconnect后构建失败
【发布时间】:2021-11-01 20:25:45
【问题描述】:

添加“com.huawei.agconnect”插件后,我的flutter项目构建失败:

FAILURE:构建失败并出现异常。

出了什么问题:任务执行失败 ':app:processDebugResources'。执行时发生故障 com.android.build.gradle.internal.tasks.Workers$ActionFacade

Android 资源链接失败 C:\Users\denbo.gradle\caches\transforms-2\files-2.1\2f7fef5146433a886db0a4b7a0dabd3c\push-5.1.1.301\AndroidManifest.xml:9:5-11:55: AAPT:错误:资源属性/??? (又名 com.example.app:attr/???)未找到。

我的安卓/build.gradle

buildscript {
    ext.kotlin_version = '1.3.61'
    repositories {
        google()
        jcenter()
        maven { url 'https://developer.huawei.com/repo/' }
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.5.0'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath 'com.google.gms:google-services:4.2.0'
        classpath 'com.huawei.agconnect:agcp:1.4.2.301'
    }
}

allprojects {
    repositories {
        google()
        jcenter()
        maven { url 'https://developer.huawei.com/repo/' }
    }
}

android/app/build.gradle

//stuff
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'
apply plugin: 'com.huawei.agconnect'

【问题讨论】:

标签: android flutter push-notification huawei-mobile-services huawei-push-notification


【解决方案1】:

问题是我在 AndroidManifest 中将西里尔字符作为我的应用程序的标签。

<application
        android:name="io.flutter.app.FlutterApplication"
        android:label="АБВГ"
        android:icon="@mipmap/launcher_icon">

改成之后

<application
        android:name="io.flutter.app.FlutterApplication"
        android:label="ABCD"
        android:icon="@mipmap/launcher_icon">

我能够构建我的应用程序。

【讨论】:

    猜你喜欢
    • 2020-05-14
    • 2022-01-16
    • 2020-01-30
    • 1970-01-01
    • 2021-05-09
    • 2018-08-16
    • 1970-01-01
    • 2020-08-15
    • 2023-02-02
    相关资源
    最近更新 更多