android - Flutter项目添加华为agconnect后构建失败

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

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

FAILURE: Build failed with an exception.

What went wrong: Execution failed for task ':app:processDebugResources'. failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade

Android resource linking failed C:\Users\denbo.gradle\caches\transforms-2\files-2.1\2f7fef5146433a886db0a4b7a0dabd3c\push-5.1.1.301\AndroidManifest.xml:9:5-11:55: AAPT: error: resource attr/??? (aka com.example.app:attr/???) not found.



我的 android/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'

最佳答案

问题是我在 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">
我能够构建我的应用程序。

关于android - Flutter项目添加华为agconnect后构建失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69045870/

相关文章:

android - 是否可以使用 Google Cloud Messaging(GCM 推送通知)来实现这些需求?

flutter - 如何在查询不同集合的streambuilder中查询另一个集合?

ios - 如何在出现之前过滤ios推送通知

php - PHP服务器中的iOS推送实现

android - android 中 paytm 支付网关集成中的客户端证书是什么?

android - 无法加载 memtrack 模块 -2

sqlite - 我如何使用 sqflite 并仅在 flutter 上查询 1 行数据

ios - 即使内容的 Storyboard已更新,也不会调用通知内容

android - 我/ Chrome : [INFO:CONSOLE(1)] "ERROR" angular 5 error when called in web view

sqlite - 如何为用户添加选项以从连接到他的谷歌帐户的移动应用程序备份他的个人文件(文本)?