bytedance / AabResGuard

The tool of obfuscated aab resources.(Android app bundle资源混淆工具)
Apache License 2.0
1.3k stars 179 forks source link

Firebase已经在application中初始化,但报错Default FirebaseApp is not initialized in this process #79

Closed jintaox closed 2 years ago

jintaox commented 2 years ago

模板配置 aabResGuard { mappingFile = file("mapping.txt").toPath() whiteList = [ ".R.raw.", ".R.string.fb_panpin_id", ".R.string.fb_panpin_scheme",

        "*.R.string.default_web_client_id",
        "*.R.string.firebase_database_url",
        "*.R.string.gcm_defaultSenderId",
        "*.R.string.google_api_key",
        "*.R.string.google_app_id",
        "*.R.string.google_crash_reporting_api_key",
        "*.R.string.google_storage_bucket",
        "*.R.string.project_id"
]
obfuscatedBundleFileName = "duplicated-app.aab"
mergeDuplicatedRes = true
enableFilterFiles = true
filterList = [ ]
enableFilterStrings = false
unusedStringPath = file("unused.txt").toPath()
languageWhiteList = ["in"]

} 已经在application中初始化FirebaseApp.initializeApp(this),并且在使用 FirebaseInstanceId.getInstance().instanceId.addOnSuccessListener(object : OnSuccessListener { override fun onSuccess(instanceIdResult: InstanceIdResult?) { } }) 监听前也初始化了,但还是报以下错误(不使用插件混淆不会报这个错) Default FirebaseApp is not initialized in this process. Make sure to call FirebaseApp.initializeApp(Context) first.

zhangzhiao commented 1 year ago

怎么解决的