[原创]fluter之个推的插件bug解决

2021-12-23  本文已影响0人  吉凶以情迁

在android app build.gradle中


apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

下面加上

 def push_manifestPlaceholders = [
                LOZN_DEBUG:"true",
                GETUI_APP_ID    : "lozn",
                GETUI_APP_KEY   : "lozn",
                GETUI_APP_SECRET: "",
                // 下面是多厂商配置,如需要开通使用请联系技术支持
                // 如果不需要使用,预留空字段即可
                XIAOMI_APP_ID   : "",
                XIAOMI_APP_KEY  : "",
                MEIZU_APP_ID    : "",
                MEIZU_APP_KEY   : "",
                HUAWEI_APP_ID   : "",
                OPPO_APP_KEY   : "",
                OPPO_APP_SECRET  : "",
                VIVO_APP_ID   : "",
                VIVO_APP_KEY  : ""
        ]
 /* project.android {
                defaultConfig {
                    // Setting to android.app.Application is the same as omitting the attribute.
                    manifestPlaceholders =  project.android.defaultConfig.manifestPlaceholders+push_manifestPlaceholders;
                }
            } */
 project.android.defaultConfig.manifestPlaceholders= project.android.defaultConfig.manifestPlaceholders+push_manifestPlaceholders
print("current_manifestplaceholder:"+project.android.defaultConfig.manifestPlaceholders);

如果按普通的继承方法,会提示ApplicationName 不存在问题,原因是这样写会把flutter.gradle里面定义的给替换没了.

上一篇 下一篇

猜你喜欢

热点阅读