asp.net上的AndroidPublisher库出现错误未找到给定包名的应用程序

asp.net上的AndroidPublisher库出现错误未找到给定包名的应用程序,asp.net,google-play,service-accounts,android-developer-api,Asp.net,Google Play,Service Accounts,Android Developer Api,我正在使用Google.api.AndroidPublisher.v2获取inapp产品:列表和inapp购买详细信息。我已在我的应用程序控制台中创建了一个新的服务帐户,并根据需要使用.p12键。这是我的密码: String serviceAccountEmail = "iap-119@abc.iam.gserviceaccount.com"; var fullPath = System.Web.Hosting.HostingEnvironment.MapPath(@"~/App

我正在使用Google.api.AndroidPublisher.v2获取inapp产品:列表和inapp购买详细信息。我已在我的应用程序控制台中创建了一个新的服务帐户,并根据需要使用.p12键。这是我的密码:

String serviceAccountEmail = "iap-119@abc.iam.gserviceaccount.com";
        var fullPath = System.Web.Hosting.HostingEnvironment.MapPath(@"~/App_Data/key.p12");
        var certificate = new X509Certificate2(fullPath, "notasecret", X509KeyStorageFlags.Exportable);

        ServiceAccountCredential credential = new ServiceAccountCredential(
           new ServiceAccountCredential.Initializer(serviceAccountEmail)
           {
               Scopes = new[] { "https://www.googleapis.com/auth/androidpublisher" }
           }.FromCertificate(certificate));


        var service = new AndroidPublisherService(
           new BaseClientService.Initializer()
           {

               ApplicationName = "abc",
               HttpClientInitializer = credential
           });
        var request = service.Inappproducts.List("com.Its.abc");
        var purchaseState = request.Execute();
我在请求时收到以下错误。Execute(); 消息[找不到给定包名的应用程序。]位置[packageName-参数]原因[applicationNotFound]域[global]

但是,我的包名是正确的,相同的包名上传到play store上


谢谢,

我找到了解决办法。需要在Google Play控制台的“API访问”页面上添加服务帐户作为链接帐户。还可以在开发者控制台中以具有所需权限的用户身份添加服务帐户电子邮件。

“找不到给定软件包名称的应用程序”。当应用程序从Google Play暂停(即删除)时,也可能会出现404(如
Google.api.Requests.RequestError
)。