maps: [Bug]: Execution failed for task ':rnmapbox_maps:compileDebugKotlin'

Mapbox Implementation

Mapbox

Mapbox Version

10.17.0

React Native Version

0.72.7

Platform

Android

@rnmapbox/maps version

10.1.21

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

Good day, in an attempt to run my project on android after updating to the 10.1.21 version, I get this error rnmapbox_maps:compileDebugKotlin: failed. I was wondering what the workaround fix for this might be. From what I can see the latest update is related to the PrivacyInfo files for the IOS build where I have no issues, but android does not seem to like them.

e: /Users/martinyankov/immotech/immotech-app/node_modules/@rnmapbox/maps/android/src/main/mapbox-v11-compat/v10/com/rnmapbox/rnmbx/v11compat/StyleFactory.kt: (324, 5): Unresolved reference: TODO
e: /Users/martinyankov/immotech/immotech-app/node_modules/@rnmapbox/maps/android/src/main/mapbox-v11-compat/v10/com/rnmapbox/rnmbx/v11compat/StyleFactory.kt: (328, 5): Unresolved reference: TODO
e: /Users/martinyankov/immotech/immotech-app/node_modules/@rnmapbox/maps/android/src/main/mapbox-v11-compat/v10/com/rnmapbox/rnmbx/v11compat/StyleFactory.kt: (332, 5): Unresolved reference: TODO
e: /Users/martinyankov/immotech/immotech-app/node_modules/@rnmapbox/maps/android/src/main/mapbox-v11-compat/v10/com/rnmapbox/rnmbx/v11compat/StyleFactory.kt: (336, 5): Unresolved reference: TODO
e: /Users/martinyankov/immotech/immotech-app/node_modules/@rnmapbox/maps/android/src/main/mapbox-v11-compat/v10/com/rnmapbox/rnmbx/v11compat/StyleFactory.kt: (340, 5): Unresolved reference: TODO
e: /Users/martinyankov/immotech/immotech-app/node_modules/@rnmapbox/maps/android/src/main/mapbox-v11-compat/v10/com/rnmapbox/rnmbx/v11compat/StyleFactory.kt: (344, 5): Unresolved reference: TODO
e: /Users/martinyankov/immotech/immotech-app/node_modules/@rnmapbox/maps/android/src/main/mapbox-v11-compat/v10/com/rnmapbox/rnmbx/v11compat/StyleFactory.kt: (348, 5): Unresolved reference: TODO
e: /Users/martinyankov/immotech/immotech-app/node_modules/@rnmapbox/maps/android/src/main/mapbox-v11-compat/v10/com/rnmapbox/rnmbx/v11compat/StyleFactory.kt: (352, 5): Unresolved reference: TODO
e: /Users/martinyankov/immotech/immotech-app/node_modules/@rnmapbox/maps/android/src/main/mapbox-v11-compat/v10/com/rnmapbox/rnmbx/v11compat/StyleFactory.kt: (356, 5): Unresolved reference: TODO
e: /Users/martinyankov/immotech/immotech-app/node_modules/@rnmapbox/maps/android/src/main/mapbox-v11-compat/v10/com/rnmapbox/rnmbx/v11compat/StyleFactory.kt: (360, 5): Unresolved reference: TODO
e: /Users/martinyankov/immotech/immotech-app/node_modules/@rnmapbox/maps/android/src/main/mapbox-v11-compat/v10/com/rnmapbox/rnmbx/v11compat/StyleFactory.kt: (364, 5): Unresolved reference: TODO
e: /Users/martinyankov/immotech/immotech-app/node_modules/@rnmapbox/maps/android/src/main/mapbox-v11-compat/v10/com/rnmapbox/rnmbx/v11compat/StyleFactory.kt: (368, 5): Unresolved reference: TODO
e: /Users/martinyankov/immotech/immotech-app/node_modules/@rnmapbox/maps/android/src/main/mapbox-v11-compat/v10/com/rnmapbox/rnmbx/v11compat/StyleFactory.kt: (372, 5): Unresolved reference: TODO
e: /Users/martinyankov/immotech/immotech-app/node_modules/@rnmapbox/maps/android/src/main/mapbox-v11-compat/v10/com/rnmapbox/rnmbx/v11compat/StyleFactory.kt: (376, 5): Unresolved reference: TODO
e: /Users/martinyankov/immotech/immotech-app/node_modules/@rnmapbox/maps/android/src/main/mapbox-v11-compat/v10/com/rnmapbox/rnmbx/v11compat/StyleFactory.kt: (380, 5): Unresolved reference: TODO
e: /Users/martinyankov/immotech/immotech-app/node_modules/@rnmapbox/maps/android/src/main/mapbox-v11-compat/v10/com/rnmapbox/rnmbx/v11compat/StyleFactory.kt: (384, 5): Unresolved reference: TODO
e: /Users/martinyankov/immotech/immotech-app/node_modules/@rnmapbox/maps/android/src/main/mapbox-v11-compat/v10/com/rnmapbox/rnmbx/v11compat/StyleFactory.kt: (388, 5): Unresolved reference: TODO
e: /Users/martinyankov/immotech/immotech-app/node_modules/@rnmapbox/maps/android/src/main/mapbox-v11-compat/v10/com/rnmapbox/rnmbx/v11compat/StyleFactory.kt: (392, 5): Unresolved reference: TODO
e: /Users/martinyankov/immotech/immotech-app/node_modules/@rnmapbox/maps/android/src/main/mapbox-v11-compat/v10/com/rnmapbox/rnmbx/v11compat/style.kt: (7, 63): Unresolved reference: HashMap
e: /Users/martinyankov/immotech/immotech-app/node_modules/@rnmapbox/maps/android/src/main/mapbox-v11-compat/v10/com/rnmapbox/rnmbx/v11compat/style.kt: (8, 12): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1.
The class is loaded from /Users/martinyankov/.gradle/caches/transforms-3/29b84db2cdfda5f4957ed70faa28c917/transformed/jetified-kotlin-stdlib-1.9.21.jar!/kotlin/Unit.class

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

BUILD FAILED in 1m 28s
error Failed to install the app.
info Run CLI with --verbose flag for more details.
martinyankov@Martins-Mac-mini immotech-app % 

Expected behavior

No response

Notes / preliminary analysis

No response

Additional links and references

No response

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 1
  • Comments: 39 (1 by maintainers)

Most upvoted comments

Fresh install of latest versions today gives this issue. Tried playing with kotlinVersions, nothing helps so far.

kotlinVersion = “2.0.21” “@rnmapbox/maps”: “^10.1.37” “react-native”: “0.78.0”

Glad to see I’m not alone, but disappointed to see the issue has been closed without a proper solution.

Getting app:processDebugMainManifest FAILED with versions:

kotlinVersion = “2.0.21” “@rnmapbox/maps”: “^10.1.38” “react-native”: “0.79.2”

This is what I’m running and it’s working:

// android/build.gradle
ext {
  ...
   kotlinVersion = '1.8.0'
}
...
dependencies {
  ...
    classpath('org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.0')
 }

“@rnmapbox/maps”: “^10.1.21”,

It sounds strange as TODO is in Kotlin stdlib.

https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-t-o-d-o.html

Most likely the root cause is that you have Kotlin 1.7.1 and @rnmapbox/maps uses libs that were built using kotlin 1.9

e: /Users/martinyankov/immotech/immotech-app/node_modules/@rnmapbox/maps/android/src/main/mapbox-v11-compat/v10/com/rnmapbox/rnmbx/v11compat/style.kt: (8, 12): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1.

See https://github.com/rnmapbox/maps/pull/3465/files

You might be able to work around that using

kotlinxCoroutinesCoreVersion = 1.6.4
kotlinxCoroutinesAndroidVersion = 1.6.4

Add this to your andorid/build.gradle file after kotlinVersion = 1.7... in buildscript { ext {

any updates ?!

finally it’s worked on 10.1.31-rc.1

@tdavis10 Downgraded to 10.1.29 and it works

Glad to see I’m not alone, but disappointed to see the issue has been closed without a proper solution.

Getting app:processDebugMainManifest FAILED with versions:

kotlinVersion = “2.0.21” “@rnmapbox/maps”: “^10.1.38” “react-native”: “0.79.2”

For those whose still encountering this issue install this patch from baralmanish

Still an issue

Fresh install of latest versions today gives this issue. Tried playing with kotlinVersions, nothing helps so far.

kotlinVersion = “2.0.21” “@rnmapbox/maps”: “^10.1.37” “react-native”: “0.78.0”

I have same error with similar versions, you solved it? kotlinVersion = “2.0.21” “@rnmapbox/maps”: “^10.1.37” “react-native”: “0.78.1”

Upgrade to 10.1.31 and it works

Any one please provide solution

“@rnmapbox/maps”: “^10.1.38”, “react-native”: “0.80.0”,

Task :rnmapbox_maps:compileDebugKotlin FAILED

Task :app:buildCMakeDebug[arm64-v8a] C/C++: ninja: Entering directory `/Users/apple/Desktop/vectorApp/android/app/.cxx/Debug/394g54q2/arm64-v8a’ C/C++: In file included from /Users/apple/Desktop/vectorApp/node_modules/@rnmapbox/maps/android/build/generated/source/codegen/jni/react/renderer/components/rnmapbox_maps_specs/rnmapbox_maps_specsJSI-generated.cpp:10: C/C++: /Users/apple/Desktop/vectorApp/node_modules/@rnmapbox/maps/android/build/generated/source/codegen/jni/react/renderer/components/rnmapbox_maps_specs/rnmapbox_maps_specsJSI.h:239:22: warning: ‘facebook::react::NativeRNMBXChangeLineOffsetsShapeAnimatorModuleCxxSpecJSI::create’ hides overloaded virtual function [-Woverloaded-virtual] C/C++: 239 | virtual jsi::Value create(jsi::Runtime &rt, int tag, jsi::Array coordinates, double startOffset, double endOffset) = 0; C/C++: | ^ C/C++: /Users/apple/.gradle/caches/8.14.1/transforms/89ee2d71482aa90a74abf94579aa4b78/transformed/react-android-0.80.0-debug/prefab/modules/reactnative/include/ReactCommon/TurboModule.h:125:22: note: hidden overloaded virtual function ‘facebook::react::TurboModule::create’ declared here: different number of parameters (2 vs 5) C/C++: 125 | virtual jsi::Value create( C/C++: | ^ C/C++: In file included from /Users/apple/Desktop/vectorApp/node_modules/@rnmapbox/maps/android/build/generated/source/codegen/jni/react/renderer/components/rnmapbox_maps_specs/rnmapbox_maps_specsJSI-generated.cpp:10: C/C++: /Users/apple/Desktop/vectorApp/node_modules/@rnmapbox/maps/android/build/generated/source/codegen/jni/react/renderer/components/rnmapbox_maps_specs/rnmapbox_maps_specsJSI.h:535:22: warning: ‘facebook::react::NativeRNMBXMovePointShapeAnimatorModuleCxxSpecJSI::create’ hides overloaded virtual function [-Woverloaded-virtual] C/C++: 535 | virtual jsi::Value create(jsi::Runtime &rt, int tag, jsi::Array coordinate) = 0; C/C++: | ^ C/C++: /Users/apple/.gradle/caches/8.14.1/transforms/89ee2d71482aa90a74abf94579aa4b78/transformed/react-android-0.80.0-debug/prefab/modules/reactnative/include/ReactCommon/TurboModule.h:125:22: note: hidden overloaded virtual function ‘facebook::react::TurboModule::create’ declared here: different number of parameters (2 vs 3) C/C++: 125 | virtual jsi::Value create( C/C++: | ^ C/C++: 2 warnings generated.

[Incubating] Problems report is available at: file:///Users/apple/Desktop/vectorApp/android/build/reports/problems/problems-report.html

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.14.1/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation. 73 actionable tasks: 73 executed

info 💡 Tip: Make sure that you have set up your development environment correctly, by running npx react-native doctor. To read more about doctor command visit: https://github.com/react-native-community/cli/blob/main/packages/cli-doctor/README.md#doctor

e: file:///Users/apple/Desktop/vectorApp/node_modules/@rnmapbox/maps/android/src/main/java/com/rnmapbox/rnmbx/components/annotation/RNMBXMarkerViewManager.kt:42:64 Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type ‘ReadableArray?’. e: file:///Users/apple/Desktop/vectorApp/node_modules/@rnmapbox/maps/android/src/main/java/com/rnmapbox/rnmbx/components/annotation/RNMBXMarkerViewManager.kt:42:84 Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type ‘ReadableArray?’.

Fresh install of latest versions today gives this issue. Tried playing with kotlinVersions, nothing helps so far. kotlinVersion = “2.0.21” “@rnmapbox/maps”: “^10.1.37” “react-native”: “0.78.0”

I have same error with similar versions, you solved it? kotlinVersion = “2.0.21” “@rnmapbox/maps”: “^10.1.37” “react-native”: “0.78.1”

Same for me, same environments

果然,升级到 10.1.31 也对我有用

Oh thanks, upgrading to 10.1.31 works for me also