question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Google.Apis.Playcustomapp.v1 returns notAnAdmin - 403

See original GitHub issue

Dear Api Team

I’m trying to push a custom app to my android developer account (does not have any organization), and facing always the notAnAdmin 403 error.

  • The project is set up in the play console.
  • Google Play Custom App Publishing Api is enabled, and shows 100% incoming errors under the logs.
  • A service user has been created, and got “Owner”, “Editor”, “Token creator”, “ServiceAccountUser”, “ServiceAccount-Admin” rights (and added some more while trying) for the project
  • The Project is linked in the API-Access section, the Service Account is shown, access granted, and has Administrator priviliges for the my developer account.
  • The OAuth-Clients guidlines has the publisher right. (Actually everything set.)

The code simply creates a scoped credential from the created json token file:

var credential = GoogleCredential.FromStream(new FileStream("client_secrets.json", FileMode.Open))
                .CreateScoped(PlaycustomappService.Scope.Androidpublisher);

Creates an app metadata and service:

var appMetadata = new CustomApp
{
    Title = "My App",
    LanguageCode = "de_DE",
};

 var service = new PlaycustomappService(new BaseClientService.Initializer()
{
    HttpClientInitializer = credential,
    ApplicationName = "My App",
    BaseUri = "https://www.googleapis.com/"
});

(Here I had to change the BaseUri from “https://playcustomapp.googleapis.com/” to “https://www.googleapis.com/”, because the default one is not working, throws an URI not found exception)

I simply load the apk, create an app with “app.CustomApp.Create(…)”, and try to upload it with “var response = await app.UploadAsync();”

Do you have any idea or suggestion what could be missing?

Thank you for your help in advance!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
jskeetcommented, Jan 18, 2021

Hooray - so glad it’s resolved for you. I’ve filed an internal issue about the BaseUri aspect, so hopefully at some point in the future you won’t need to do that part either.

0reactions
Alea81commented, Jan 18, 2021

Hey,

I figured out the problem, did not create any organisation, wanted to assign it afterwards, and it’s a must, so I’m closing this issue, and thank you for your help!

Best

Read more comments on GitHub >

github_iconTop Results From Across the Web

http status code 403 - Why Google APIs Explorer ...
My solution was to turn on "Additional Google Services" in Google Admin console (Apps > Additional Google Services).
Read more >
Script is getting 403 Forbidden using Custom Search API
I am trying to search Google using Custom Search API with the following Perl script. Strangely, the response with the script is [403...
Read more >
Re: Encountered 403 Forbidden : Service Account ca...
I'm new to Google APIs so My question deals with creating an AWS lambda python integration that will call Google Campaign Manager 360...
Read more >
How to resolve 403 forbidden issue when trying to use ...
When I try to get my app reviews by following Google Android Play API with owner access, it shows me an exception "You...
Read more >
Having Error 403 when consuming Google People API ...
I'm experiencing an error 403. I believe to have done the steps correctly as stated on the pdf file for the said course....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found