HowTo build DroidCon application on Compose Multiplatoform

Programistich
3 min readAug 20, 2022

--

Hi all!
TouchLab wrote the DroidCon application on compose multiplatform for Android and IOS (link)

Previously, with the help of Kotlin Multiplatform technology, we could make a layer of business logic, but not so long ago, Jetbrains published several examples of general logic on compose for android and IOS

Therefore, I became very interested and I started looking at all sorts of examples on compose, and the DroidCon application was no exception.

In this article I want to show how you can build your first project on Compose Multiplatform

Clone project from Github

git clone https://github.com/touchlab/DroidconKotlin
or
git clone git@github.com:touchlab/DroidconKotlin.git

Google Service Json

  • Create Project in https://firebase.google.com
  • Create android application with id: co.touchlab.droidcon.berlin
  • Copy file to folder android/
  • Create IOS application with id: com.touchlab.example.ios
  • Copy file to ios/Droidcon/Droidcon/

Android Lint

For some reason, the project has a linter, but its rules are not followed, so we will disable it

  • Open project in your favorite IDE, I prefer Android Studio
  • Go to build.gradle.kts and comment all subprojects and id(“org.jlleitschuh.gradle.ktlint”)
  • Go to android/build.gradle.kts and change isAbortOnError = true to isAbortOnError = false
  • Repeat for shared/build.gradle.kts, shared-ui/build.gradle.kts

Java Heap

Change org.gradle.jvmargs to -Xmx4608m in gradle.options

Try build for Android

Well, now we can run application on Android

  • Create file(if not exist) local.properties with path to SDK

Run by gradle:
./gradlew assembleDebug && ./gradlew installDebug && adb shell am start -n co.touchlab.droidcon.berlin/co.touchlab.droidcon.berlin.MainActivity
Run by Android Studio:

Try build for IOS

  • Run ./gradlew build
  • Go to folder ios/Droidcon/
  • For arm:

sudo arch -x86_64 gem install ffi
arch -x86_64 pod install

  • For x86:

pod install

  • Open Xcode (click on Droidcon.xcworkspace)
  • Go to Project -> Targets -> DroidCon -> Signing & Capabilities
  • In Team choose your profile
  • In Bundle Identifier set com.touchlab.example.ios
  • Choose physical device (emulator have some problem in gradle build)
  • Click “Run”

Well, its great experience

If you have any question, you can write to my telegram https://t.me/programistich_reborn

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Programistich
Programistich

Written by Programistich

Android Dev in Flipper Devices

No responses yet

Write a response