MicrosoftDocs / azure-docs

Open source documentation of Microsoft Azure
https://docs.microsoft.com/azure
Creative Commons Attribution 4.0 International
10.28k stars 21.46k forks source link

Android Azure notification hub SDK is not working in Android Pie #14718

Closed Prashanthlkv closed 6 years ago

Prashanthlkv commented 6 years ago

Android Azure notification hub SDK is not working in Android Pie. Below are the SDK details: Mavel url: "http://dl.bintray.com/microsoftazuremobile/SDK" Dependencies: compile 'com.microsoft.azure:notification-hubs-android-sdk:0.4@aar' compile 'com.microsoft.azure:azure-notifications-handler:1.0.1@aar'

Steps to reproduce:

  1. Receive GCM/FCM token
  2. Create instance of NotificationHub
  3. Call method "registerTemplate" using the instance of NotificationHub along with the required parameters.

Error:

Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/net/http/AndroidHttpClient; at com.microsoft.windowsazure.messaging.Connection.executeRequest(Connection.java:217) at com.microsoft.windowsazure.messaging.Connection.executeRequest(Connection.java:178) at com.microsoft.windowsazure.messaging.Connection.executeRequest(Connection.java:134) at com.microsoft.windowsazure.messaging.NotificationHub.refreshRegistrationInformation(NotificationHub.java:296) at com.microsoft.windowsazure.messaging.NotificationHub.registerInternal(NotificationHub.java:390) at com.microsoft.windowsazure.messaging.NotificationHub.registerTemplate(NotificationHub.java:196)

Required Fix: The SDK uses AndroidHttpClient for network operations, this API is deprecated in Android 6 and removed completely in Android 9. Could you guys please update the SDK with the fix?

Also I have posted this issue in stack overflow: https://stackoverflow.com/questions/52247151/android-azure-notification-hub-sdk-is-not-working-in-android-pie


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Karishma-Tiwari-MSFT commented 6 years ago

@Prashanthlkv Thanks for your question. Can you please share the url of the doc, if there is a particular Azure doc you have been following?

Prashanthlkv commented 6 years ago

@Karishma-Tiwari-MSFT Below is the Azure doc which I have followed. https://docs.microsoft.com/en-us/azure/notification-hubs/notification-hubs-android-push-notification-google-gcm-get-started

BryanTrach-MSFT commented 6 years ago

@Prashanthlkv We will be closing this as a duplicate of MSDN forum post: https://social.msdn.microsoft.com/Forums/en-US/07adf107-8392-455c-8f54-6f5c98efab02/android-azure-notification-hub-sdk-is-not-working-in-android-pie?forum=notificationhubs