You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Google Console内部测试Pixel 8空指针异常问题咨询

解决Pixel 8独有的Google Wallet相关空指针错误日志问题

问题背景

在Google Console内部测试中,仅Pixel 8设备出现以下空指针错误,Pixel 8 Pro、Pixel 8a测试均无此问题,希望消除该错误日志以避免测试提示:

java.lang.NullPointerException:  Attempt to invoke virtual method 'java.lang.Class java.lang.Object.getClass()' on a null object reference
Exception java.lang.NullPointerException:  Attempt to invoke virtual method 'java.lang.Class java.lang.Object.getClass()' on a null object reference
at android.os.Parcel.createExceptionOrNull (Parcel.java:3189)
at android.os.Parcel.createException (Parcel.java:3167)
at android.os.Parcel.readException (Parcel.java:3150)
at android.database.DatabaseUtils.readExceptionFromParcel (DatabaseUtils.java:202)
at android.database.DatabaseUtils.readExceptionFromParcel (DatabaseUtils.java:154)
at android.content.ContentProviderProxy.call (ContentProviderNative.java:764)
at android.content.ContentResolver.call (ContentResolver.java:2466)
at android.content.ContentResolver.call (ContentResolver.java:2446)
at ekfr.a (:com.google.android.gms@242013038@24.20.13 (190400-633713831):29)
at com.google.android.gms.wallet.intentoperation.setupwizard.PaymentsSetupWizardAccountChangeIntentOperation.onHandleIntent (:com.google.android.gms@242013038@24.20.13 (190400-633713831):252)
at com.google.android.chimera.IntentOperation.onHandleIntent (:com.google.android.gms@242013038@24.20.13 (190400-633713831):2)
at ajdw.onHandleIntent (:com.google.android.gms@242013038@24.20.13 (190400-633713831):8)
at pbh.run (:com.google.android.gms@242013038@24.20.13 (190400-633713831):70)
at pbg.run (:com.google.android.gms@242013038@24.20.13 (190400-633713831):152)
at elbx.run (:com.google.android.gms@242013038@24.20.13 (190400-633713831):21)
at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:644)
at java.lang.Thread.run (Thread.java:1012)

解决方案

  • 校验Google Play Services版本
    日志显示错误来自com.google.android.gms 24.20.13版本,对比Pixel 8 Pro/8a上的GMS版本,尝试将Pixel 8的GMS更新至最新稳定版,或回退到与其他正常设备一致的版本测试,版本差异大概率是问题诱因。

  • 检查Wallet集成的参数合法性
    错误触发路径涉及ContentResolver.call()及Google Wallet账户变更Intent操作,检查应用中触发该逻辑的代码,确保传入的Uri、参数、Bundle等无空值,针对Pixel 8设备增加额外的空值校验逻辑。

  • 针对性捕获异常
    若确认是GMS组件本身的兼容性问题,可在触发Wallet相关操作的代码块中捕获异常,避免崩溃日志上传至Google Console:

    try {
        // 触发Google Wallet相关操作的代码
        ContentResolver resolver = getContentResolver();
        resolver.call(yourUri, yourMethod, yourArg, yourExtras);
    } catch (NullPointerException | RemoteException e) {
        // 仅本地记录日志,不上传崩溃信息
        Log.d("WalletCompat", "Handled compatibility exception: " + e.getMessage());
    }
    
  • 提交官方反馈
    由于问题仅出现在Pixel 8设备,属于特定硬件与GMS的兼容性问题,可通过Google官方渠道提交详细反馈,包含设备型号、GMS版本、完整错误日志等信息,等待官方修复。

内容的提问来源于stack exchange,提问作者Guang Nian

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.21 18:23:12