microsoftconnect / ms-intune-app-sdk-android

Intune App SDK for Android enables data protection features and mobile app management via Microsoft Intune
45 stars 18 forks source link

Always retrieved Status NOT_LICENSED #158

Closed Amrender-Singh closed 1 year ago

Amrender-Singh commented 1 year ago

have integrated MAM SdK 8.0 + in my android application. I have performed all the steps mentioned in Microsoft documentation. I always getting the following error: Received MAM enrollment result for package : NOT_LICENSED. I have also attached complete stack trace. I have checked my configurations, I have all the required licenses assigned to the registered application as well.

2023-03-10 13:14:06.825 16328-16328/com.iongroup.example I/MAMInfo: Agent config file does not exist 2023-03-10 13:14:06.827 16328-16328/com.iongroup.example I/MAMInfo: MAMInfo initialized. Debug=true, Agent=PRODUCTION, ManagedDialogDisabled=false, PolicyRequired=false, MultiIdentityEnabled=false, FullBackupContent=true, DataExtractionRules=true, UseDefaultEnrollment=false, ExceptionOnInit=false, Debuggable=true, IsolatedProcessesAllowed=false 2023-03-10 13:14:06.866 16328-16328/com.iongroup.example I/MAMComponents: Not initializing MAM classes because the MDM package is not installed. 2023-03-10 13:14:06.874 16328-16328/com.iongroup.example I/MAMComponents: Not initializing MAM classes because the MDM package is not installed. 2023-03-10 13:14:07.205 16328-16328/com.iongroup.example I/AMEnrollmentStatusCache: No MAM enrollment status found. 2023-03-10 13:14:07.214 16328-16328/com.iongroup.example I/AMEnrollmentStatusCache: No MAM enrollment status found. 2023-03-10 13:14:07.802 16328-16427/com.iongroup.example W/ongroup.exampl: Verification of void com.microsoft.intune.mam.policy.MAMWEAccountRegistry.() took 115.559ms (77.88 bytecodes/s) (1496B approximate peak alloc) 2023-03-10 13:14:07.881 16328-16434/com.iongroup.example I/lineMAMWERetryScheduler: task thread waiting for tasks. 2023-03-10 13:14:07.950 16328-16427/com.iongroup.example I/lineMAMWERetryScheduler: scheduling any necessary enrollment retries at startup; online: false 2023-03-10 13:16:34.786 16328-16328/com.iongroup.example I/MAMWEAccountRegistry: getAccountInfo() called for account that is not registered: monika@kapteijnsgil.onmicrosoft.com 2023-03-10 13:16:34.787 16328-16328/com.iongroup.example I/MAMWEAccountRegistry: registering account monika@kapteijnsgil.onmicrosoft.com 2023-03-10 13:16:34.797 16328-16328/com.iongroup.example I/ineMAMEnrollmentManager: attempting MAM-WE V2 enrollment for: monika@kapteijnsgil.onmicrosoft.com 2023-03-10 13:16:34.799 16328-16328/com.iongroup.example I/lineMAMWERetryScheduler: removing any remaining scheduled tasks for monika@kapteijnsgil.onmicrosoft.com 2023-03-10 13:16:37.489 16328-17059/com.iongroup.example I/AMEnrollmentStatusCache: Cached MAM Service URLs are not using latest certs, clearing them. 2023-03-10 13:16:37.492 16328-17059/com.iongroup.example I/AMEnrollmentStatusCache: Clearing cached MAM service URLs 2023-03-10 13:16:37.547 16328-17059/com.iongroup.example I/neMAMServiceLookupCache: No MAM Service URL found in the cache for user monika@kapteijnsgil.onmicrosoft.com 2023-03-10 13:16:38.305 16328-17059/com.iongroup.example I/iceLookupOperationsImpl: Retrieved lookup service URL: https://mamservice.manage.microsoft.com/api/Locations 2023-03-10 13:16:38.358 16328-17059/com.iongroup.example I/iceLookupOperationsImpl: Querying lookup service with URL: https://mamservice.manage.microsoft.com/api/Locations activity id: {8E65335F-2508-49DA-A095-08DE9B7F522D} 2023-03-10 13:16:41.510 16328-17059/com.iongroup.example I/iceLookupOperationsImpl: Lookup Service returned response: {"AccountId":"b07b549b-9007-485a-ae4f-52e2dab4af24","Services":{"ServiceName":"mam.api.application","Url":"[https://mamservice.manage.microsoft.com/proxy/StatelessApplicationManagementService"},{"ServiceName":"user.lookup","Url":"https://mamservice.manage.microsoft.com/userlookup/isusergone"},{"ServiceName":"mam.api.userstatus","Url":"https://mamservice.manage.microsoft.com/api/userstatus/"},{"ServiceName":"service.aria","Url":"https://eu-mobile.events.data.microsoft.com"},{"ServiceName":"service.powerlift","Url":"https://eu.alchemy.microsoft.com"}]} 2023-03-10 13:16:41.514 16328-17059/com.iongroup.example I/iceLookupOperationsImpl: found service mam.api.application with URL https://mamservice.manage.microsoft.com/proxy/StatelessApplicationManagementService 2023-03-10 13:16:41.515 16328-17059/com.iongroup.example I/iceLookupOperationsImpl: found service user.lookup with URL https://mamservice.manage.microsoft.com/userlookup/isusergone 2023-03-10 13:16:41.517 16328-17059/com.iongroup.example I/iceLookupOperationsImpl: found service mam.api.userstatus with URL https://mamservice.manage.microsoft.com/api/userstatus/ 2023-03-10 13:16:41.534 16328-17059/com.iongroup.example I/AMEnrollmentStatusCache: Recording MAM service URL: mam.api.application: https://mamservice.manage.microsoft.com/proxy/StatelessApplicationManagementService for: monika@kapteijnsgil.onmicrosoft.com 2023-03-10 13:16:41.536 16328-17059/com.iongroup.example I/AMEnrollmentStatusCache: Recording MAM service URL: service.powerlift: https://eu.alchemy.microsoft.com/ for: monika@kapteijnsgil.onmicrosoft.com 2023-03-10 13:16:41.537 16328-17059/com.iongroup.example I/AMEnrollmentStatusCache: Recording MAM service URL: service.aria: https://eu-mobile.events.data.microsoft.com/ for: monika@kapteijnsgil.onmicrosoft.com 2023-03-10 13:16:41.539 16328-17059/com.iongroup.example I/AMEnrollmentStatusCache: Recording MAM service URL: mam.api.userstatus: https://mamservice.manage.microsoft.com/api/userstatus/ for: monika@kapteijnsgil.onmicrosoft.com 2023-03-10 13:16:41.540 16328-17059/com.iongroup.example I/AMEnrollmentStatusCache: Recording MAM service URL: user.lookup: https://mamservice.manage.microsoft.com/userlookup/isusergone for: monika@kapteijnsgil.onmicrosoft.com 2023-03-10 13:16:41.559 16328-17059/com.iongroup.example I/.MAMServiceLookupThread: MAM Service URL: https://mamservice.manage.microsoft.com/proxy/StatelessApplicationManagementService 2023-03-10 13:16:42.618 16328-17059/com.iongroup.example E/iceLookupOperationsImpl: Failed to get JSON response from MAM Service; activity id: {332E3D54-443C-4716-B093-BDD94608EF57}; status = 400 Bad Request 2023-03-10 13:16:42.626 16328-17059/com.iongroup.example I/AMEnrollmentStatusCache: Recording offline MAM enrollment result: NOT_LICENSED for identity monika@kapteijnsgil.onmicrosoft.com 2023-03-10 13:16:42.641 16328-17059/com.iongroup.example I/MAMWEAccountRegistry: updating account monika@kapteijnsgil.onmicrosoft.com with status NOT_LICENSED

soundar24 commented 1 year ago

@Amrender-Singh I faced the similar issue recently, the reason for that issue is in my device I already logged-in with other email as well. For that reason when I sign-in with new email I always get the NOT_LICENSED status.

If that is the case then try the below steps:

  1. go to Settings > Apps & notifications > Select your app
  2. the App info will be opened, there select the "Storage & cache" and "Clear storage".
  3. do the same for "Company Portal" app as well
  4. and then go to Settings > Accounts, there you will see the Work account, remove that as well
  5. now try the fresh login again, now the status become "ENROLLMENT_SUCCEEDED"
bannus commented 1 year ago

Not enough information to investigate. If issue is still occurring, please re-open a new issue and complete the issue template.