Skip to content

Received status code 403 from server: Forbidden #2

@cesarferreira

Description

@cesarferreira

Hi, thanks for your article, it was very enlightening!

Yet, I bumped into something. This is the repo: https://github.com/cesarferreira/android-unique-device-id

I'm trying to upload the github package, I followed your guide and it looks like i'm doing everything right but i keep getting this error:

~/code/github/android-unique-device-id master
❯ ./gradlew assembleRelease publish
> Task :android-unique-device-id:publishBarPublicationToGitHubPackagesRepository FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':android-unique-device-id:publishBarPublicationToGitHubPackagesRepository'.
> Failed to publish publication 'bar' to repository 'GitHubPackages'
> Could not PUT 'https://maven.pkg.github.com/cesarferreira/android-unique-device-id/cesarferreira/android-unique-device-id/0.0.1/android-unique-device-id-0.0.1.aar'. Received status code 403 from server: Forbidden

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 4s
59 actionable tasks: 3 executed, 56 up-to-date

my build gradle: https://github.com/cesarferreira/android-unique-device-id/blob/master/android-unique-device-id/build.gradle

def getArtifactId = { ->
  return "android-unique-device-id"
}

publishing {
	publications {
		bar(MavenPublication) {
			groupId 'cesarferreira'
			version "0.0.1"
			artifactId getArtifactId()
			artifact("$buildDir/outputs/aar/${getArtifactId()}-release.aar")
		}
}

repositories {
	maven {
		name = "GitHubPackages"
		url = uri("https://maven.pkg.github.com/cesarferreira/android-unique-device-id")
		credentials {
			username = System.getenv("GITHUB_USER")
			password = System.getenv("GITHUB_TOKEN")
		}
	}
}

I even made a token with ALL permissions to see if those basic permissions weren't enough.

I made sure that the environment variables are there.

Does anything stand out to you that I'm missing?
Thanks in advance!

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions