Google Credential:此开发者帐户不拥有该应用程序 [英] Google Credential: This developer account does not own the application

查看:154
本文介绍了Google Credential:此开发者帐户不拥有该应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Google客户端库并试图向Google Play API发送 GET 请求。

 GoogleCredential凭证=新的GoogleCredential.Builder()。setTransport(netHttpTransport)
.setJsonFactory(jacksonFactory)
.setServiceAccountId(CLIENT_ID)
.setServiceAccountScopes(SCOPE)
.setServiceAccountPrivateKeyFromP12File(file)
.build();
credential.refreshToken();
HttpRequestFactory requestFactory = netHttpTransport.createRequestFactory(凭证);
GenericUrl url = new GenericUrl(URI);
HttpRequest request = requestFactory.buildGetRequest(url);
HttpResponse response = request.execute();

我得到

  {
code:401,
errors:[{
domain:androidpublisher,
message: ,
reason:developerDoesNotOwnApplication
}],
message:此开发人员帐户不拥有该应用程序。
}

我的应用程序未发布,会导致问题吗?

解决方案

我遇到了同样的问题。这是因为您在Google API中授权用户不拥有应用程序并尝试获取属于您的应用程序的数据。



在本主题中对其进行了很好的描述。 http ://support.google.com/googleplay/android-developer/bin/answer.py?hl = zh-CN& answer = 2528691& topic = 16285& ctx = topic

您应该通过OAuth2授权应用程序的所有者,然后使用Google API和获取的令牌。


I'm using Google client libraries and trying to make a GET request to Google Play API.

        GoogleCredential credential= new GoogleCredential.Builder().setTransport(netHttpTransport)
                .setJsonFactory(jacksonFactory)
                .setServiceAccountId(CLIENT_ID)
                .setServiceAccountScopes(SCOPE)
                .setServiceAccountPrivateKeyFromP12File(file)
                .build();
                credential.refreshToken();     
        HttpRequestFactory requestFactory =netHttpTransport.createRequestFactory(credential);
        GenericUrl url = new GenericUrl(URI);
        HttpRequest request = requestFactory.buildGetRequest(url);
        HttpResponse response = request.execute();

I get

 {
  "code" : 401,
  "errors" : [ {
    "domain" : "androidpublisher",
    "message" : "This developer account does not own the application.",
    "reason" : "developerDoesNotOwnApplication"
  } ],
  "message" : "This developer account does not own the application."
}

My app is unpublished, would that cause the problem?

解决方案

I've got the same problem. It occurs because you authorize user in Google API who does not own the application and try to get data that belong to your app.

In this topic it is well described. http://support.google.com/googleplay/android-developer/bin/answer.py?hl=en&answer=2528691&topic=16285&ctx=topic

You should authorize by OAuth2 the owner of application, and then use Google API with obtained token.

这篇关于Google Credential:此开发者帐户不拥有该应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆