Dan Tech Academy
After this lesson you will
  • 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
Duration12 min
DifficultyBeginner

Clone the Repo and Open the Project for the First Time

Open the real production app project instead of a toy starter project.

Video in production

Lesson video is on the way

While you wait, read the full text version below: complete theory, code samples and the hands-on checklist.

Recording is in post-production

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:

  1. You are signed in to the correct GitHub account used to buy the course.
  2. The repository page opens and does not return 404.
  3. You can see the green Code button or clone URL.

Part 2: Choose an Authentication Method

There are two common ways to clone:

MethodWhen to use itExample
HTTPSSimple default; works well with GitHub CLI or credential managerhttps://github.com/org/repo.git
SSHGood if you already know SSH keys and can debug key problemsgit@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:

bash
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:

bash
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:

bash
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 app folder,
  • not feature,
  • not core,
  • not a nested module.

The root folder should contain files/folders similar to:

text
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.kts to 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:

AreaBeginner mental model
appApp entry point and wiring
featureScreens and user flows
domainUse cases and business rules
dataRepository implementations and external services
coreShared technical foundations
themeDesign system styling
ui-componentsReusable 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 shapeWhat to check first
Repository page returns 404Wrong GitHub account or invite not accepted
Repository not found while cloningBrowser access and clone URL
Authentication keeps asking againgh auth status or Git credential manager
Android Studio has no Gradle taskYou opened a nested folder instead of the repo root
SDK not foundOpen SDK Manager and confirm SDK location
Gradle cannot download dependenciesCheck network, proxy, VPN, or repository access
JDK mismatchUse Android Studio's bundled JDK
Plugin version errorConfirm you are opening the correct repo branch
Missing google-services.jsonContinue lesson 04 before expecting a full app build

Checkpoint

Before moving to the next lesson, record your clone and open-project state:

bash
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.
Sign in