Dear all,
I am facing a problem with api invalid key. Please find below error
2025-08-26 10:35:37.741 28148-28232 ArcGIS Runtime com.example.app E ArcGIS Maps SDK Invalid API Key Error: The API key '*n8tBv' is invalid, expired, or does not have access to the resource 'https://basemapstyles-api.arcgis.com/arcgis/rest/services/styles/v2/webmaps/arcgis/topographic'. Please visit https://developers.arcgis.com/documentation/security-and-authentication/api-key-authentication/how-t... for details on how to configure the API key to access the resource, or how to create a new API key.
Did it work before? If the password for the account that created the key has changed then I believe you need to create a new key (maybe create a new key anyway to check). Otherwise I think more information would be beneficial.
@UsmanAslam there is not enough information in your post to determine what the issue may be but it most likely is an expired API key. Log in with your account and make sure your account is in good standing. The easiest way to test is to create a new API key with your required privileges scope, set no referrers, and substitute that in your app and try it there. You can also use one of the demo apps in CodePen if you want to try it using JavaScript in the browser for a quick test. if the new key works then most likely your old key is not longer valid and needs to be replaced.