question

RajaReddy avatar image
RajaReddy asked

Getting error in creating ADM ?

I am creating push notifications ( Amazon Device Messages ) for my application, i am getting this 08-07 12:04:12.390: E/ADMSampleMessenger(1756): SampleADMMessageHandler:onRegistrationError INVALID_SENDER i have api key in assets folder. what will be the problem. any body can solve my issue?
mobile ads
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Sujoy@Amazon avatar image
Sujoy@Amazon answered
Hi Polamreddy, I have checked your account that you have defined and app named "Testing" and a security profile named "push". But you did not associate the ADM settings of your app to the Security profile "push". So you have to go to ADM settings of the app in distribution portal and select the security profile for it (you may select "push" as a security profile for your app "Testing"). I also saw you have not created any api key for the profile "push". Select "push" profile and then select "API Keys" tab. You have to add the package name and and MD5 hash of your certificate you are using to sign the apk in order to get api key. After receiving it you should keep it in the assets/ api_key.txt file. It should work. I was wondering the api key you have copied in the assets folder, how did you get it?
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

RajaReddy avatar image
RajaReddy answered
Here i will explain what i am doing. I am the developer here, i am not the main publisher of the application in amazon store, my lead created application in amazon developer console and gave me a api key . i am using that api at present. he was using one account for publishing application. i am using my account for testing in kindle emulator. Is it required to use same account for both publishing and testing ADM ? can you explain me a proper way to solve this issue ?
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Sujoy@Amazon avatar image
Sujoy@Amazon answered
Hi Polamreddy, No. You can use your developer account for testing purpose. In the account you have created the app for testing ADM, you should go to ADM settings of that app and associate a security profile with that. In the same security profile you should create an api key by registering the package name of your app and the MD5 hash of the certificate you are using to sign your apk. You are supposed to keep that api key in the assets/ api_key.txt file in you your android project. And then call startRegister() of ADM instance in the code (preferably in onCreate()), it should work. Please verify whether you are doing this or not in your project. Please follow below links for better understanding. https://developer.amazon.com/sdk/adm/credentials.html https://developer.amazon.com/sdk/adm/integrating-app.html#Asset Please let us know whether your problem is solved or not. Thanks.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

RajaReddy avatar image
RajaReddy answered
No, my problem not solved yet. I am doing same thing what you explained in documentation. see here i will explain again I have created one application that was available in Amazon APP-SDK ( ADMMessenger ). created MD5 from my system and send to my team lead. i was created app in amazon store and enabled ADM in that application and package name along with MD5 it creates api key. i am using that api key ( in assets folder api_key.txt ) in my application for testing ADM. i gave all the permissions in manifest file. when i run the application i am getting this error. Is there any problems in process, please solve my issue i am stuck at this from last 2 days.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

RajaReddy avatar image
RajaReddy answered
And also i am facing one more problem along with this. when i add jar file libs folder i am getting this error 08-08 15:27:23.165: E/AndroidRuntime(16464): FATAL EXCEPTION: main 08-08 15:27:23.165: E/AndroidRuntime(16464): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.bitrhymes.kindlepush/com.bitrhymes.kindlepush.MainActivity}: java.lang.RuntimeException: Stub! 08-08 15:27:23.165: E/AndroidRuntime(16464): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2067) 08-08 15:27:23.165: E/AndroidRuntime(16464): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2092) 08-08 15:27:23.165: E/AndroidRuntime(16464): at android.app.ActivityThread.access$600(ActivityThread.java:126) 08-08 15:27:23.165: E/AndroidRuntime(16464): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1172) 08-08 15:27:23.165: E/AndroidRuntime(16464): at android.os.Handler.dispatchMessage(Handler.java:99) 08-08 15:27:23.165: E/AndroidRuntime(16464): at android.os.Looper.loop(Looper.java:137) 08-08 15:27:23.165: E/AndroidRuntime(16464): at android.app.ActivityThread.main(ActivityThread.java:4586) 08-08 15:27:23.165: E/AndroidRuntime(16464): at java.lang.reflect.Method.invokeNative(Native Method) 08-08 15:27:23.165: E/AndroidRuntime(16464): at java.lang.reflect.Method.invoke(Method.java:511) 08-08 15:27:23.165: E/AndroidRuntime(16464): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784) 08-08 15:27:23.165: E/AndroidRuntime(16464): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551) 08-08 15:27:23.165: E/AndroidRuntime(16464): at dalvik.system.NativeStart.main(Native Method) 08-08 15:27:23.165: E/AndroidRuntime(16464): Caused by: java.lang.RuntimeException: Stub! 08-08 15:27:23.165: E/AndroidRuntime(16464): at com.amazon.device.messaging.ADM. (Unknown Source) 08-08 15:27:23.165: E/AndroidRuntime(16464): at com.bitrhymes.kindlepush.MainActivity.register(MainActivity.java:177) 08-08 15:27:23.165: E/AndroidRuntime(16464): at com.bitrhymes.kindlepush.MainActivity.onCreate(MainActivity.java:53) 08-08 15:27:23.165: E/AndroidRuntime(16464): at android.app.Activity.performCreate(Activity.java:4635) 08-08 15:27:23.165: E/AndroidRuntime(16464): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049) 08-08 15:27:23.165: E/AndroidRuntime(16464): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2031) 08-08 15:27:23.165: E/AndroidRuntime(16464): ... 11 more when add that jar file in java build path not getting this error why ? according to new andorid ADK we have to add jar files in libs folder only. look at this problem also ..
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Bipin@Amazon avatar image
Bipin@Amazon answered
The jar scope has to Provided.The jar is already provided in the platform and the jar given in the SDK is used only for compiling. As they have no implementation and is only empty stub for successfully compiling. Don't add the jar in the final binary while creating a apk.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

rajareddyp avatar image
rajareddyp answered
That error i solved. now i am facing problem with making extension for android using adobe flash. even i was created extension successfully there is no call backs are triggering when it is registered.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Sujoy@Amazon avatar image
Sujoy@Amazon answered
Can you make sure that the receiver is defined in the manifest properly? In the ADMMessanger sample app (that comes with the ADM sdk) we have defined the receiver
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

rajareddyp avatar image
rajareddyp answered
I had declared all the permissions and receivers in the manifest file clearly. still callbacks are not working properly..
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Sujoy@Amazon avatar image
Sujoy@Amazon answered
Hi Rajareddyp, Sorry for the late response. Does the problem still exist?
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.