BuildConfig 反射方案在 applicationId 与 namespace 不同时(如 shijiaobao flavor)会抛出 ClassNotFoundException 导致 buildId=null。改为通过 manifestPlaceholders 注入 xuqmBuildId, SDK 从 PackageManager.getApplicationInfo(GET_META_DATA) 读取,彻底绕开包名歧义。 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
14 行
539 B
XML
14 行
539 B
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
|
<application>
|
|
<!--
|
|
Build ID injected by the XuqmGroup BugCollect Gradle plugin at compile time.
|
|
The plugin fills ${xuqmBuildId} via variant.manifestPlaceholders.
|
|
SDK reads it via PackageManager.getApplicationInfo(GET_META_DATA).
|
|
-->
|
|
<meta-data
|
|
android:name="com.xuqm.build_id"
|
|
android:value="${xuqmBuildId}" />
|
|
</application>
|
|
</manifest>
|