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

集成第三方SDK遭遇java.lang.VerifyError问题求助

Android集成第三方SDK触发java.lang.VerifyError排查求助

开发一款与第三方合作的Android应用,第三方提供SDK支撑应用核心功能,每次更新会同步SDK及演示Demo。最新版本SDK在对方Demo中运行正常,但我方集成后触发java.lang.VerifyError,崩溃发生在Application类onCreate初始化SDK的瞬间。

错误信息

java.lang.VerifyError: Verifier rejected class 
com.bark.centralsdk.totkit.totorchestrator.FooCore: 
void com.bark.centralsdk.totkit.totorchestrator.FooCore.<init>(
    android.content.Context, 
    kotlinx.coroutines.CoroutineScope,
    com.bark.centralsdk.totkit.totorchestrator.models.FooConfig,
    com.bark.centralsdk.totkit.cloudcomms.timeprovider.ticktimes.TicTakProvider) 
failed to verify: 
void com.bark.centralsdk.totkit.totorchestrator.FooCore.<init>(
    android.content.Context, 
    kotlinx.coroutines.CoroutineScope,
    com.bark.centralsdk.totkit.totorchestrator.models.FooConfig,
    com.bark.centralsdk.totkit.cloudcomms.timeprovider.ticktimes.TicTakProvider
): [0x69B] expected to be within a catch-all for an instruction where a monitor is held (declaration of 'com.bark.centralsdk.totkit.totorchestrator.FooCore' appears in /data/app/~~XskmXtT81XvYTFEIpq7GJg==/com.bells.central.dev-RJ1CF5SRQTu7TigMxGtk9w==/base.apk!classes7.dex)
                                                                                                        at com.bark.centralsdk.belltxkit.bellcentral.FooCore.<init>(Unknown Source:671)
                                                                                                        at com.bark.centralsdk.belltxkit.bellcentral.FooCore.<init>(Unknown Source:4)
                                                                                                        at com.bark.centralsdk.belltxkit.bellcentral.FooCore$Companion.᫚᫚᫃(Unknown Source:526)
                                                                                                        at com.bark.centralsdk.belltxkit.bellcentral.FooCore$Companion.create(Unknown Source:11)
                                                                                                        at com.bells.central.ApplicationClass.initFoo(ApplicationClass.kt:221)
                                                                                                        at com.bells.central.ApplicationClass.onCreate(ApplicationClass.kt:160)
                                                                                                        at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1316)
                                                                                                        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:7848)
                                                                                                        at android.app.ActivityThread.-$$Nest$mhandleBindApplication(Unknown Source:0)
                                                                                                        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2486)
                                                                                                        at android.os.Handler.dispatchMessage(Handler.java:106)
                                                                                                        at android.os.Looper.loopOnce(Looper.java:230)
                                                                                                        at android.os.Looper.loop(Looper.java:319)
                                                                                                        at android.app.ActivityThread.main(ActivityThread.java:9063)
                                                                                                        at java.lang.reflect.Method.invoke(Native Method)
                                                                                                        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:588)
                                                                                                        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103)

已完成的排查工作

  • 双方使用相同的compileSdk、minSdkVersion和targetSdk:
    ...
    android {
        compileSdk 34
        defaultConfig {
            minSdkVersion 29
            targetSdk 34
            versionCode 297
    
  • 使用相同的Kotlin版本
  • 使用相同的Gradle版本:
    distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
    
  • 使用相同的插件版本:
    plugins {
        id 'com.android.application' version '7.4.2' apply false
        id 'com.android.library' version '7.4.2' apply false
        id 'org.jetbrains.kotlin.android' version '1.7.22' apply false
    }
    
  • 使用相同的编译选项:
    compileOptions {
            sourceCompatibility JavaVersion.VERSION_1_8
            targetCompatibility JavaVersion.VERSION_1_8
        }
        kotlinOptions {
            jvmTarget = '1.8'
        }
    
  • 触发错误的是未混淆、未压缩的Debug构建:
    ...
            debug {
                testCoverageEnabled true
                minifyEnabled false
                shrinkResources false
            }
    ...
    
  • 对比我方应用与新旧Demo的依赖,排查依赖冲突;尝试启用multidex(虽非必要),问题仍未解决。

目前难以定位问题,恳请提供排查思路或解决方案。注:已向第三方反馈但暂未得到有效解决。

内容的提问来源于stack exchange,提问作者4gus71n

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.06.15 08:52:22