根据文档要求配置
jpush文档.png控制台打印如下问题:
Launching lib/main.dart on sdk gphone64 arm64 in debug mode...
Running Gradle task 'assembleDebug'...
/Users/xxx/Documents/Projects/Projects_flutter/education_app/android/app/src/main/AndroidManifest.xml:41:9-42 Error:
Attribute application@name at AndroidManifest.xml:41:9-42 requires a placeholder substitution but no value for <applicationName> is provided.
/Users/fuweizhang/Documents/Projects/Projects_flutter/education_app/android/app/src/debug/AndroidManifest.xml Error:
Validation failed, exiting
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugMainManifest'.
> Manifest merger failed with multiple errors, see logs
原因分析:
app/build.gradle中的手动配置的 manifestPlaceholders字典, 覆盖了原有manifestPlaceholders字典中的“ applicationName”字段,导致AndroidManifest.xml
中使用applicationName
时,获取不到!!!
解决方案:
manifestPlaceholders = [
JPUSH_PKGNAME : applicationId,
JPUSH_APPKEY : "fa3229b08xxxxb2dea3d39e4", // NOTE: JPush 上注册的包名对应的 Appkey.
JPUSH_CHANNEL : "developer-default", //暂时填写默认值即可.
]
修改为
manifestPlaceholders += [
JPUSH_PKGNAME : applicationId,
JPUSH_APPKEY : "fa3229b08xxxxb2dea3d39e4", // NOTE: JPush 上注册的包名对应的 Appkey.
JPUSH_CHANNEL : "developer-default", //暂时填写默认值即可.
]
或
manifestPlaceholders["JPUSH_PKGNAME"]="applicationId"
manifestPlaceholders["JPUSH_APPKEY"]="fa3229b08xxxxb2dea3d39e4"
manifestPlaceholders["JPUSH_CHANNEL"]="developer-default""
网友评论