https://kotlinlang.org logo
Join the conversationJoin Slack
Channels
100daysofcode
100daysofkotlin
100daysofkotlin-2021
advent-of-code
aem
ai
alexa
algeria
algolialibraries
amsterdam
android
android-architecture
android-databinding
android-studio
androidgithubprojects
androidthings
androidx
androidx-xprocessing
anime
anko
announcements
apollo-kotlin
appintro
arabic
argentina
arkenv
arksemdevteam
armenia
arrow
arrow-contributors
arrow-meta
ass
atlanta
atm17
atrium
austin
australia
austria
awesome-kotlin
ballast
bangladesh
barcelona
bayarea
bazel
beepiz-libraries
belgium
berlin
big-data
books
boston
brazil
brikk
budapest
build
build-tools
bulgaria
bydgoszcz
cambodia
canada
carrat
carrat-dev
carrat-feed
chicago
chile
china
chucker
cincinnati-user-group
cli
clikt
cloudfoundry
cn
cobalt
code-coverage
codeforces
codemash-precompiler
codereview
codingame
codingconventions
coimbatore
collaborations
colombia
colorado
communities
competitive-programming
competitivecoding
compiler
compose
compose-android
compose-desktop
compose-hiring
compose-ios
compose-mp
compose-ui-showcase
compose-wear
compose-web
connect-audit-events
corda
cork
coroutines
couchbase
coursera
croatia
cryptography
cscenter-course-2016
cucumber-bdd
cyprus
czech
dagger
data2viz
databinding
datascience
dckotlin
debugging
decompose
decouple
denmark
deprecated
detekt
detekt-hint
dev-core
dfw
docs-revamped
dokka
domain-driven-design
doodle
dsl
dublin
dutch
eap
eclipse
ecuador
edinburgh
education
effective-kotlin
effectivekotlin
emacs
embedded-kotlin
estatik
event21-community-content
events
exposed
failgood
fb-internal-demo
feed
firebase
flow
fluid-libraries
forkhandles
forum
fosdem
fp-in-kotlin
framework-elide
freenode
french
fritz2
fuchsia
functional
funktionale
gamedev
ge-kotlin
general-advice
georgia
geospatial
german-lang
getting-started
github-workflows-kt
glance
godot-kotlin
google-io
gradle
graphic
graphkool
graphql
graphql-kotlin
graviton-browser
greece
grpc
gsoc
gui
hackathons
hacktoberfest
hamburg
hamkrest
helios
helsinki
hexagon
hibernate
hikari-cp
hire-me
hiring
hongkong
hoplite
http4k
hungary
hyderabad
image-processing
india
indonesia
inkremental
intellij
intellij-plugins
intellij-tricks
internships
introduce-yourself
io
ios
iran
israel
istanbulcoders
italian
jackson-kotlin
jadx
japanese
jasync-sql
java-to-kotlin-refactoring
javadevelopers
javafx
javalin
javascript
jdbi
jhipster-kotlin
jobsworldwide
jpa
jshdq
juul-libraries
jvm-ir-backend-feedback
jxadapter
k2-early-adopters
kaal
kafka
kakao
kalasim
kapt
karachi
karg
karlsruhe
kash_shell
kaskade
kbuild
kdbc
kgen-doc-tools
kgraphql
kinta
klaxon
klock
kloudformation
kmdc
kmm-español
kmongo
knbt
knote
koalaql
koans
kobalt
kobweb
kodein
kodex
kohesive
koin
koin-dev
komapper
kondor-json
kong
kontent
kontributors
korau
korean
korge
korim
korio
korlibs
korte
kotest
kotest-contributors
kotless
kotlick
kotlin-asia
kotlin-beam
kotlin-by-example
kotlin-csv
kotlin-data-storage
kotlin-foundation
kotlin-fuel
kotlin-in-action
kotlin-inject
kotlin-latam
kotlin-logging
kotlin-multiplatform-contest
kotlin-mumbai
kotlin-native
kotlin-pakistan
kotlin-plugin
kotlin-pune
kotlin-roadmap
kotlin-samples
kotlin-sap
kotlin-serbia
kotlin-spark
kotlin-szeged
kotlin-website
kotlinacademy
kotlinbot
kotlinconf
kotlindl
kotlinforbeginners
kotlingforbeginners
kotlinlondon
kotlinmad
kotlinprogrammers
kotlinsu
kotlintest
kotlintest-devs
kotlintlv
kotlinultimatechallenge
kotlinx-datetime
kotlinx-files
kotlinx-html
kotrix
kotson
kovenant
kprompt
kraph
krawler
kroto-plus
ksp
ktcc
ktfmt
ktlint
ktor
ktp
kubed
kug-leads
kug-torino
kvision
kweb
lambdaworld_cadiz
lanark
language-evolution
language-proposals
latvia
leakcanary
leedskotlinusergroup
lets-have-fun
libgdx
libkgd
library-development
linkeddata
lithuania
london
losangeles
lottie
love
lychee
macedonia
machinelearningbawas
madrid
malaysia
mathematics
meetkotlin
memes
meta
metro-detroit
mexico
miami
micronaut
minnesota
minutest
mirror
mockk
moko
moldova
monsterpuzzle
montreal
moonbean
morocco
motionlayout
mpapt
mu
multiplatform
mumbai
munich
mvikotlin
mvrx
myndocs-oauth2-server
naming
navigation-architecture-component
nepal
new-mexico
new-zealand
newname
nigeria
nodejs
norway
npm-publish
nyc
oceania
ohio-kotlin-users
oldenburg
oolong
opensource
orbit-mvi
osgi
otpisani
package-search
pakistan
panamá
pattern-matching
pbandk
pdx
peru
philippines
phoenix
pinoy
pocketgitclient
polish
popkorn
portugal
practical-functional-programming
proguard
prozis-android-backup
pyhsikal
python
python-contributors
quasar
random
re
react
reaktive
realm
realworldkotlin
reductor
reduks
redux
redux-kotlin
refactoring-to-kotlin
reflect
refreshversions
reports
result
rethink
revolver
rhein-main
rocksdb
romania
room
rpi-pico
rsocket
russian
russian_feed
russian-kotlinasfirst
rx
rxjava
san-diego
science
scotland
scrcast
scrimage
script
scripting
seattle
serialization
server
sg-user-group
singapore
skia-wasm-interop-temp
skrape-it
slovak
snake
sofl-user-group
southafrica
spacemacs
spain
spanish
speaking
spek
spin
splitties
spotify-mobius
spring
spring-security
squarelibraries
stackoverflow
stacks
stayhungrystayfoolish
stdlib
stlouis
strife-discord-lib
strikt
students
stuttgart
sudan
swagger-gradle-codegen
swarm
sweden
swing
swiss-user-group
switzerland
talking-kotlin
tallinn
tampa
teamcity
tegal
tempe
tensorflow
terminal
test
testing
testtestest
texas
tgbotapi
thailand
tornadofx
touchlab-tools
training
tricity-kotlin-user-group
trójmiasto
truth
tunisia
turkey
turkiye
twitter-feed
uae
udacityindia
uk
ukrainian
uniflow
unkonf
uruguay
utah
uuid
vancouver
vankotlin
vertx
videos
vienna
vietnam
vim
vkug
vuejs
web-mpp
webassembly
webrtc
wimix_sentry
wwdc
zircon
Powered by Linen
multiplatform
  • z

    Zhiqiang Bian

    09/10/2021, 5:16 PM
    Hey guys! I am trying to send an image from Android/iOS to the backend using ktor-client, which requires to convert the Image file into a ByteArray first. I can’t find a library that supports both Android and iOS. Is
    expect/actual
    the only way to handle this use case?
    👍🏻 1
    👍🏾 1
    s
    i
    • 3
    • 3
  • c

    clark

    09/11/2021, 4:34 AM
    Hey everyone, I recently started seeing a bug with the
    multiplatform-settings
    library where anytime I try to init the no arg version in my commonMain code, it throws a
    NullPointerException
    . See thread for code.
    r
    • 2
    • 11
  • b

    Boris Yordanov

    09/11/2021, 9:12 AM
    Anyone using moko -resources for colors with compose/swiftui? Their colour resource does not have resourceID, similarly to how we get strings - MR.strings.my_atring.resourceId
    w
    • 2
    • 4
  • m

    Matias Forbord

    09/12/2021, 4:11 AM
    I've looked far and wide but haven't found examples of a KMM (Android/iOS) media player. Does anyone have advice on where/what to look for, in terms of learning the best approach to playing audio on both devices in a KMM architecture? • https://github.com/icerockdev/moko-media seems like it could be exactly this, but I've had trouble getting this running, and I have a hard time making out if it only supports picture media as of yet. • https://github.com/korlibs/korau is very cool, but it is targeting Kotlin Native as far as I understand. New to the JVM world but adore Kotlin, so I'm not quite clear on whether this would be something you'd use in KMM.
    s
    • 2
    • 2
  • b

    Big Chungus

    09/12/2021, 12:34 PM
    How can I restrict publishing my android artefacts only on a particular host in KMP library project?
    j
    • 2
    • 1
  • j

    Javier

    09/12/2021, 7:56 PM
    Anyone has noticed that if you control click in a function JVM library which is an
    expect
    inside of a KMP library with Android and JVM, it redirects to the Android
    actual
    instead of the JVM
    actual
    ?
    :yes: 1
    m
    s
    • 3
    • 15
  • m

    mbonnin

    09/13/2021, 8:05 AM
    Can I create a (edit: Native) MacOS app without writing a single line of Swift? If yes, is there a sample somewhere?
    d
    b
    d
    • 4
    • 7
  • l

    Louis

    09/13/2021, 9:35 AM
    Hello ! Is there a way to share test code between Android and commonTest packages ? For example I want an utility function available for those 2 packages
    j
    • 2
    • 6
  • t

    than_

    09/13/2021, 11:22 AM
    hi, has anyone successfully published multiplatform library to Artifact Registry? I'm getting
    Execution failed for task ':publishJvmPublicationToMavenRepository'.
    > Failed to publish publication 'jvm' to repository 'maven'
       > Could not write to resource '<https://europe-central2-maven.pkg.dev/...>'.
          > Connection reset by peer: socket write error
    for
    publishing{    
        repositories {
                maven {
                    url = uri("<https://europe-central2-maven.pkg.dev/>...")
                    credentials {
                        username = "_json_key_base64"
                        password = artifactRegistryMavenSecret
                    }
                    authentication {
                        create<BasicAuthentication>("basic")
                    }
                }
            }
        }
    • 1
    • 1
  • s

    Stefan Oltmann

    09/13/2021, 2:45 PM
    Is there an easy way to use the same name for multiple targets? Like the
    ios()
    target bundles
    iosArm64
    &
    iosX64
    I want the architectures iosArm64(), iosSimulatorArm64(), macosX64() and macosArm64() in a common
    iosMain
    &
    iosTest
    source set. But everything the
    ios()
    method calls is private and I would basicly copy everything to make it work that way. Feels wrong. What is the intended way to solve that?
    ✅ 1
    t
    b
    k
    • 4
    • 8
  • d

    David Liu

    09/13/2021, 9:18 PM
    Hi, I am converting my android library to support multiplatform (android & ios) but I have encountered the dependencies issue with coroutines. I am using
    Kotlin v1.5.30
    and
    coroutines v1.5.2-native-mt
    . Does anyone have experienced the same issue?
    w: skipping /Users/davidliu/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlinx/kotlinx-coroutines-core-iosx64/1.5.2-native-mt/fd419ceca95f3403fe6e22ec714dd04a746656a/kotlinx-coroutines-core.klib. Incompatible abi version. The current default is '1.4.2', found '1.5.0'. The library produced by 1.5.30 compiler
    
    e: Could not find "/Users/davidliu/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlinx/kotlinx-coroutines-core-iosx64/1.5.2-native-mt/fd419ceca95f3403fe6e22ec714dd04a746656a/kotlinx-coroutines-core.klib" in [/Users/davidliu/Repostories/android-library, /Users/davidliu/.konan/klib, /Users/davidliu/.konan/kotlin-native-prebuilt-macos-1.5/klib/common, /Users/davidliu/.konan/kotlin-native-prebuilt-macos-1.5/klib/platform/ios_x64]
    a
    s
    l
    • 4
    • 6
  • s

    Stefan Oltmann

    09/14/2021, 7:13 AM
    Did anyone found a workaround for the problem that currently you can't create XCFrameworks containing macOS X64 & ARM64 with Kotlin 1.5.30? It's an open issue and somewhere in the roadmap. https://youtrack.jetbrains.com/issue/KT-47355 What are my options to work around that limitation? I tried to export it as a separate XCFramework / framework and combine it with the
    lipo
    command but no success.
    k
    • 2
    • 7
  • p

    Philipp Bykow

    09/14/2021, 11:15 AM
    Hello all, currently im trying to use Kotlin Multiplatform for an android and iOS app. Everything works fine in xcode and android Studio until i try to build the ios App with fastlane. Then i get the error message IPA processing failed. Any idea ?
    s
    • 2
    • 7
  • r

    Rak

    09/14/2021, 1:05 PM
    Hi, a couple of months ago I tried out KMM (and got some really good help here, thanks@), I had a few issues notably deploying on iOS did not work reliably. Anyway, the world of KMM moves fast and I;m sure there is a new IDE version and libs to use. I want to create a KMM lib that does network calls as a first step. My question is, if I was to start from scratch what route do you recommend? The sample KMM project generated by Android STudio in the latest Arctic Fox (or some other version?) Or should i try the KampKit?
    s
    k
    • 3
    • 16
  • b

    benkuly

    09/14/2021, 1:42 PM
    Is it possible to use the same code for jvmMain and androidMain but with slightly different dependencies? This does not work, because then jna classes are duplicated:
    val jvmMain by getting {
        dependencies {
            implementation("net.java.dev.jna:jna:${Versions.jna}")
        }
    }
    val androidMain by getting {
        dependsOn(jvmMain)
        dependencies {
            implementation("net.java.dev.jna:jna:${Versions.jna}@aar")
        }
    }
    r
    • 2
    • 2
  • a

    Anil Kumar

    09/14/2021, 4:25 PM
    Is there any way I can add a Kotlin multiplatform library (which does networking and SQL database transactions) to an existing Android and iOS project? Most of the tutorials I see are starting a project form scratch.
    t
    • 2
    • 2
  • m

    MarkRS

    09/14/2021, 5:25 PM
    Is there any way to keep the compiler happy about properties of a shared class which are inherited in a platform specific area? Billing code can be abstracted away from Google and Apple billing with classes in the correct sections that inherit from them appropriately, but do I have to choose names distinct from both? Is that a clear enough question?
    m
    • 2
    • 2
  • j

    jean

    09/15/2021, 7:16 AM
    I’m following what KaMPKit wrote in this stackoverflow thread to test my sqldelight queries https://stackoverflow.com/questions/65663436/how-to-write-unit-tests-for-sqldelight-on-kmm My test succeeds in android but I get
    kotlin.IllegalStateException: There is no event loop. Use runBlocking { ... } to start one.
    when running the same test for ios. this is my BaseTest class in
    iosTest
    actual abstract class BaseTest {
        @OptIn(DelicateCoroutinesApi::class)
        actual fun <T> runTest(block: suspend CoroutineScope.() -> T) {
            var error: Throwable? = null
            GlobalScope.launch(Dispatchers.Main) {
                try {
                    block()
                } catch (t: Throwable) {
                    error = t
                } finally {
                    CFRunLoopStop(CFRunLoopGetCurrent())
                }
            }
            CFRunLoopRun()
            error?.also { throw it }
        }
    }
    I just copied what they have. Any idea what I’m doing wrong?
    a
    o
    l
    • 4
    • 5
  • k

    Kareem Waleed

    09/15/2021, 8:32 AM
    Hello guys, can anyone help me with this ? https://stackoverflow.com/questions/69189540/how-to-successfully-publish-a-kmm-library-on-localmaven-for-android-project-to Thanks 😄
    r
    m
    d
    • 4
    • 4
  • o

    orafaaraujo

    09/15/2021, 11:54 AM
    Hello, Does anyone one knows if is possible to use camelcase in the import of the shared module in the Swift class? Already tried to rename the module but no success Thank you
    👆 1
    😒ame: 1
    • 1
    • 1
  • a

    Alex Brown

    09/15/2021, 2:28 PM
    Hey 👋 Has anyone had any success linking the shared framework from a KMM project in Xcode 13? I can produce the framework for
    Arm64
    builds, but when I try and export for
    X64
    I get the following error:
    Execution failed for task ':shared:linkDebugFrameworkIosX64'
    Even when I do successfully export an Arm framework I get loads of build errors. Just wondered if anyone has already solved this problem, whether this a known issue or unique to our project setup. Thanks!
    t
    • 2
    • 2
  • l

    leandro

    09/15/2021, 7:43 PM
    how can i configure the multiplatform plugin once (lets say to enforce the
    explicitApiWarning
    and have it applied for all my multiplatform modules? I currently have applied it on my root build.grade but it is causing other problems (eg. scratch files not working). Is there another way of doing it?
    l
    a
    • 3
    • 3
  • o

    Osman Saral

    09/16/2021, 12:25 PM
    Hello, I'm getting "Could not identify native targets for platform: 'iphonesimulator' and architectures: '[]'" does anyone know the reason?
    s
    m
    s
    • 4
    • 59
  • m

    Martin Rajniak

    09/16/2021, 5:08 PM
    Hey folks, I want to use Firestore and Cloud Storage from my KMM app. What is the best approach nowadays. I have seen https://github.com/gitliveapp/firebase-kotlin-sdk/ ( that seem to wrap native Firebase libraries ). It is missing Cloud Storage support but from the look of other implementations, it seems like a not that big effort. My question, isn't it better to use REST API directly from shared code?
    t
    • 2
    • 4
  • m

    Martin Rajniak

    09/17/2021, 11:17 AM
    Hello nice people, I am trying to use iOS Firebase dependency in KMM through CocoaPods ( https://kotlinlang.org/docs/native-cocoapods.html#add-dependencies-on-pod-libraries ) and I am getting:
    The /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld command returned non-zero exit code: 1.
    output:
    Undefined symbols for architecture arm64:
    "_OBJC_CLASS_$_FIRStorage", referenced from:
    objc-class-ref in result.o
    ld: symbol(s) not found for architecture arm64
    Any idea where to go from here?
    m
    n
    • 3
    • 7
  • m

    matej

    09/17/2021, 12:57 PM
    We're getting a build error with Xcode 13 RC that was not there in Beta 5:
    Exception in thread "main" java.lang.Error: /var/folders/r8/cq5z9sk940sbz3kq52q5x4fx11kwqx/T/1091386677463552763.m:1:9: fatal error: could not build module 'SQLCipher'
    at org.jetbrains.kotlin.native.interop.indexer.UtilsKt.ensureNoCompileErrors(Utils.kt:192)
    at org.jetbrains.kotlin.native.interop.indexer.ModuleSupportKt.getModulesASTFiles(ModuleSupport.kt:68)
    at org.jetbrains.kotlin.native.interop.indexer.ModuleSupportKt.getModulesInfo(ModuleSupport.kt:14)
    at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.buildNativeLibrary(main.kt:531)
    at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.processCLib(main.kt:268)
    at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.interop(main.kt:76)
    at org.jetbrains.kotlin.cli.utilities.InteropCompilerKt.invokeInterop(InteropCompiler.kt:45)
    at org.jetbrains.kotlin.cli.utilities.MainKt.mainImpl(main.kt:38)
    at org.jetbrains.kotlin.cli.utilities.MainKt.main(main.kt:60)
    
    > Task :cinteropSQLCipherIos FAILED
    
    FAILURE: Build failed with an exception.
    
    * What went wrong:
    Execution failed for task ':cinteropSQLCipherIos'.
    > Process 'command '/Library/Java/JavaVirtualMachines/jdk-15.0.2.jdk/Contents/Home/bin/java'' finished with non-zero exit value 1
    There was no change to our code, the only difference is the Xcode update. Anyone had anything similar?
    o
    • 2
    • 2
  • m

    Michal Klimczak

    09/17/2021, 1:22 PM
    I was super hyped for apple silicon support (especially the
    iosSimulatorArm64
    target), but a few libraries need to be updated first. For me it was: • ktor 1.6.3 • sqldelight 1.5.1 • multiplatform-settings 0.8 • koin 3.1.2 • koru 0.8.0 (which I'm working on to support asap in 0.9.0)
    👍 1
    🤔 1
    o
    r
    s
    • 4
    • 7
  • m

    MarkRS

    09/17/2021, 1:54 PM
    Is it possible to construct a settings manager in KMM? My app has user settings. Can I have a common settings manager and allow each platform to work with their respective details? I can see how to do this for the Android section, androidmain allows me to import Android sharedPreferences, but I can't import iOS userPreferences there, so I don't see how to make this work 😞 A pointer (sic) would be very gratefully received.
    k
    r
    • 3
    • 3
  • k

    Kurt Renzo Acosta

    09/17/2021, 2:03 PM
    Has anyone encountered an issue where you can build through Android Studio but not on Xcode? AS builds fine when running
    cinterop
    via cocoapods but on Xcode it doesn’t. Also, when checking on
    build/cocoapods/synthetic
    , the Pods are in there! On Xcode we get this error:
    > Task :shared:firebase:auth:cinteropFirebaseAuthIos FAILED
    Exception in thread "main" java.lang.Error: /var/folders/2d/bfr1v4wn0nd926jj62ztw0m80000gn/T/3409687098729027093.m:1:9: fatal error: module 'FirebaseAuth' not found
    	at org.jetbrains.kotlin.native.interop.indexer.UtilsKt.ensureNoCompileErrors(Utils.kt:152)
    	at org.jetbrains.kotlin.native.interop.indexer.ModuleSupportKt.getModulesASTFiles(ModuleSupport.kt:68)
    	at org.jetbrains.kotlin.native.interop.indexer.ModuleSupportKt.getModulesInfo(ModuleSupport.kt:14)
    	at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.buildNativeLibrary(main.kt:515)
    	at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.processCLib(main.kt:266)
    	at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.interop(main.kt:76)
    	at org.jetbrains.kotlin.cli.utilities.InteropCompilerKt.invokeInterop(InteropCompiler.kt:45)
    	at org.jetbrains.kotlin.cli.utilities.MainKt.mainImpl(main.kt:38)
    	at org.jetbrains.kotlin.cli.utilities.MainKt.main(main.kt:60)
    :shared:firebase:auth:cinteropFirebaseAuthIos (Thread[Execution worker for ':' Thread 3,5,main]) completed. Took 6.607 secs.
    v
    m
    n
    • 4
    • 25
  • d

    darkmoon_uk

    09/17/2021, 2:35 PM
    It seems that many MPP projects will want to be opened in both Android Studio and IntelliJ IDEA at some point. • Android Studio to work with the latest tooling on the Android side (Compose previews) • IntelliJ to gain access to JVM debugging for the Desktop/Server parts - because JVM debugging doesn't work at all, by design, on AS? I'm there now: Gradle config is mostly compatible between the two, the blocker is the different Android Gradle Plugin version required by each IDE. How are people dealing with this? • Having entirely separate Gradle projects to open in each IDE? • Or working with a lowest-common denominator Android config that works with either Gradle plugin? • Not using Android Studio and only using IntelliJ for all parts of the project? This is a barrier to adoption for MPP + Compose. It would be enough if I could just ignore the Android plugin and targets when opening in IntelliJ, but that's easier said than done because if you switch off the plugin, other syntax becomes invalid.
    ➕ 3
    👀 1
    ☝️ 2
    j
    m
    m
    • 4
    • 26
Powered by Linen
Title
d

darkmoon_uk

09/17/2021, 2:35 PM
It seems that many MPP projects will want to be opened in both Android Studio and IntelliJ IDEA at some point. • Android Studio to work with the latest tooling on the Android side (Compose previews) • IntelliJ to gain access to JVM debugging for the Desktop/Server parts - because JVM debugging doesn't work at all, by design, on AS? I'm there now: Gradle config is mostly compatible between the two, the blocker is the different Android Gradle Plugin version required by each IDE. How are people dealing with this? • Having entirely separate Gradle projects to open in each IDE? • Or working with a lowest-common denominator Android config that works with either Gradle plugin? • Not using Android Studio and only using IntelliJ for all parts of the project? This is a barrier to adoption for MPP + Compose. It would be enough if I could just ignore the Android plugin and targets when opening in IntelliJ, but that's easier said than done because if you switch off the plugin, other syntax becomes invalid.
➕ 3
👀 1
☝️ 2
j

Javier

09/17/2021, 3:07 PM
The problem is on Google side: https://issuetracker.google.com/issues/198176809
⭐ 2
Personally, I hope a lot I can just use the latest stable version of AGP in the latest stable IntelliJ IDEA, but now it is an awful experience, because the delay until AGP supports the latest IDEA is counted in months...
d

darkmoon_uk

09/17/2021, 3:23 PM
That's interesting @Javier, I didn't realise that AGP latest actively prevents itself being used in IntelliJ. I suppose it's a matter of who is going to put in the testing effort as well.
j

Javier

09/17/2021, 3:24 PM
personally I would like to have a "force" option to try to use the latest agp, maybe it just works
➕ 3
d

darkmoon_uk

09/17/2021, 3:24 PM
Starred FWIW. I hope JetBrains and Google can come up with some kind of solution, I'm not even talking about having full functionality in both IDE's - just a way that we can even open a mixed MPP project at all, to use the current support from each IDE.
I can think of one way to achieve it, by having totally separate Gradle root projects for each IDE, then flat include all the project submodules.
That's quite a lot of structural upheaval in my project for the sake of one plugins 'artificial' incompatibility 😞
j

Javier

09/17/2021, 3:27 PM
the problem is 4.2.2 can have different configs which break with 7.0.2
like the new way to declare sdk versions
so maintaing two different configs is just... 💤
d

darkmoon_uk

09/17/2021, 3:28 PM
Yes there are creeping differences in their syntax, some of which can be worked around, but it starts to get like walking on ice.
Also e.g.
7.0.2
buildTypes {
    release {
vs.
4.2.2
buildTypes {
    getByName("release") {
It's confronting, because now I can't debug my Server and Desktop parts at all.
j

Javier

09/17/2021, 3:31 PM
getByName should work on 7.0.2, no?
d

darkmoon_uk

09/17/2021, 3:31 PM
Yes that will, but just an example where there's drift in the recommended syntax.
I think I'll have another go at trying to achieve the lowest denominator syntax between the plugins.
Did you try, or have any luck with that?
j

Javier

09/17/2021, 3:33 PM
no, probably if you dont migrated the deprecated properties to the new 7.0.2 approach it should work without doing nothing
d

darkmoon_uk

09/17/2021, 3:33 PM
I have this in my
buildSrc
BTW:
val AndroidGradlePlugin = when (BuildSettings.environment) {
            BuildEnvironment.IntelliJ -> "4.2.2"
            else -> "7.1.0-alpha11"
        }
j

Javier

09/17/2021, 3:33 PM
just changing from 4.2.2 to 7.0.2
not sure about 7.1 tho
👍 1
m

mbonnin

09/17/2021, 6:03 PM
I've been trying all kind of things. Since I don't use Compose that much, I tend to stay on AGP 4.2.2 + IntelliJ.
I've had some success ignoring parts of the build with
if (System.getProperty("idea.sync.active") == null) {
      // Do some stuff with AGP
    }
Maybe there's a property that allows differentiating between AS/IntelliJ where you can change the logic/plugin versions/etc..
But I'm eagerly waiting on AGP 7.x to be compatible with IntelliJ too
m

Mărcuţ Andrei

09/20/2021, 10:37 AM
Could this option be a workaround - to turn .iml project files to ON in AS and separately keep IJ with the .idea folder? Haven’t tried it myself, just an idea.
View count: 2