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)
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 FAILEDwith 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:
“@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
See https://github.com/rnmapbox/maps/pull/3465/files
You might be able to work around that using
Add this to your andorid/build.gradle file after
kotlinVersion = 1.7...inbuildscript { ext {any updates ?!
finally it’s worked on 10.1.31-rc.1
@tdavis10 Downgraded to 10.1.29 and it works
For those whose still encountering this issue install this patch from baralmanish
Still an issue
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”,
[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?’.
Same for me, same environments
果然,升级到 10.1.31 也对我有用
Oh thanks, upgrading to 10.1.31 works for me also