AlexaAndroid
AlexaAndroid copied to clipboard
API Key does not exist or is incorrect
I know the API_key.txt is in the correct spot and I can view it in android studios. I know this is the correct code. It is the correct MD5 and SHA256 as far as I know and the correct package name. I could use f=some help and would be happy to provide any more information that you may deem necessary to help. Here is my logcat after launching the app on an emulatore:
08-03 10:20:30.100 3822-3822/? E/AuthorizationHandler: Unable to Use Amazon Authorization Manager. APIKey is incorrect or does not exist. Does assets/api_key.txt exist in the main application?
java.lang.IllegalArgumentException: Invalid API Key
at com.amazon.identity.auth.device.authorization.api.AmazonAuthorizationManager.
Are you using a debug keystore or a release keystore?
@ihavenoface5 How can I check that? Sorry I'm somewhat new.
No worries. When you generated your MD5 / SHA256 key you specified a keystore file. This keystore is used to sign your APK file.
You built your APK file by either:
- Selecting build APK (or the play button in Android Studio). This will use the debug keystore.
- Selecting generate signed APK which will build an APK signed with a keystore you specify.
@ihavenoface5 Gotcha.. I actually ran these lines of code in a terminal: keytool -genkey -v -keystore keystore.jks -alias androiddebugkey -keyalg RSA -sigalg SHA1withRSA -keysize 2048 -validity 10000
keytool -list -v -alias androiddebugkey -keystore keystore.jks
I have checked in android studios via gradle signing report and got the same MD5 and SHA 256.
Double check a couple of things:
- Your package name matches what you used in your security profile.
- Your product ID matches the one you used when registering your Amazon product on the developer console.
PRODUCT_ID = "interactive_conversation" should be set to the product name you specified.
@ihavenoface5 The package name under the API Key name on amazon is com.willblaschko.android.alexavoicelibrary
I have switched two instances of Product_ID to my devices product ID. Are there any more?
Nope, that should be it.
still getting the same error:/
@ihavenoface5 still getting the same error:/