Dan Tech Academy
After this lesson you will
  • Authenticate GitHub access with GitHub CLI and clone the private course repository
  • Open the correct repository root in Android Studio instead of a nested module folder
  • Understand what the first Gradle sync does to a KMP project and classify the first error when sync fails
Duration12 min
DifficultyBeginner

Clone The Repo And Open The KMP Project For The First Time

Open a real production Kotlin Multiplatform 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 Goal

By the end of this lesson you have:

  • A GitHub account with access to the private course repository,
  • The course codebase cloned into a permanent workspace,
  • Android Studio open at the correct project root,
  • A clear picture of what the first Gradle sync does to a Kotlin Multiplatform project.

Before You Clone

Make sure of three things:

  • GitHub access: you have an account and can see the private repository.
  • Git authentication: your machine can clone code from GitHub.
  • Project root: Android Studio opens the repo's root folder.

Official docs:

Part 1: Confirm GitHub Access In The Browser

Open the course invite link in your browser first and check that:

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

Part 2: Choose How To Authenticate

MethodWhen to use itExample
HTTPSThe simple default; works with a GitHub CLI or credential manager loginhttps://github.com/org/repo.git
SSHA good fit if you already know SSH keys and how to debug key problemsgit@github.com:org/repo.git

Install GitHub CLI so you don't have to paste a personal access token into the terminal. Then run:

bash
gh --version
gh auth login
gh auth status

Follow the browser login flow. Once gh auth status says you are logged in to the right account, your machine has a clean way to authenticate.

Don't paste a personal access token into notes, screenshots, Discord, support messages or shell history.

Part 3: Create A Permanent Workspace

Put the repo somewhere you will keep for the whole course, not in a random download folder:

bash
mkdir -p ~/Desktop/kotlin/dan-tech-academy
cd ~/Desktop/kotlin/dan-tech-academy
git clone <course-repo-url>

Use the exact private repository URL you were given access to. If the clone says Repository not found, check your browser access again. If the clone keeps asking you to authenticate, finish gh auth login or the credential manager setup and try again.

Part 4: Open The Correct Root Folder

The repo has many folders and many modules. You must open the repository root, not app, feature, core, shared-app or iosApp.

The root folder has files like:

text
settings.gradle.kts
build.gradle.kts
gradlew

If you don't see settings.gradle.kts, you are in the wrong folder. Open Android Studio, choose Open, pick the repo root and let the IDE import the Gradle project. Only the root folder tells Gradle the full list of modules.

The iosApp/ folder holds the Xcode project. Android Studio doesn't use it. If you have a Mac, this is the project you open in Xcode to run the iOS build.

Part 5: Let Gradle Sync Finish

Official docs: Gradle build lifecycle.

The first sync is slow because Gradle builds a model of the project:

  • It reads settings.gradle.kts to find the included modules.
  • It builds build-logic/, which holds the convention plugins shared by every module.
  • It reads each module's build file.
  • It downloads the Gradle wrapper, plugins and library dependencies (Kotlin Multiplatform, Android Gradle Plugin, Compose Multiplatform, Koin, Ktor...).
  • It builds the index Android Studio uses to understand code in commonMain, androidMain and iosMain.

Don't cancel the sync just because the progress bar stops moving. Wait for a clear success or a clear first error. A long stack trace usually has one real cause, near the top.

Quick Orientation

For now you only need a rough map of what each folder holds.

AreaHow to read it as a beginner
appAndroid entry point
iosAppXcode project, the iOS entry point (not a Gradle module)
shared-appThe app code shared by both platforms: startup, navigation
featureScreens and user flows
domainUse cases and business rules
dataRepository implementations and external services
core, kernelShared technical foundations
themeDesign system styling
ui-componentsReusable UI building blocks

Troubleshooting Table

ErrorCheck first
Repository page returns 404Wrong GitHub account, or the invite hasn't been accepted
Repository not found when cloningBrowser access and the clone URL
Authentication keeps promptinggh auth status or the Git credential manager
Android Studio shows no Gradle tasksYou opened a nested folder instead of the repo root
SDK not foundOpen the SDK Manager and confirm the SDK location
Gradle can't download dependenciesNetwork, proxy, VPN or repo access
Cannot find a Java installation ... languageVersion=17The machine has no JDK 17. Install JDK 17 and point JAVA_HOME at it
Plugin version errorUpdate to the latest stable Android Studio (the repo uses AGP 9)
Missing google-services.jsonDownload this file from the Firebase Console into app/ before a full app build

Checkpoint

bash
git status

You are done with this lesson when:

  • Android Studio has the repository root open.
  • Gradle sync succeeds. If it fails, you have copied the first error and sorted it into one bucket: access, SDK, JDK, network, dependency or missing local config.
Sign in