maps icon indicating copy to clipboard operation
maps copied to clipboard

[Bug]: Expo 53 Task :rnmapbox_maps:compileDebugKotlin FAILED

Open MariuzM opened this issue 7 months ago β€’ 16 comments

Mapbox Implementation

Mapbox

Mapbox Version

10.1.38

React Native Version

0.79.2

Platform

Android

@rnmapbox/maps version

10.1.38

Standalone component to reproduce

import React from 'react';
import {
  MapView,
  ShapeSource,
  LineLayer,
  Camera,
} from '@rnmapbox/maps';

const aLine = {
  type: 'LineString',
  coordinates: [
    [-74.00597, 40.71427],
    [-74.00697, 40.71527],
  ],
};

class BugReportExample extends React.Component {
  render() {
    return (
      <MapView style={{flex: 1}}>
        <Camera centerCoordinate={[-74.00597, 40.71427]} zoomLevel={14} />
        <ShapeSource id="idStreetLayer" shape={aLine}>
          <LineLayer id="idStreetLayer" />
        </ShapeSource>
      </MapView>
    );
  }
}

Observed behavior and steps to reproduce

Starting project getting error

Expected behavior

No response

Notes / preliminary analysis

No response

Additional links and references

No response

MariuzM avatar May 02 '25 04:05 MariuzM

same to me. i can't build that app

umardev500 avatar May 02 '25 11:05 umardev500

yarn android
yarn run v1.22.22
$ expo run:android
β€Ί Building app...
Configuration on demand is an incubating feature.

> Configure project :
[ExpoRootProject] Using the following versions:
  - buildTools:  35.0.0
  - minSdk:      24
  - compileSdk:  35
  - targetSdk:   35
  - ndk:         27.1.12297006
  - kotlin:      2.0.21
  - ksp:         2.0.21-1.0.28

> Configure project :app
 ℹ️  Applying gradle plugin 'expo-dev-launcher-gradle-plugin'

> Configure project :expo

Using expo modules
  - expo-constants (17.1.5)
  - expo-dev-client (5.1.7)
  - expo-dev-launcher (5.1.10)
  - expo-dev-menu (6.1.9)
  - expo-dev-menu-interface (1.10.0)
  - expo-json-utils (0.15.0)
  - expo-manifests (0.16.4)
  - expo-modules-core (2.3.12)
  - expo-updates-interface (1.1.0)
  - [πŸ“¦] expo-asset (11.1.4)
  - [πŸ“¦] expo-blur (14.1.4)
  - [πŸ“¦] expo-file-system (18.1.8)
  - [πŸ“¦] expo-font (13.3.0)
  - [πŸ“¦] expo-haptics (14.1.4)
  - [πŸ“¦] expo-image (2.1.6)
  - [πŸ“¦] expo-keep-awake (14.1.4)
  - [πŸ“¦] expo-linking (7.1.4)
  - [πŸ“¦] expo-splash-screen (0.30.8)
  - [πŸ“¦] expo-system-ui (5.0.7)
  - [πŸ“¦] expo-web-browser (14.1.6)


> Configure project :react-native-reanimated
Android gradle plugin: 8.8.2
Gradle: 8.13

> Task :rnmapbox_maps:compileDebugKotlin
e: file:///home/umar/Files/Coding/React/Expo/public-service/node_modules/@rnmapbox/maps/android/src/main/java/com/rnmapbox/rnmbx/components/images/RNMBXImagesManager.kt:252:29 Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type 'com.facebook.react.bridge.ReadableArray?'.
e: file:///home/umar/Files/Coding/React/Expo/public-service/node_modules/@rnmapbox/maps/android/src/main/java/com/rnmapbox/rnmbx/components/images/RNMBXImagesManager.kt:252:49 Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type 'com.facebook.react.bridge.ReadableArray?'.
e: file:///home/umar/Files/Coding/React/Expo/public-service/node_modules/@rnmapbox/maps/android/src/main/java/com/rnmapbox/rnmbx/components/images/RNMBXImagesManager.kt:252:91 Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type 'com.facebook.react.bridge.ReadableArray?'.
e: file:///home/umar/Files/Coding/React/Expo/public-service/node_modules/@rnmapbox/maps/android/src/main/java/com/rnmapbox/rnmbx/components/images/RNMBXImagesManager.kt:255:51 Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type 'com.facebook.react.bridge.ReadableArray?'.
e: file:///home/umar/Files/Coding/React/Expo/public-service/node_modules/@rnmapbox/maps/android/src/main/java/com/rnmapbox/rnmbx/components/images/RNMBXImagesManager.kt:255:80 Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type 'com.facebook.react.bridge.ReadableArray?'.
e: file:///home/umar/Files/Coding/React/Expo/public-service/node_modules/@rnmapbox/maps/android/src/main/java/com/rnmapbox/rnmbx/components/mapview/RNMBXMapView.kt:18:27 Unresolved reference 'ViewTreeLifecycleOwner'.
e: file:///home/umar/Files/Coding/React/Expo/public-service/node_modules/@rnmapbox/maps/android/src/main/java/com/rnmapbox/rnmbx/components/mapview/RNMBXMapView.kt:119:30 Class '<anonymous>' is not abstract and does not implement abstract member 'lifecycle'.
e: file:///home/umar/Files/Coding/React/Expo/public-service/node_modules/@rnmapbox/maps/android/src/main/java/com/rnmapbox/rnmbx/components/mapview/RNMBXMapView.kt:134:17 'getLifecycle' overrides nothing.
e: file:///home/umar/Files/Coding/React/Expo/public-service/node_modules/@rnmapbox/maps/android/src/main/java/com/rnmapbox/rnmbx/components/mapview/RNMBXMapView.kt:138:13 Unresolved reference 'ViewTreeLifecycleOwner'.
e: file:///home/umar/Files/Coding/React/Expo/public-service/node_modules/@rnmapbox/maps/android/src/main/java/com/rnmapbox/rnmbx/components/mapview/RNMBXMapViewManager.kt:37:16 Argument type mismatch: actual type is 'kotlin.String?', but 'kotlin.String' was expected.
e: file:///home/umar/Files/Coding/React/Expo/public-service/node_modules/@rnmapbox/maps/android/src/main/java/com/rnmapbox/rnmbx/components/mapview/RNMBXMapViewManager.kt:43:9 Argument type mismatch: actual type is 'kotlin.String?', but 'kotlin.String' was expected.
e: file:///home/umar/Files/Coding/React/Expo/public-service/node_modules/@rnmapbox/maps/android/src/main/java/com/rnmapbox/rnmbx/components/styles/RNMBXStyleValue.kt:85:28 Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type 'com.facebook.react.bridge.ReadableMap?'.
e: file:///home/umar/Files/Coding/React/Expo/public-service/node_modules/@rnmapbox/maps/android/src/main/java/com/rnmapbox/rnmbx/components/styles/RNMBXStyleValue.kt:107:29 Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type 'com.facebook.react.bridge.ReadableMap?'.
e: file:///home/umar/Files/Coding/React/Expo/public-service/node_modules/@rnmapbox/maps/android/src/main/java/com/rnmapbox/rnmbx/components/styles/RNMBXStyleValue.kt:124:45 Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type 'com.facebook.react.bridge.ReadableArray?'.
e: file:///home/umar/Files/Coding/React/Expo/public-service/node_modules/@rnmapbox/maps/android/src/main/java/com/rnmapbox/rnmbx/components/styles/RNMBXStyleValue.kt:124:55 Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type 'com.facebook.react.bridge.ReadableMap?'.
e: file:///home/umar/Files/Coding/React/Expo/public-service/node_modules/@rnmapbox/maps/android/src/main/java/com/rnmapbox/rnmbx/components/styles/RNMBXStyleValue.kt:126:33 Argument type mismatch: actual type is 'com.facebook.react.bridge.ReadableMap?', but 'com.facebook.react.bridge.ReadableMap' was expected.
e: file:///home/umar/Files/Coding/React/Expo/public-service/node_modules/@rnmapbox/maps/android/src/main/java/com/rnmapbox/rnmbx/components/styles/RNMBXStyleValue.kt:126:41 Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type 'com.facebook.react.bridge.ReadableArray?'.
e: file:///home/umar/Files/Coding/React/Expo/public-service/node_modules/@rnmapbox/maps/android/src/main/java/com/rnmapbox/rnmbx/components/styles/sources/RNMBXShapeSourceManager.kt:122:40 None of the following candidates is applicable:
fun literal(value: HashMap<String, Any>): Expression
fun literal(value: List<Any>): Expression
e: file:///home/umar/Files/Coding/React/Expo/public-service/node_modules/@rnmapbox/maps/android/src/main/java/com/rnmapbox/rnmbx/components/styles/sources/RNMBXTileSourceManager.kt:44:26 Argument type mismatch: actual type is 'kotlin.String?', but 'kotlin.String' was expected.
e: file:///home/umar/Files/Coding/React/Expo/public-service/node_modules/@rnmapbox/maps/android/src/main/java/com/rnmapbox/rnmbx/shapeAnimators/RNMBXChangeLineOffsetsShapeAnimatorModule.kt:213:41 Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type 'com.facebook.react.bridge.ReadableArray?'.
e: file:///home/umar/Files/Coding/React/Expo/public-service/node_modules/@rnmapbox/maps/android/src/main/java/com/rnmapbox/rnmbx/shapeAnimators/RNMBXChangeLineOffsetsShapeAnimatorModule.kt:213:59 Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type 'com.facebook.react.bridge.ReadableArray?'.
e: file:///home/umar/Files/Coding/React/Expo/public-service/node_modules/@rnmapbox/maps/android/src/main/java/com/rnmapbox/rnmbx/utils/extensions/Dynamic.kt:41:42 None of the following candidates is applicable:
static fun valueOf(p0: Double): Value
static fun valueOf(p0: Long): Value
static fun valueOf(p0: Boolean): Value
static fun valueOf(p0: String): Value
static fun valueOf(p0: (MutableList<Value!>..List<Value!>)): Value
static fun valueOf(p0: HashMap<String!, Value!>): Value
e: file:///home/umar/Files/Coding/React/Expo/public-service/node_modules/@rnmapbox/maps/android/src/main/java/com/rnmapbox/rnmbx/utils/extensions/Dynamic.kt:42:46 Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type 'com.facebook.react.bridge.ReadableArray?'.
e: file:///home/umar/Files/Coding/React/Expo/public-service/node_modules/@rnmapbox/maps/android/src/main/java/com/rnmapbox/rnmbx/utils/extensions/Dynamic.kt:43:42 Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type 'com.facebook.react.bridge.ReadableMap?'.
e: file:///home/umar/Files/Coding/React/Expo/public-service/node_modules/@rnmapbox/maps/android/src/main/java/com/rnmapbox/rnmbx/utils/extensions/ReadableArray.kt:49:53 Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type 'com.facebook.react.bridge.ReadableMap?'.
e: file:///home/umar/Files/Coding/React/Expo/public-service/node_modules/@rnmapbox/maps/android/src/main/java/com/rnmapbox/rnmbx/utils/extensions/ReadableArray.kt:50:57 Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type 'com.facebook.react.bridge.ReadableArray?'.
e: file:///home/umar/Files/Coding/React/Expo/public-service/node_modules/@rnmapbox/maps/android/src/main/java/com/rnmapbox/rnmbx/utils/extensions/ReadableMap.kt:28:26 Argument type mismatch: actual type is 'kotlin.Any?', but 'kotlin.Any' was expected.
e: file:///home/umar/Files/Coding/React/Expo/public-service/node_modules/@rnmapbox/maps/android/src/main/rn-compat/rn75/com/rnmapbox/rnmbx/rncompat/ReadableMap.kt:6:12 Return type mismatch: expected 'kotlin.collections.Iterator<kotlin.collections.Map.Entry<kotlin.String, kotlin.Any>>', actual 'kotlin.collections.Iterator<kotlin.collections.Map.Entry<kotlin.String, kotlin.Any?>>'.

> Task :rnmapbox_maps:compileDebugKotlin FAILED
The Daemon will expire after the build after running out of JVM Metaspace.
The project memory settings are likely not configured or are configured to an insufficient value.
The daemon will restart for the next build, which may increase subsequent build times.
These settings can be adjusted by setting 'org.gradle.jvmargs' in 'gradle.properties'.
The currently configured max heap space is '2 GiB' and the configured max metaspace is '512 MiB'.
For more information on how to set these values, please refer to https://docs.gradle.org/8.13/userguide/build_environment.html#sec:configuring_jvm_memory in the Gradle documentation.
To disable this warning, set 'org.gradle.daemon.performance.disable-logging=true'.
Daemon will be stopped at the end of the build after running out of JVM Metaspace

[Incubating] Problems report is available at: file:///home/umar/Files/Coding/React/Expo/public-service/android/build/reports/problems/problems-report.html

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':rnmapbox_maps:compileDebugKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
   > Compilation error. See log for more details

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

For more on this, please refer to https://docs.gradle.org/8.13/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.

BUILD FAILED in 59s
383 actionable tasks: 11 executed, 372 up-to-date
Error: /home/umar/Files/Coding/React/Expo/public-service/android/gradlew app:assembleDebug -x lint -x test --configure-on-demand --build-cache -PreactNativeDevServerPort=8081 -PreactNativeArchitectures=x86_64,arm64-v8a exited with non-zero code: 1
Error: /home/umar/Files/Coding/React/Expo/public-service/android/gradlew app:assembleDebug -x lint -x test --configure-on-demand --build-cache -PreactNativeDevServerPort=8081 -PreactNativeArchitectures=x86_64,arm64-v8a exited with non-zero code: 1
    at ChildProcess.completionListener (/home/umar/Files/Coding/React/Expo/public-service/node_modules/@expo/spawn-async/src/spawnAsync.ts:67:13)
    at Object.onceWrapper (node:events:639:26)
    at ChildProcess.emit (node:events:524:28)
    at maybeClose (node:internal/child_process:1101:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:304:5)
    ...
    at spawnAsync (/home/umar/Files/Coding/React/Expo/public-service/node_modules/@expo/spawn-async/src/spawnAsync.ts:28:21)
    at spawnGradleAsync (/home/umar/Files/Coding/React/Expo/public-service/node_modules/@expo/cli/src/start/platforms/android/gradle.ts:134:28)
    at assembleAsync (/home/umar/Files/Coding/React/Expo/public-service/node_modules/@expo/cli/src/start/platforms/android/gradle.ts:83:16)
    at runAndroidAsync (/home/umar/Files/Coding/React/Expo/public-service/node_modules/@expo/cli/src/run/android/runAndroidAsync.ts:65:24)

umardev500 avatar May 02 '25 11:05 umardev500

There is a pull request that fixes this, applying the patch here fixed the issue for me.

fix(android): support RN 0.77

gaspop avatar May 02 '25 17:05 gaspop

i have the same issue

Alvi24 avatar May 07 '25 16:05 Alvi24

Started from here https://github.com/rnmapbox/maps/issues/3492#issuecomment-2863772933, seems to work

jimfilippou avatar May 10 '25 21:05 jimfilippou

Same to me. The patch didn't solve the bug

tomislavkrnic avatar May 15 '25 08:05 tomislavkrnic

Similar thing happening to me. I managed to build with the patch but then it crashes immediately on app open

LukakHR avatar May 15 '25 10:05 LukakHR

Same here, any news about the next version that will patch it ?

rboulesnane avatar May 20 '25 11:05 rboulesnane

Same issue, I have tried multiple versions of library with react native 0.79 project and 0.76 but didn't worked

asfaqe-bacancy avatar May 20 '25 11:05 asfaqe-bacancy

Same issue here, patch doesn't seem to solve it.

Cookizza avatar May 23 '25 02:05 Cookizza

Can anyone try *39 release pls?

MariuzM avatar May 30 '25 10:05 MariuzM

I am trying i noticed this line when starting expo

[Codegen] [DEPRECATED] @rnmapbox/maps should add the 'ios.componentProvider' property in their codegenConfig

MariuzM avatar May 30 '25 10:05 MariuzM

10.1.38 Tried this doesn't work in android. @MariuzM

asfaqe-bacancy avatar May 30 '25 10:05 asfaqe-bacancy

Might be unrelated but good damn

Image

MariuzM avatar May 30 '25 10:05 MariuzM

I'm really confused why cocopods have updated version? My process when installing all packages i always delete ios android folders and rebuild everything from scratch but i don’t understand this Image

MariuzM avatar May 30 '25 11:05 MariuzM

Ok so the 39 is working for me on Android now but weird thing about this Expo Linking and why cocopods have newer version then my npm package ?

Image

MariuzM avatar May 30 '25 11:05 MariuzM

I can confirm there is still some weird issues with mapbox so annoying

Image

MariuzM avatar Jun 18 '25 08:06 MariuzM

Using latest patched release version 10.1.39 fixed it for me (I was previously locked into 10.1.36 without a ^)

@rnmapbox/maps: ^10.1.39 expo: ^53.0.11 react-native: 0.79.3

conor909 avatar Jun 18 '25 19:06 conor909

I can confirm there is still some weird issues with mapbox so annoying

Image

stuck for three days in this issue

shayan1317 avatar Jul 09 '25 13:07 shayan1317

I also had some trouble compiling kotlin, I had issues getting the newest version up and running. Maybe this will help some of you too:

Ok I finally got it working.

Not totally sure what the exact issue was. Because for me it was a mismatch between kotlinVersion, Gradle, java or React-Native.

So I will share my setup:

java version: jdk-17.0.2

App level build.gradle: https://pastebin.com/b17W6R8x

Android build.gradle: https://pastebin.com/JAcJ7n8z

android/app/src/main/java/com/APPNAME/MainApplication.kt: https://pastebin.com/cPxEP4WH

package.json: https://pastebin.com/hg7kieuA

gradle-wrapper.properties: https://pastebin.com/q9Nfd8c1

timtim32 avatar Jul 10 '25 14:07 timtim32

Thanks for helping

On Thu, 10 Jul 2025 at 19:08, timtim32 @.***> wrote:

timtim32 left a comment (rnmapbox/maps#3851) https://github.com/rnmapbox/maps/issues/3851#issuecomment-3057618493

I had issues getting the newest version up and running. Maybe this will help some of you too:

Ok I finally got it working.

Not totally sure what the exact issue was. Because for me it was a mismatch between kotlinVersion, Gradle, java or React-Native.

So I will share my setup:

java version: jdk-17.0.2

App level build.gradle: https://pastebin.com/b17W6R8x

Android build.gradle: https://pastebin.com/JAcJ7n8z

android/app/src/main/java/com/APPNAME/MainApplication.kt: https://pastebin.com/cPxEP4WH

package.json: https://pastebin.com/hg7kieuA

gradle-wrapper.properties: https://pastebin.com/q9Nfd8c1

β€” Reply to this email directly, view it on GitHub https://github.com/rnmapbox/maps/issues/3851#issuecomment-3057618493, or unsubscribe https://github.com/notifications/unsubscribe-auth/AN73KYONL2GMJWPX7FOSWC33HZXU3AVCNFSM6AAAAAB4JG6ODKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTANJXGYYTQNBZGM . You are receiving this because you commented.Message ID: @.***>

shayan1317 avatar Jul 10 '25 14:07 shayan1317

I had the same error when upgrading Expo from 52 to 53 and I confirm that upgrading @rnmapbox/maps from 10.1.36 to 10.1.39 fixed it for me.

Don't forget to run the prebuild comment again to rebuild the native code

mmarie4 avatar Jul 16 '25 09:07 mmarie4

I had the same error when upgrading Expo from 52 to 53 and I confirm that upgrading @rnmapbox/maps from 10.1.36 to 10.1.39 fixed it for me.

Don't forget to run the prebuild comment again to rebuild the native code

is it working in both android and iOS ?

asfaqe-bacancy avatar Jul 17 '25 04:07 asfaqe-bacancy

To add some more context to this, I've found updating the targetSdk to 35 (as soon to be required by Play Console) is causing the issue. Attempting to then set the RNMapboxMapsVersion to 11.13.4 didn't fix it.

Environment: Expo: 52.0.47 React Native: 0.76.9 @rnmapbox/maps: 10.1.39

mgray88 avatar Jul 23 '25 13:07 mgray88

I had the same error when upgrading Expo from 52 to 53 and I confirm that upgrading @rnmapbox/maps from 10.1.36 to 10.1.39 fixed it for me. Don't forget to run the prebuild comment again to rebuild the native code

is it working in both android and iOS ?

Yes this worked on both Android and iOS "expo": "^53.0.0" "react-native": "0.79.5" "@rnmapbox/maps": "10.1.39"

mmarie4 avatar Jul 23 '25 15:07 mmarie4

@mfazekas completed how? Is there a commit/PR that fixes it? An upcoming release?

mgray88 avatar Sep 08 '25 12:09 mgray88

@mgray88 yes /RNMBXImagesManager.kt:252:29 Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type 'com.fac was fixed in recent versions. See changelogs in GitHub releases, for more details

mfazekas avatar Sep 08 '25 19:09 mfazekas