- Authenticate GitHub access with GitHub CLI and clone the private course repository
- Open the repository root in Android Studio instead of a nested module folder
- Understand what the first Gradle sync does and classify its first clear error
Clone the Repo and Open the Project for the First Time
Open the real production app project instead of a toy starter project.
Lesson video is on the way
While you wait, read the full text version below: complete theory, code samples and the hands-on checklist.
Lesson Goals
Students will complete this lesson with:
- a GitHub account that can access the private course repository,
- the course codebase cloned into a clean workspace,
- Android Studio opening the correct project root,
- a clear understanding of what the first Gradle sync is doing.
Before Cloning a Repo on GitHub
Make sure you have:
- GitHub access: You have an account and can see the private repository.
- Git authentication: your computer can clone code from GitHub.
- Project root: Android Studio opens the correct root folder, not a nested module.
Official docs:
Part 1: Confirm GitHub Access in the Browser
If the course invite points to a private GitHub repository, open that link in the browser first.
Check these points before touching the terminal:
- You are signed in to the correct GitHub account used to buy the course.
- The repository page opens and does not return
404. - You can see the green
Codebutton or clone URL.
Part 2: Choose an Authentication Method
There are two common ways to clone:
| Method | When to use it | Example |
|---|---|---|
| HTTPS | Simple default; works well with GitHub CLI or credential manager | https://github.com/org/repo.git |
| SSH | Good if you already know SSH keys and can debug key problems | git@github.com:org/repo.git |
Install GitHub CLI. This helps you avoid copy-pasting personal access tokens into terminal commands.
After installing the CLI, run:
gh --version
gh auth login
gh auth status
Follow the browser login flow. If gh auth status says you are logged in to the correct account, this machine has a clean authentication path.
Do not paste a personal access token into notes, screenshots, Discord, support messages, or shell history.
Part 3: Create a Clean Workspace
Do not clone the course repository into a random download folder. Put it somewhere you will keep throughout the course.
Good example:
mkdir -p ~/Desktop/kotlin/dan-tech-academy
cd ~/Desktop/kotlin/dan-tech-academy
Now clone the repository URL from the course dashboard or GitHub access invite:
git clone <course-repo-url>
Use the exact private repository URL you were granted access to.
If clone fails with Repository not found, check browser access first.
If clone fails because of an authentication prompt, complete GitHub CLI login or credential manager setup, then try again.
Part 4: Open the Correct Android Studio Folder
Android projects usually have many folders. You must open the repository root:
- not the
appfolder, - not
feature, - not
core, - not a nested module.
The root folder should contain files/folders similar to:
settings.gradle.kts
build.gradle.kts
...
If you do not see settings.gradle.kts, stop. You are probably in the wrong folder.
Open Android Studio, choose Open, then select the repo root folder. Let the IDE import the Gradle project.
This is where beginners often lose an hour: Android Studio can open many folders, but only the root folder gives Gradle the full project map.
Part 5: Let Gradle Sync Finish
Official doc: Gradle build lifecycle.
The first sync can be slow because Gradle is building a local model for the project. It usually needs to:
- read
settings.gradle.ktsto find included modules, - read project and module build files,
- download Gradle plugins and library dependencies,
- resolve Kotlin, Android Gradle Plugin, Compose, and test tooling versions,
- build IDE indexes so Android Studio can understand the code.
This is normal. Do not cancel the first sync just because the progress bar looks stuck.
The rule is simple: wait until there is a clear success or a clear first error.
A long stack trace usually has only one real cause near the top.
Quick Orientation, No Need to Dive Deep Into Modules Yet
You only need a rough map for now. Do not go deep into each module yet:
| Area | Beginner mental model |
|---|---|
app | App entry point and wiring |
feature | Screens and user flows |
domain | Use cases and business rules |
data | Repository implementations and external services |
core | Shared technical foundations |
theme | Design system styling |
ui-components | Reusable UI building blocks |
We will study the architecture carefully in later modules. For now, the win is simple: you can open the project and know where you are standing.
Troubleshooting Table
| Error shape | What to check first |
|---|---|
Repository page returns 404 | Wrong GitHub account or invite not accepted |
Repository not found while cloning | Browser access and clone URL |
| Authentication keeps asking again | gh auth status or Git credential manager |
| Android Studio has no Gradle task | You opened a nested folder instead of the repo root |
| SDK not found | Open SDK Manager and confirm SDK location |
| Gradle cannot download dependencies | Check network, proxy, VPN, or repository access |
| JDK mismatch | Use Android Studio's bundled JDK |
| Plugin version error | Confirm you are opening the correct repo branch |
Missing google-services.json | Continue lesson 04 before expecting a full app build |
Checkpoint
Before moving to the next lesson, record your clone and open-project state:
git status
You complete this lesson when:
- Android Studio is opening the repository root, not a nested folder.
- Gradle sync succeeds, or if sync fails, you have copied the first clear error and classified it as access, SDK, JDK, network, dependency, or missing local config.