开发者社区> 问答> 正文

应用研发平台EMAS热修复的时候 闪退 是app必须要签名后再测试吗?

mode = 0, code = 1, info = load success, handlePatchVersion = -1
应用研发平台EMAS热修复的时候 闪退
是app必须要签名后再测试吗?
完整日志:
07-10 15:49:49.274 21238 21238 E AndroidRuntime: Process: com.sinochem.argcx.hotfix, PID: 21238
07-10 15:49:49.274 21238 21238 E AndroidRuntime: java.lang.VerifyError: Verifier rejected class com.sinochem.argcx.hotfix.test.SimpleActivity: void com.sinochem.argcx.hotfix.test.SimpleActivity.handlerTag0(java.lang.String, java.lang.String) failed to verify: void com.sinochem.argcx.hotfix.test.SimpleActivity.handlerTag0(java.lang.String, java.lang.String): [0x56] 'this' argument 'Precise Reference: com.sinochem.argcx.hotfix.test.ErrorHotfix' not instance of 'Reference: com.sinochem.argcx.hotfix.test.ErrorHotfix' (declaration of 'com.sinochem.argcx.hotfix.test.SimpleActivity' appears in /data/app/com.sinochem.argcx.hotfix-iR37zP979RWfDmCx-ggyWw==/base.apk!classes4.dex)
07-10 15:49:49.274 21238 21238 E AndroidRuntime: at java.lang.Class.newInstance(Native Method)
07-10 15:49:49.274 21238 21238 E AndroidRuntime: at android.app.AppComponentFactory.instantiateActivity(AppComponentFactory.java:95)
07-10 15:49:49.274 21238 21238 E AndroidRuntime: at androidx.core.app.CoreComponentFactory.instantiateActivity(CoreComponentFactory.java:45)
07-10 15:49:49.274 21238 21238 E AndroidRuntime: at android.app.Instrumentation.newActivity(Instrumentation.java:1251)
07-10 15:49:49.274 21238 21238 E AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3223)
07-10 15:49:49.274 21238 21238 E AndroidRuntime: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3460)
07-10 15:49:49.274 21238 21238 E AndroidRuntime: at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
07-10 15:49:49.274 21238 21238 E AndroidRuntime: at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
07-10 15:49:49.274 21238 21238 E AndroidRuntime: at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
07-10 15:49:49.274 21238 21238 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2047)
07-10 15:49:49.274 21238 21238 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:107)
07-10 15:49:49.274 21238 21238 E AndroidRuntime: at android.os.Looper.loop(Looper.java:224)
07-10 15:49:49.274 21238 21238 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:7590)
07-10 15:49:49.274 21238 21238 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
07-10 15:49:49.274 21238 21238 E AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)
07-10 15:49:49.274 21238 21238 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)

展开
收起
2401。 2023-07-16 18:13:34 41 0
2 条回答
写回答
取消 提交回答
  • 根据提供的日志,出现了一个java.lang.VerifyError错误。该错误表明在验证类com.sinochem.argcx.hotfix.test.SimpleActivity时发生了问题,具体是因为SimpleActivity.handlerTag0方法中的参数不匹配。

    其中有一行错误消息是:[0x56] 'this' argument 'Precise Reference: com.sinochem.argcx.hotfix.test.ErrorHotfix' not instance of 'Reference: com.sinochem.argcx.hotfix.test.ErrorHotfix'。从错误消息可以推断,SimpleActivity.handlerTag0方法的this参数应该是com.sinochem.argcx.hotfix.test.ErrorHotfix类型的实例,但实际传递进来的却不是。

    这个问题可能与热修复机制有关。根据提供的信息,模式(mode)为0表示热修复,代码(code)为1表示加载成功,而handlePatchVersion为-1。

    关于您的问题,是否必须对应用进行签名后才能进行测试,这取决于具体的情况。通常情况下,应用需要签名后才能在设备上进行正式安装和运行。然而,在开发和测试过程中,可以使用调试证书进行签名,并在开发设备或模拟器上进行测试。确保您正在使用正确的证书和签名方式来构建和安装应用程序。

    要解决这个闪退问题,可以尝试以下几步:

    1. 检查热修复框架的配置是否正确,确保所有必要的文件和依赖项已正确设置。

    2. 检查热修复补丁的版本号handlePatchVersion是否正确,并与当前应用的版本相匹配。

    3. 确认应用程序的签名配置是否正确,尤其是在进行热修复测试时使用的证书和签名方式。

    4. 检查SimpleActivity.handlerTag0方法的参数传递方式,确保传递的this参数是com.sinochem.argcx.hotfix.test.ErrorHotfix类型的实例。

    2023-07-16 20:53:29
    赞同 展开评论 打赏
  • 北京阿里云ACE会长

    EMAS热修复在加载补丁包时提示“load success”,但是在运行时出现了闪退的问题。这种问题可能与app的签名有关,但并不一定要签名后才能进行测试。

    下面是一些可能导致热修复闪退的原因和解决方法:

    补丁包版本不对应:热修复的补丁包需要与app的版本对应,否则可能会出现闪退等问题。请确保补丁包版本正确,并且已经发布到对应的app版本上。

    代码逻辑错误:如果补丁包中存在代码逻辑错误或者不兼容的API调用,可能会导致闪退等问题。建议您仔细检查补丁包中的代码,并进行测试和调试。

    签名不匹配:如果app的签名与补丁包的签名不匹配,可能会导致热修复无法正常运行。请确保补丁包和app使用相同的签名文件,并使用相同的签名配置进行签名。

    运行时权限不足:如果补丁包需要访问敏感权限或者系统API,但是app没有相应的权限或者被系统禁止访问,可能会导致闪退等问题。请确保app具有必要的权限,并在补丁包中进行相应的权限申请和处理。

    2023-07-16 18:25:11
    赞同 展开评论 打赏
来源圈子
更多
收录在圈子:
基于阿里巴巴以及合作伙伴的最佳实践,围绕大前端、云原生领域的相关技术热点(小程序、Serverless、应用中间件、低代码、DevOps)展开行业探讨,与开发者一起探寻云原生时代应用研发的新范式。
相关文档: 移动研发平台
问答排行榜
最热
最新

相关电子书

更多
移动互联网测试到质量的转变 立即下载
给ITer的技术实战进阶课-阿里CIO学院独家教材(四) 立即下载
F2etest — 多浏览器兼容性测试整体解决方案 立即下载