HMS InAppPurchase - IapClient.isEnvReady() fails with StatusCode 6003 - huawei-mobile-services

I'm new to HMS and I'm trying to add IAP to an App.
I followed this documentation and I implemented the purchase of a product, but the App fails at the very beginning.
Just after the call to IapClient.isEnvReady(), it answers to the onFailureListener with StatusCode at 6003 (that is not a value present in OrderStatusCode class)
I'm testing it on a device with HMS Core 4.0.3.316 and AppGallery installed.
The App is linking to
com.huawei.hms:iap:4.0.2.300
Can someone give help to me?
What the StatusCode 6003 means and what can I do?
Thanks

To make it work in debug mode, just copy your kestore file to your app dir and add this to your App Level build.gradle:
signingConfigs {
release {
storeFile file("YOUR_KEYSTORE_FILE.jks")
keyAlias 'YOUR_KEY_ALIAS'
keyPassword 'password1'
storePassword 'password2'
v1SigningEnabled true
v2SigningEnabled true
}
}
buildTypes {
release {
signingConfig signingConfigs.release
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
debug {
signingConfig signingConfigs.release
debuggable true
}
}
The 6003 error is caused by inconsistent certificate fingerprint configurations.
Refer to https://developer.huawei.com/consumer/en/codelab/HMSPreparation/#0
Check the following items:
Ensure that the certificate fingerprint has been configured, and the certificate for packing the signature on the local client is the same as the certificate for configuring the fingerprint in AppGallery Connect.
Check the fingerprint entries in the certificate. It is recommended that you use a single entry.
If the 6003 error persists when you run the local client after the fingerprint is configured, the debug certificate is running by default. Clear the cache of HMS Core and run the client again.

Per HMS In-App Purchases FAQ, error code 6003 means inconsistent certificate fingerprint configurations, please double-check your configuration based on this doc:
https://developer.huawei.com/consumer/en/doc/development/HMSCore-Guides-V5/faq-0000001050033126-V5#EN-US_TOPIC_0000001050033126__section3517123824210
For complete instructions, please refer to this doc -
https://developer.huawei.com/consumer/en/doc/development/HMSCore-Guides-V5/integrating-sdk-0000001050035023-V5#EN-US_TOPIC_0000001050035023__section1552123620451
(4. Configure the app signature.)

Related

Flutter app - Google sign in doesn't work after publishing to PlayStore

I use Firebase authentication with google_sign_in for my CrossPlatform Mobile app that's been developed with Flutter framework.
The problem :
When I press the login button on the published app to log in I get the following exception :
Platformexception(sign_in_failed, com.google.android.gms.common.api.ApiException: 10: , null, null)
Notes :
No problems are visible when I run 'flutter doctor -v'
It works completely well on Ios and on debug / release mode when I run it from my computer on my phone, but the published version is not working. (flutter run, flutter run --release)
I use app signing provided by google
What I've tried so far :
I've already added the app-signing SHA1 and SHA256 keys from Play Store's console and the upload and release keys from my upload-keystore.jks to Firebase APP
I've tried to recreate my Firebase Android app, readding google-service.json
I've added this part to my build.gradle to test if the default shrinking is the problem :
buildTypes {
release {
signingConfig signingConfigs.release
minifyEnabled false
shrinkResources false
}
}
I know this error is most likely relatd to SHA keys, so if somebody could explain which SHA1 & SHA256 Keys should be added and exactly how should I generate them, that would be nice also, just to exclude that possibility completely. Also I'd be grateful for any other insights.

this Eror happen in Generated signed apk

I was creating APK for my flutter project so I followed the below steps to generate a signed APK
Tools -> Flutter -> Open for editing in android studio
Then opened the model in a new window
I got the Gradle sync failed error, After my further investigation I run the command gradlew --warning-mode all in the terminal & I got the below message from gradle
The AbstractArchiveTask.destinationDir property has been deprecated. This is scheduled to be removed in Gradle 7.0. Please use the destinationDirectory property instead.
I also tried org.grdle.wranning=(all,summary,fail,none)
In order to generate a signed APK you don't necessarily have to open your Android project as you described in your issue.
The steps you have to follow are :
1- Create your keystore.
2- Plug this keystore with the android/app/build.gradle file
3- Enable the signing in your release buildType in the android/app/build.gradle file
buildTypes {
release {
signingConfig signingConfigs.release
}
}
This is just an overview of the steps you have to follow.
The full procedure with examples in available on the official docs.flutter.dev website
Don't worry too much about the warning. It only means that you some of the methods used in your build.gradle will be deprecated soon.

Derffered component not splitting apk when signed with release configuration

I have apk of Flutter having size around 700MB (app has local videos, assets). I have uploaded testflight easily as Apple allows 4GB IPA file. Now to handle this issue on Google play console flutter recommend Deferred components
I followed the official documentation but on last step when I run flutter build appbundle
command with signing configuration
buildTypes {
release {
signingConfig signingConfigs.debug
}
}
differed components are separated from base apk , thats good.
but with
buildTypes {
release {
signingConfig signingConfigs.release
}
}
resulting in a deferred library being compiled as part of the base loading unit.
Any help would be appreciated.

how to release flutter app to google play?

I want to release an flutter app for Google play store and I checked every step of in Instruction page of flutter, but every time I got this error:
* What went wrong:Execution failed for task ':app:validateSigningRelease'.> Keystore file not set for signing config release
update: I waw wrong with naming key file :) it was key.propertis an 'e' has been left
You are probably missing the signingConfig for release inside your android/app/build.gradle file. It should look like this:
signingConfigs {
release {
keyAlias 'keyAlias'
keyPassword 'keyPassword'
storeFile file('storeLocation')
storePassword 'storePassword'
}
}
This should be put inside the android section.

Flutter: Your Android App Bundle is signed with the wrong key

I'm new to Flutter. I have created an app and now I'm trying to upload it to google play (Open testing track). Previously, I have uploaded a react-native version of my app. Now I would like to replace it with the flutter version. I have carefully followed the instructions from the official guidelines. No matter what I do, I'm getting the error:
Your Android App Bundle is signed with the wrong key. Ensure that your App Bundle is signed with the correct signing key and try again
I have looked at a number of similar issues on Stackoverflow. I have looked again and again at my app/build.gradle to make sure release mode is selected. I have cleaned every thing with flutter clean then re-generated the bundel (.app) with no success. Here is a portion of my app/build.gradle file:
signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword keystoreProperties['storePassword']
}
}
buildTypes {
release {
signingConfig signingConfigs.release
}
}
I am at lost here, any help would be greatly appreciated. I don't know if the issue is related to the previous react-native artifact I have previously uploaded (which by the way, I can't delete from Google Play Console bundles explorer)