2

Environment:

  • Android Studio
  • hwid: 5.2.0.300
  • CI

Problem Describe:

After we integrate latest Huawei SDK, our CI failed since Android Test is not pass.
And we dig into the report a bit, it gives us this error in stack trace:

org.bouncycastle.pqc.crypto.qtesla.QTeslaKeyEncodingTests > testDecodeEncodePublicKeyQT3P[V1836A - 10] FAILED 
        java.lang.NullPointerException
        at java.io.Reader.<init>(Reader.java:78)

org.bouncycastle.pqc.crypto.qtesla.QTeslaKeyEncodingTests > testDecodeEncodePrivateKeyQT3P[V1836A - 10] FAILED 
        java.lang.NullPointerException
        at java.io.Reader.<init>(Reader.java:78)

Which this error is introduced by com.huawei.hms:hwid:5.2.0.300.
So no doubt, if you integrate hwid:5.2.0.300, it will fail your unit test along with your CI/CD.

Problem Reason:

After we look deeper, huawei SDK introduced org.bouncycastle:bcpkix-jdk15on:1.64 as dependence, which in this version, they include unit test to their library by mistake, and it fixed in 1.65.
Check https://github.com/bcgit/bc-java/issues/661
So I kindly ask Huawei upgrade org.bouncycastle:bcpkix-jdk15on to 1.65 or above in your dependence. It's one-job if you have the code base.

Hack Solution:

In order to make our CI work as expected, now we are doing this, if anyone else has the same issue:

dependencies {
    // ......... something else what we need 
    huaweiApi ('com.huawei.hms:hwid:5.2.0.300') {
        // Huawei include org.bouncycastle 1.64 version
        // In this version, the source code include unit test file in library, which will cause our CI Fail.
        exclude group: 'org.bouncycastle', module: "bcprov-jdk15on"
    }
    huaweiApi 'org.bouncycastle:bcpkix-jdk15on:1.65'
}
zhangxaochen
  • 32,744
  • 15
  • 77
  • 108
Kael luo
  • 79
  • 1
  • 5
  • Sorry@Kael luo,The R&D team confirmed that this is a new issue and will be optimized in later versions. Thank you for your feedback.- – zhangxaochen Apr 13 '21 at 08:30
  • 1
    @shirley Thank you for the quick reply, and looking forward the fix. Awesome team. – Kael luo Apr 13 '21 at 09:39

1 Answers1

1

As team confirmed,The latest Account SDK version has been updated to 5.3.0.301. In this version, the introduced org.bouncycastle:bcpkix-jdk15on is removed. You can also integrate the latest Account SDK version into your project.

For more detail about 5.3.0.300 New Features,pls kindly refer https://developer.huawei.com/consumer/en/doc/development/HMSCore-Guides/version-change-history-0000001050048874?ha_source=hms1

zhangxaochen
  • 32,744
  • 15
  • 77
  • 108