android-maps-compose icon indicating copy to clipboard operation
android-maps-compose copied to clipboard

Add iOS target using Compose Multiplatform

Open dogeweb opened this issue 2 years ago • 61 comments

Describe the solution you'd like Add platform-specific code for iOS, using JetBrains Compose Multiplatform.

JB Compose iOS support is now in Alpha compose-multiplatform/releases/tag/v1.4.0 and enables the use of UiKit views in Compose. Kotlin Multiplatform Mobile recently moved to Beta and cocoapods integration works: kotlinlang.org/docs/native-cocoapods.html

Since android-maps-compose library is a wrapper for an Android view, it may result easy to adapt the existing structure to wrap also iOS objective-c Maps sdk.

A quick implementation labeled as alpha could come handy for developers to start playing with it, while waiting JB Compose iOS support to exit Alpha state.

dogeweb avatar Apr 20 '23 19:04 dogeweb

If you would like to upvote the priority of this issue, please comment below or react with :+1: so we can see what is popular when we triage.

@dogeweb Thank you for opening this issue. 🙏 Please check out these other resources that might help you get to a resolution in the meantime:

This is an automated message, feel free to ignore.

wangela avatar Apr 20 '23 19:04 wangela

This is interesting! Adding a help wanted tag and pinning for anyone who wants to explore what it takes to add Compose MP and iOS support.

wangela avatar Aug 11 '23 19:08 wangela

An existing challenge with Compose multiplatform apps pertains to the availability of appropriate libraries for incorporating the Map feature. The prospect of Google extending its support in this regard holds immense potential, as it could significantly bolster the advancement of Compose Multiplatform apps.

lihenggui avatar Aug 15 '23 04:08 lihenggui

I have had success with using compose for iOS with UIKitView to render google maps.

Maps are currently rendering on iOS and Android. All standard map interactivity is working. Markers and paths are displaying properly.

Here's a link to my repo.

https://github.com/realityexpander/ContactsComposeMultiplatform

The part I'm currently working on is the "on_____Click" call backs. Right now I am not able to write custom map event callback handlers for "on____Click" events. This is only a problem in the iOS stide.

I'm an Android dev, so I'm not sure whats necessary to make the work using Kotlin on the iOS side... all the sample code does not refer to this use case.

NOTE: Be sure to manually give location permission on the Android, I havent implemented that part yet.

you will need to get your own google maps api key.

This is still a work in progress, and its a good head start!

realityexpander avatar Sep 29 '23 01:09 realityexpander

Hi @realityexpander!

Thanks for the message, it is great to see that Android Maps for Compose can be used in KMP!

We merged recently https://github.com/googlemaps/android-maps-compose/pull/320, which introduced default values for the listeners. I suspect that this prevent listeners from working out of the box: default parameters in iOS are not supported, since the interoperability happens from Kotlin - Objective-C and Swift, so ultimately Objective-C needs to support them. I wrote an article about it here.

Touchlab released a couple of days SKIE, which promises to fix this issue. I haven't check it yet, but I would like to take a look. Eventually it seems that Android-Maps-Compose could work relatively out of the box for iOS.

kikoso avatar Sep 29 '23 12:09 kikoso

So am I to understand that ive hit a dead end with looking to get "onMapClick" type of events from the Google MapView on iOS?

That I should probably wait on the Google Maps iOS "onMapClick" types of integrations?

That its likely not possible now without more low level work from the Google Maps team?

Should I file a bug report or feature request, or are they already aware of this issue and we are just waiting for them to catch up to KMP?

realityexpander avatar Sep 29 '23 16:09 realityexpander

So am I to understand that ive hit a dead end with looking to get "onMapClick" type of events from the Google MapView on iOS?

That I should probably wait on the Google Maps iOS "onMapClick" types of integrations?

That its likely not possible now without more low level work from the Google Maps team?

Should I file a bug report or feature request, or are they already aware of this issue and we are just waiting for them to catch up to KMP?

i found the way to handle click on marker:

val googleMapView = GMSMapView()
val delegate = object : NSObject(), GMSMapViewDelegateProtocol {
    //use this override, without nothing happend 
        override fun mapView(
            mapView: GMSMapView,
            didTapAtCoordinate: CValue<CLLocationCoordinate2D>
        ) {

        }

        override fun mapView(
            mapView: GMSMapView,
            didTapMarker: GMSMarker
        ): Boolean {
            val userData = didTapMarker.userData()
            println("gmios marker click ${userData}")
            return true
        }
    }

//uikitview
factory = {
                googleMapView.delegate = delegate
                return@UIKitView googleMapView
            }

MascotWorld avatar Oct 17 '23 09:10 MascotWorld

image

My versions....

// gradle.properties
#Gradle
org.gradle.jvmargs=-Xmx2048M -Dkotlin.daemon.jvm.options\="-Xmx2048M"

#Kotlin
kotlin.code.style=official

#MPP
kotlin.mpp.stability.nowarn=true
kotlin.mpp.enableCInteropCommonization=true
kotlin.mpp.androidSourceSetLayoutVersion=2

#Android
android.useAndroidX=true
android.compileSdk=34
android.targetSdk=34
android.minSdk=24

#Compose
org.jetbrains.compose.experimental.uikit.enabled=true

#Versions
kotlin.version=1.9.10
agp.version=8.0.2
compose.version=1.5.3

# Google Maps
google.maps.secrets-gradle-plugin.version=2.0.1
// build.gradle.kts(:shared)
val androidMain by getting {
            dependencies {

                api("androidx.activity:activity-compose:1.8.0")
                api("androidx.appcompat:appcompat:1.6.1")
                api("androidx.core:core-ktx:1.12.0")

                // Google maps for Compose for Android
                api("com.google.android.gms:play-services-location:21.0.1")
                api("com.google.android.gms:play-services-maps:18.1.0")
                implementation("com.google.maps.android:maps-compose:$mapsComposeVersion")
                // clustering
                implementation("com.google.maps.android:maps-compose-utils:$mapsComposeVersion")

                // Ktor Client for Android
                implementation("io.ktor:ktor-client-android:$ktorClientVersion")

                // For Logger in Android todo (why doesn't this automatically put this in shared android module?)
                api("co.touchlab:kermit:2.0.1")
            }
        }

Any ideas? Are you using the same versions?

realityexpander avatar Oct 17 '23 20:10 realityexpander

GMSMapViewDelegateProtocol

I was looking at your project to build mine. Yes, this error exists, but the application compiles and works :) I think we need to make an issue in the multiplatform compose branch, because the inability to add a delegate normally (I think so) is a library problem. image

MascotWorld avatar Oct 18 '23 06:10 MascotWorld

agp.version=8.1.2
android.defaults.buildfeatures.buildconfig=true
android.enableJetifier=true
android.nonFinalResIds=false
android.nonTransitiveRClass=true
android.useAndroidX=true
compose.version=1.5.3
kotlin.code.style=official
kotlin.mpp.androidGradlePluginCompatibility.nowarn=true
kotlin.mpp.androidSourceSetLayoutVersion=2
kotlin.mpp.enableCInteropCommonization=true
kotlin.version=1.9.10
org.gradle.jvmargs=-Xmx2048M -Dfile.encoding\=UTF-8 -Dkotlin.daemon.jvm.options\="-Xmx2048M"
org.jetbrains.compose.experimental.uikit.enabled=true

google.maps.secrets-gradle-plugin.version=2.0.1

and androidMain:

val androidMain by getting {
            dependencies {
                implementation("app.cash.sqldelight:android-driver:$sqlDelightVersion")
                implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.1")
                implementation("androidx.appcompat:appcompat:1.6.1")
                api("androidx.core:core-ktx:1.10.1")
                implementation("io.insert-koin:koin-core:$koinVersion")
                implementation("io.insert-koin:koin-android:$koinVersion")
                // Google maps for Compose
                api("com.google.android.gms:play-services-location:21.0.1")
                api("com.google.android.gms:play-services-maps:18.1.0")
                implementation("com.google.maps.android:maps-compose:$mapsComposeVersion")
                // For clustering
                implementation("com.google.maps.android:maps-compose-utils:$mapsComposeVersion")
            }
        }

MascotWorld avatar Oct 18 '23 06:10 MascotWorld

Yes, i have it working on the Android side with no problems... this is an iOS issue...

Can you show the iosMain gradle versions?

Do you have the functionality on the iOS side?

Are you receiving callbacks on the iOS side for the Google Maps?

Yes, it compiles... but does it execute?

realityexpander avatar Oct 18 '23 16:10 realityexpander

I think we need to make an issue in the multiplatform compose branch, because the inability to add a delegate normally (I think so) is a library problem.

Where would that get posted? Im sure they know about it, the way im handling it on iOS side is a bit of hack, but it works, so we know it will improve from here.

realityexpander avatar Oct 19 '23 05:10 realityexpander

Yes, i have it working on the Android side with no problems... this is an iOS issue...

Can you show the iosMain gradle versions?

Do you have the functionality on the iOS side?

Are you receiving callbacks on the iOS side for the Google Maps?

Yes, it compiles... but does it execute?

Yes it works well on the iOS side. Above I have attached a screenshot where you can clearly see the log with the print.

 cocoapods {
        summary = "Some description for the Shared Module"
        homepage = "Link to the Shared Module homepage"
        version = "1.0"
        ios.deploymentTarget = "17.0"
        podfile = project.file("../iosApp/Podfile")
        framework {
            baseName = "shared"
            isStatic = true
        }
        pod("GoogleMaps") {
            version = "8.2.0"
        }
    }

Btw use "val googleMapView = GMSMapView()" not " val googleMapView = remember { GMSMapView() }" that helped me.

MascotWorld avatar Oct 19 '23 07:10 MascotWorld

GoogleMaps.zip it's from ur project, all working properly

MascotWorld avatar Oct 19 '23 07:10 MascotWorld

OK, im confused here…

Is the Google Maps “tapOnMarker” functionality working for you on the iOS side?

Yes, it all works on Android, that’s not the problem.

Are you able to use the “tapOnMarker” callback on the iOS side, or just giving the compile warning and doesn’t actually received tap events?

Thanks for the responses!

Best, Chris

On Oct 19, 2023, at 2:19 AM, MascotWorld @.***> wrote:

GoogleMaps.zip https://github.com/googlemaps/android-maps-compose/files/13039249/GoogleMaps.zip it's from ur project, all working properly

— Reply to this email directly, view it on GitHub https://github.com/googlemaps/android-maps-compose/issues/312#issuecomment-1770207932, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABHLEYXP5PS5ETQKUQE6JWDYADH7BAVCNFSM6AAAAAAXF6YCHKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONZQGIYDOOJTGI. You are receiving this because you were mentioned.

realityexpander avatar Oct 19 '23 17:10 realityexpander

OK, im confused here… Is the Google Maps “tapOnMarker” functionality working for you on the iOS side? Yes, it all works on Android, that’s not the problem. Are you able to use the “tapOnMarker” callback on the iOS side, or just giving the compile warning and doesn’t actually received tap events? Thanks for the responses! Best, Chris … On Oct 19, 2023, at 2:19 AM, MascotWorld @.***> wrote: GoogleMaps.zip https://github.com/googlemaps/android-maps-compose/files/13039249/GoogleMaps.zip it's from ur project, all working properly — Reply to this email directly, view it on GitHub <#312 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABHLEYXP5PS5ETQKUQE6JWDYADH7BAVCNFSM6AAAAAAXF6YCHKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONZQGIYDOOJTGI. You are receiving this because you were mentioned.

The callback works great! you can check it yourself, I attached the file GoogleMaps.kt (from iosMain), you can replace it in your project and run it.

MascotWorld avatar Oct 19 '23 17:10 MascotWorld

Looked at your info, and still not able to compile any GMSMapViewDelegateProtocol on the iOS side. Error is below.

OK, there must be a versions mismatch... Can I see your build.gradle.kts (:shared)

Thanks in advance! Best, Chris

image

realityexpander avatar Oct 20 '23 00:10 realityexpander

i have same error, but project is compiles. Here is whole project(with build files) with working click: https://drive.google.com/file/d/10vpPs69yPxUMNiTv9UCXuHbkDoVnTdru/view?usp=share_link You can check it out. in root is screen record where i show work

MascotWorld avatar Oct 20 '23 09:10 MascotWorld

i have same error, but project is compiles. Here is whole project(with build files) with working click: https://drive.google.com/file/d/10vpPs69yPxUMNiTv9UCXuHbkDoVnTdru/view?usp=share_link You can check it out. in root is screen record where i show work

WOW! Thank you for supplying this...

I loaded your supplied project in both AS Giraffe and Hedgehog (Iguana is too new yet), and have the same problems...

Im now wondering what version of AS you are running?

Here's my version info:

Android Studio Giraffe | 2022.3.1 Patch 2
Build #AI-223.8836.35.2231.10811636, built on September 14, 2023
Runtime version: 17.0.6+0-17.0.6b829.9-10027231 aarch64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 13.5.2
GC: G1 Young Generation, G1 Old Generation
Memory: 4096M
Cores: 10
Metal Rendering is ON
Registry:
    analyze.exceptions.on.the.fly=true
    external.system.auto.import.disabled=true
    debugger.new.tool.window.layout=true
    ide.text.editor.with.preview.show.floating.toolbar=false
    ide.tooltip.initialDelay=812
    ide.experimental.ui=true
    ide.browser.jcef.gpu.disable=true

Non-Bundled Plugins:
    com.github.kaustubhpatange.composecolor (0.0.7)
    com.c5inco.modifiers (1.0.14)
    com.github.DerekBum.composeSlidesPresenter (0.1.2)
    com.github.copilot (1.3.2.3479)
    wu.seal.tool.jsontokotlin (3.7.4)
    idea.plugin.protoeditor (223.8214.6)
    com.wakatime.intellij.plugin (14.2.3)
    com.github.airsaid.androidlocalize (3.0.0)
    DBN (3.4.1620.0)
    net.seesharpsoft.intellij.plugins.csv (3.2.2-223)
    org.jetbrains.kotlin-js-inspection-pack-plugin (0.0.12)
    com.jetbrains.kmm (0.8.0(223)-25)
    com.squareup.sqldelight (2.0.0)
    com.developerphil.adbidea (1.6.12)
    org.jetbrains.compose.desktop.ide (1.5.3)
    by.overpass.svg-to-compose-intellij (0.12)
    mobi.hsz.idea.gitignore (4.4.4)
    com.abeade.plugin.figma.import (1.2.1)
Android Studio Hedgehog | 2023.1.1 RC 1
Build #AI-231.9392.1.2311.10949950, built on October 13, 2023
Runtime version: 17.0.7+0-17.0.7b1000.6-10550314 aarch64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 13.5.2
GC: G1 Young Generation, G1 Old Generation
Memory: 4096M
Cores: 10
Metal Rendering is ON
Registry:
    analyze.exceptions.on.the.fly=true
    external.system.auto.import.disabled=true
    debugger.new.tool.window.layout=true
    ide.text.editor.with.preview.show.floating.toolbar=false
    ide.tooltip.initialDelay=812
    ide.experimental.ui=true
    ide.browser.jcef.gpu.disable=true

Non-Bundled Plugins:
    com.c5inco.modifiers (1.0.14)
    com.github.copilot (1.3.2.3479)
    wu.seal.tool.jsontokotlin (3.7.4)
    org.jetbrains.kotlin (231-1.9.20-RC-release-459-AS8109.175)
    idea.plugin.protoeditor (231.9225.5)
    com.wakatime.intellij.plugin (14.2.3)
    com.github.airsaid.androidlocalize (3.0.0)
    DBN (3.4.1620.0)
    net.seesharpsoft.intellij.plugins.csv (3.2.2-231)
    com.jetbrains.kmm (0.8.0(231)-19)
    com.squareup.sqldelight (2.0.0)
    com.developerphil.adbidea (1.6.11)
    org.jetbrains.compose.desktop.ide (1.5.3)
    by.overpass.svg-to-compose-intellij (0.12)
    mobi.hsz.idea.gitignore (4.5.2)
    com.abeade.plugin.figma.import (1.2.1)

realityexpander avatar Oct 20 '23 19:10 realityexpander

i have same error, but project is compiles. Here is whole project(with build files) with working click: https://drive.google.com/file/d/10vpPs69yPxUMNiTv9UCXuHbkDoVnTdru/view?usp=share_link You can check it out. in root is screen record where i show work

WOW! Thank you for supplying this...

I loaded your supplied project in both AS Giraffe and Hedgehog (Iguana is too new yet), and have the same problems...

Im now wondering what version of AS you are running?

Here's my version info:

Android Studio Giraffe | 2022.3.1 Patch 2
Build #AI-223.8836.35.2231.10811636, built on September 14, 2023
Runtime version: 17.0.6+0-17.0.6b829.9-10027231 aarch64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 13.5.2
GC: G1 Young Generation, G1 Old Generation
Memory: 4096M
Cores: 10
Metal Rendering is ON
Registry:
    analyze.exceptions.on.the.fly=true
    external.system.auto.import.disabled=true
    debugger.new.tool.window.layout=true
    ide.text.editor.with.preview.show.floating.toolbar=false
    ide.tooltip.initialDelay=812
    ide.experimental.ui=true
    ide.browser.jcef.gpu.disable=true

Non-Bundled Plugins:
    com.github.kaustubhpatange.composecolor (0.0.7)
    com.c5inco.modifiers (1.0.14)
    com.github.DerekBum.composeSlidesPresenter (0.1.2)
    com.github.copilot (1.3.2.3479)
    wu.seal.tool.jsontokotlin (3.7.4)
    idea.plugin.protoeditor (223.8214.6)
    com.wakatime.intellij.plugin (14.2.3)
    com.github.airsaid.androidlocalize (3.0.0)
    DBN (3.4.1620.0)
    net.seesharpsoft.intellij.plugins.csv (3.2.2-223)
    org.jetbrains.kotlin-js-inspection-pack-plugin (0.0.12)
    com.jetbrains.kmm (0.8.0(223)-25)
    com.squareup.sqldelight (2.0.0)
    com.developerphil.adbidea (1.6.12)
    org.jetbrains.compose.desktop.ide (1.5.3)
    by.overpass.svg-to-compose-intellij (0.12)
    mobi.hsz.idea.gitignore (4.4.4)
    com.abeade.plugin.figma.import (1.2.1)
Android Studio Hedgehog | 2023.1.1 RC 1
Build #AI-231.9392.1.2311.10949950, built on October 13, 2023
Runtime version: 17.0.7+0-17.0.7b1000.6-10550314 aarch64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 13.5.2
GC: G1 Young Generation, G1 Old Generation
Memory: 4096M
Cores: 10
Metal Rendering is ON
Registry:
    analyze.exceptions.on.the.fly=true
    external.system.auto.import.disabled=true
    debugger.new.tool.window.layout=true
    ide.text.editor.with.preview.show.floating.toolbar=false
    ide.tooltip.initialDelay=812
    ide.experimental.ui=true
    ide.browser.jcef.gpu.disable=true

Non-Bundled Plugins:
    com.c5inco.modifiers (1.0.14)
    com.github.copilot (1.3.2.3479)
    wu.seal.tool.jsontokotlin (3.7.4)
    org.jetbrains.kotlin (231-1.9.20-RC-release-459-AS8109.175)
    idea.plugin.protoeditor (231.9225.5)
    com.wakatime.intellij.plugin (14.2.3)
    com.github.airsaid.androidlocalize (3.0.0)
    DBN (3.4.1620.0)
    net.seesharpsoft.intellij.plugins.csv (3.2.2-231)
    com.jetbrains.kmm (0.8.0(231)-19)
    com.squareup.sqldelight (2.0.0)
    com.developerphil.adbidea (1.6.11)
    org.jetbrains.compose.desktop.ide (1.5.3)
    by.overpass.svg-to-compose-intellij (0.12)
    mobi.hsz.idea.gitignore (4.5.2)
    com.abeade.plugin.figma.import (1.2.1)

this is my

Android Studio Giraffe | 2022.3.1 Patch 2
Build #AI-223.8836.35.2231.10811636, built on September 15, 2023
Runtime version: 17.0.6+0-17.0.6b829.9-10027231 aarch64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 14.0
GC: G1 Young Generation, G1 Old Generation
Memory: 2048M
Cores: 8
Metal Rendering is ON
Registry:
    external.system.auto.import.disabled=true
    debugger.new.tool.window.layout=true
    ide.text.editor.with.preview.show.floating.toolbar=false
    ide.experimental.ui=true

Non-Bundled Plugins:
    com.c5inco.modifiers (1.0.14)
    com.levinzonr.arch.jetpackcompose.plugin (1.1.0)
    com.jetbrains.kmm (0.6.1(223)-18)
    com.squareup.sqldelight (2.1.0-SNAPSHOT-1697294713387)
    org.jetbrains.compose.desktop.ide (1.5.3)
    com.thelumiereguy.compose_helper (2.0.4)

MascotWorld avatar Oct 21 '23 08:10 MascotWorld

this is my

Android Studio Giraffe | 2022.3.1 Patch 2
    com.jetbrains.kmm (0.6.1(223)-18)

It looks like we are using different versions of the jetbrains KMM plugin. You have an earlier version, and mine is the latest... looks like they broke it in the latest version...

mine: com.jetbrains.kmm (0.8.0(223)-25) yours: com.jetbrains.kmm (0.6.1(223)-18)

Im going to explore if I can downgrade, or I'm locked in to the latest version.

realityexpander avatar Oct 21 '23 09:10 realityexpander

Maybe this is the point) Try downgrading and report back how it turned out

MascotWorld avatar Oct 21 '23 09:10 MascotWorld

Just tried to use it with the 0.6.1 version of KMM plugin inside Flamingo (newer AS are incompatible and will not load the plugin) - Still has the same issue.

So, Im going to chalk this up as an unsolved mystery and await a better solution from google soon. At least the Android side works great, and compose is not an issue... It's a c-interop library issue.

Since they addressed it on the Android side for Google Maps in Compse, I can only assume Google or Jetbrains are working on this for compose for KMP.

realityexpander avatar Oct 21 '23 23:10 realityexpander

Just tried to use it with the 0.6.1 version of KMM plugin inside Flamingo (newer AS are incompatible and will not load the plugin) - Still has the same issue.

So, Im going to chalk this up as an unsolved mystery and await a better solution from google soon. At least the Android side works great, and compose is not an issue... It's a c-interop library issue.

Since they addressed it on the Android side for Google Maps in Compse, I can only assume Google or Jetbrains are working on this for compose for KMP.

can you show the error? my android studio itself updated the plugin (ahem) and I received an error related to Could not find "co.touchlab:stately-common" and I solved it)

MascotWorld avatar Oct 23 '23 09:10 MascotWorld

Just tried to use it with the 0.6.1 version of KMM plugin inside Flamingo (newer AS are incompatible and will not load the plugin) - Still has the same issue.

So, Im going to chalk this up as an unsolved mystery and await a better solution from google soon. At least the Android side works great, and compose is not an issue... It's a c-interop library issue.

Since they addressed it on the Android side for Google Maps in Compse, I can only assume Google or Jetbrains are working on this for compose for KMP.

can you show the error? my android studio itself updated the plugin (ahem) and I received an error related to Could not find "co.touchlab:stately-common" and I solved it)

It's the same error as before

realityexpander avatar Oct 23 '23 18:10 realityexpander

Its the exact same error as I have been showing in my previous replies.

Going back to previous versions of AS and KMM plug-in are not solutions for me at this time

Chris

On Oct 23, 2023, at 4:02 AM, MascotWorld @.***> wrote:

Just tried to use it with the 0.6.1 version of KMM plugin inside Flamingo (newer AS are incompatible and will not load the plugin) - Still has the same issue.

So, Im going to chalk this up as an unsolved mystery and await a better solution from google soon. At least the Android side works great, and compose is not an issue... It's a c-interop library issue.

Since they addressed it on the Android side for Google Maps in Compse, I can only assume Google or Jetbrains are working on this for compose for KMP. can you show the error? my android studio itself updated the plugin (ahem) and I received an error related to Could not find "co.touchlab:stately-common" and I solved it)

— Reply to this email directly, view it on GitHub https://github.com/googlemaps/android-maps-compose/issues/312#issuecomment-1774739041, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABHLEYWNSGDD4QWZVZIA7Q3YAYXA7AVCNFSM6AAAAAAXF6YCHKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONZUG4ZTSMBUGE. You are receiving this because you were mentioned.

realityexpander avatar Oct 23 '23 20:10 realityexpander

@realityexpander there is a regression introduced in android-maps-compose 1.4.21 that causes recomposed GoogleMap listeners to not be used. Wonder if this might contribute to your obstacles. #466

bubenheimer avatar Nov 28 '23 15:11 bubenheimer

Its a compile time issue, the compiler gives a warning and the listeners are not setup properly. This is an internal google library issue and hopefully there will be a fix soon.

realityexpander avatar Nov 28 '23 22:11 realityexpander

The

override fun mapView(
            mapView: GMSMapView,
            didTapMarker: GMSMarker
) { 
...
}

definitely works. You just have to run the iOS app via Xcode and not via AS.

with AS, I have the same issue like you @realityexpander, I can't compile & have the same error (Return type is 'Boolean', which is not a subtype of overridden), thus can't run the iOS app via there.

Maybe you can try running the iOS app via xcode instead.

yukarlo avatar Nov 30 '23 14:11 yukarlo

I'll give it a try, i did not try compiling and running from xcode.

UPDATE:

The app does indeed compile from XCode, but I was not able to get any responses from UI taps on iOS using either print statements or debug breakpoints.

Feel free to share your project and version information for all the libraries and IDE's...

realityexpander avatar Dec 01 '23 02:12 realityexpander