I'm trying to connect Huawei IAP SDK for Inapp payments. After adding an app in developer console and some inapp items, I tried to run Iap.getIapClient(activity).isBillingSupported method, but got com.huawei.hms.support.api.iap.json.IapApiException: 6003 error. Can't get any information about that status code, what does it mean. Does anybody know something about it?
I had the same problem and here is the fix. The error clearly says that 6003
-> StatusCode.CERT_FINGERPRINT_ERROR
. It looks like Huawei can't validate the originality of the app, because of the missing certificate.
You either didn't added agconnect
to your project or you're running in a different build type (like debug, that was my issue because I added agconnect
several days ago).
If you didn't added the agconnect
to your project, make sure you add it. There is an official tutorial how to add it, but here is it in a nutshell:
First of all you need to add the agconnect
dependency to your project, download the agconnect-services.json
file from Huawei's Developer (from your App). You need to obtain a SHA256
fingerprint with keytool
and add this long fingerprint to your Huawei's Developer field.
https://developer.huawei.com/consumer/en/doc/development/HMS-Guides/iap-configuring-appGallery-connect#certificate
If you added agconnect
(like I did several days ago) and the error persisted, it was because you were running in debug
or any other build type which is different than what your official release. If you're running in debug
make sure you add the signing certificate to your debug
build type.
signingConfigs {
release {
storeFile file('C:\\path-to-your\project\signing-certificate.jks')
keyAlias 'aliasOfYourCertificate'
keyPassword 'theKeyPasswordOfCertificate'
storePassword 'theStorePasswordOfCertificate'
}
}
buildTypes {
release {
signingConfig signingConfigs.release
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
debug {
signingConfig signingConfigs.release
}
}
So the key here is adding the signingConfig
to your debug
build type (if you're running in debug).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With