Replies: 2 comments 2 replies
-
Hi! Thanks for providing such a well-detailed description — this helps a lot in narrowing down the problem. 🔍 Quick Summary of the IssueYou're using GitHub Packages (Maven registry) to publish an Android library to a public GitHub repository under an organization, and trying to let non-affiliated public users consume it via a PAT with ✅ Key Points to Check and Resolve1. Access Rules for GitHub Packages in OrganizationsEven if the repository is public, GitHub Packages under an organization still requires authentication via PAT, even for read access.
2. Organization Settings Might Be the Real BlockerGo to your GitHub organization’s settings:
3. PAT Must Be for a User with at Least Read Access to the RepoEven though the package is public, the Maven registry still requires credentials. Make sure:
4. Use This Gradle Block CarefullyMake sure this part of your
🧪 Optional Debug Tips
✅ Recommended Fix Summary
Let me know if you'd like help testing with a minimal repo setup or sharing a sample Happy to help debug further if needed! |
Beta Was this translation helpful? Give feedback.
-
🕒 Discussion Activity Reminder 🕒 This Discussion has been labeled as dormant by an automated system for having no activity in the last 60 days. Please consider one the following actions: 1️⃣ Close as Out of Date: If the topic is no longer relevant, close the Discussion as 2️⃣ Provide More Information: Share additional details or context — or let the community know if you've found a solution on your own. 3️⃣ Mark a Reply as Answer: If your question has been answered by a reply, mark the most helpful reply as the solution. Note: This dormant notification will only apply to Discussions with the Thank you for helping bring this Discussion to a resolution! 💬 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Select Topic Area
Question
Body
I am developing an Android library module that I published to my organization's public repository successfully months ago. Following an implementation guide for Gradle where we attempt to implement this module in another Android app in Android Studio through the use of Github Packages and a PAT with read:packages scope permission and no authorization to the organization on Github; basically a public non-affliate who wants to download and use my module. That same person is unable to resolve the dependency; attempting to find the reason with './gradlew build' in Terminal shows that they received a 403 code Forbidden from the server. This shouldn't be the case from what I understand though: the package is scoped to its repository(Gradle or Maven registry is repository scoped only with Github Packages if I recall correctly) and the repository is a public one, albeit belonging to an Organization that required authenticating a PAT with write permissions for its developers like myself. Am I missing anything from the below implementation for that person to successfully resolve the dependency in their Android app?
libs.version.toml (unrelated dependencies are omitted in this sample code)
`[versions]
moduleVersion = "1.3.0"
[libraries]
groupid-artifactid = { group = "groupid", name = "artifactid", version.ref = "moduleVersion" }
[plugins]
android-application = { id = "com.android.application", version.ref = "agp" }
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
kotlin-compose = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }`
settings.gradle.kts
dependencyResolutionManagement { repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) repositories { google() mavenCentral() maven { url = uri("https://maven.pkg.github.com/organization_name/repository_name") credentials { username = "github_user" password = "github_PAT" } } } }
build.gradle.kts (app module) (unrelated dependencies again omitted)
dependencies { implementation(libs.groupid.artifactid) }
Below is what is returned when running ./gradlew build command in terminal
FAILURE: Build failed with an exception.
Execution failed for task ':app:checkDebugAarMetadata'.
BUILD FAILED in 2s
1 actionable task: 1 executed
Any explanations, tips, and or solutions would be greatly appreciated as this is a roadblock for my team to proceed. Thank you.
Beta Was this translation helpful? Give feedback.
All reactions